PDA

Просмотр полной версии : [Вопрос] почему может не работать текстдрав?



nikvlad
25.05.2017, 21:34
Раньше все работало, видимо, что-то где-то задел, что может быть?


Вот OnPlayerClickTextDraw

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Text:INVALID_TEXT_DRAW) {
if(GetPVarInt(playerid, "eatery_td"))
{
HidePlayerEateryTD(playerid);
DeletePVar(playerid, "eatery_td");
}
if(GetPVarInt(playerid, "bar_td"))
{
HidePlayerBarTD(playerid);
DeletePVar(playerid, "bar_td");
}
if(GetPVarInt(playerid, "clothes_td"))
{
HidePlayerClothesTD(playerid);
pTemp[playerid][pJustTP] = true;
SetPlayerPos(playerid, GetPVarFloat(playerid, "posx"), GetPVarFloat(playerid, "posy"), GetPVarFloat(playerid, "posz"));
SetPlayerInterior(playerid, GetPVarInt(playerid, "interior1"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid, "vw"));
SetPlayerFacingAngle(playerid, GetPVarInt(playerid, "posa"));
TogglePlayerControllable(playerid, 1);
SetPlayerSkin(playerid, GetPVarInt(playerid, "curskin"));
SetCameraBehindPlayer(playerid);
DeletePVar(playerid, "posx");
DeletePVar(playerid, "posy");
DeletePVar(playerid, "posz");
DeletePVar(playerid, "posa");
DeletePVar(playerid, "interior1");
DeletePVar(playerid, "vw");
DeletePVar(playerid, "clothes_sel");
DeletePVar(playerid, "clothes_class");
pTemp[playerid][pChangingSkin] = false;
}
}
else if(clickedid >= gEateryTextDraw[5] && clickedid <= gEateryTextDraw[8]) {
new bid = pTemp[playerid][pSelectedBusinessID], id = _:clickedid - _:gEateryTextDraw[5];
new cost = gEateryCosts[id] * gBusiness[bid][busiPrice];
SetPVarInt(playerid, "eatery_sel", id);
new mes[128];
format(mes,sizeof(mes),"{"#cW"}Прием пищи обойдется Вам в {"#cRED"}$%d{"#cW"}.",cost);
ShowPlayerDialog(playerid,dBuyFood,0,"Закусочная",mes,"Купить","Отмена");
}
else if(GetPVarInt(playerid, "eatery_td")) HidePlayerEateryTD(playerid), DeletePVar(playerid, "eatery_td");
else if(clickedid >= gBarTextDraw[6] && clickedid <= gBarTextDraw[10]) {
new bid = pTemp[playerid][pSelectedBusinessID], id = _:clickedid - _:gBarTextDraw[6];
new cost = gBarCosts[id] * gBusiness[bid][busiPrice];
SetPVarInt(playerid, "bar_sel", id);
new mes[128], str[64];
if(id == 4) str = "закуски";
else str = "выпивки";
format(mes, sizeof(mes), "{"#cW"}Покупка этой %s обойдётся Вам в {"#cRED"}$%i{"#cW"}.", str, cost);
ShowPlayerDialog(playerid, dBar, 0, "Бар", mes, "Купить", "Отмена");
}
else if(GetPVarInt(playerid, "bar_td")) HidePlayerBarTD(playerid), DeletePVar(playerid, "bar_td");
else if(clickedid == gSkinShopDraw[0]) {
new
b_skins[114][2],
b_class = 1,
b_sel = GetPVarInt(playerid, "clothes_sel"),
b_skin,
b_price,
b_max = 0,
b_str[32]
;
for(new x, z; x < sizeof(gSkins); x ++) {
b_skin = GetSkinID(b_class, pData[playerid][pSex], x);
b_price = GetSkinPrice(x);
if(!b_skin) continue;
b_skins[z][0] = b_skin;
b_skins[z][1] = b_price;
z ++;
}
for(new x; x < sizeof(b_skins) - 1; x ++) {
if(!b_skins[x + 1][0]) {
b_max = x;
break;
}
else continue;
}
if(b_sel == b_max) b_sel = 0;
else b_sel ++;
SetPlayerSkin(playerid, b_skins[b_sel][0]);
format(b_str, 32, "~y~$%i", b_skins[b_sel][1]);
PlayerTextDrawSetString(playerid, gSkinShopPriceDraw[playerid], b_str);
SetPVarInt(playerid, "clothes_sel", b_sel);
}
else if(clickedid == gSkinShopDraw[1]) {
new
b_skins2[114][2],
b_class = 1,
b_sel = GetPVarInt(playerid, "clothes_sel"),
b_skin,
b_price,
b_max = 0,
b_str[32]
;
for(new x, z; x < sizeof(gSkins); x ++) {
b_skin = GetSkinID(b_class, pData[playerid][pSex], x);
b_price = GetSkinPrice(x);
if(!b_skin) continue;
b_skins2[z][0] = b_skin;
b_skins2[z][1] = b_price;
z ++;
}
for(new x; x < sizeof(b_skins2) - 1; x ++) {
if(!b_skins2[x + 1][0]) {
b_max = x;
break;
}
else continue;
}
if(b_sel - 1 < 0) b_sel = b_max;
else b_sel --;
SetPlayerSkin(playerid, b_skins2[b_sel][0]);
format(b_str, 32, "~y~$%i", b_skins2[b_sel][1]);
PlayerTextDrawSetString(playerid, gSkinShopPriceDraw[playerid], b_str);
SetPVarInt(playerid, "clothes_sel", b_sel);
}
else if(clickedid == gSkinShopDraw[3]) {
new
b_skin = GetPlayerSkin(playerid),
b_index = -15,
mes[128]
;
for(new x; x < sizeof(gSkins); x ++) {
if(gSkins[x][skinID] != b_skin) continue;
b_index = x;
break;
}
SetPVarInt(playerid, "clothes_select", b_index);
format(mes, sizeof(mes), "{"#cW"}Вы хотите купить эту одежду за {"#cRED"}$%i{"#cW"}?", GetSkinPrice(b_index));
ShowPlayerDialog(playerid, dBuySkin, 0, "Покупка одежды", mes, "Да", "Нет");
}
else if(clickedid == gSkinShopDraw[4] || (GetPVarInt(playerid, "clothes_td") && clickedid == Text:INVALID_TEXT_DRAW)) {
HidePlayerClothesTD(playerid);
pTemp[playerid][pJustTP] = true;
SetPlayerPos(playerid, GetPVarFloat(playerid, "posx"), GetPVarFloat(playerid, "posy"), GetPVarFloat(playerid, "posz"));
SetPlayerInterior(playerid, GetPVarInt(playerid, "interior1"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid, "vw"));
SetPlayerFacingAngle(playerid, GetPVarInt(playerid, "posa"));
TogglePlayerControllable(playerid, 1);
SetPlayerSkin(playerid, GetPVarInt(playerid, "curskin"));
SetCameraBehindPlayer(playerid);
DeletePVar(playerid, "posx");
DeletePVar(playerid, "posy");
DeletePVar(playerid, "posz");
DeletePVar(playerid, "posa");
DeletePVar(playerid, "interior1");
DeletePVar(playerid, "vw");
DeletePVar(playerid, "clothes_sel");
DeletePVar(playerid, "clothes_class");
pTemp[playerid][pChangingSkin] = false;
}
else if(clickedid == RegaSkin[0])
{
if(pData[playerid][pSex] == 1)
{
ChangeSkin[playerid]--;
if(ChangeSkin[playerid] < 0) ChangeSkin[playerid] = sizeof(MaleSkins)-1;
SetPlayerSkin(playerid, MaleSkins[ChangeSkin[playerid]]);
pData[playerid][pSkin] = MaleSkins[ChangeSkin[playerid]];
}
else if(pData[playerid][pSex] == 2)
{
ChangeSkin[playerid]--;
if(ChangeSkin[playerid] < 0) ChangeSkin[playerid] = sizeof(FemaleSkins)-1;
SetPlayerSkin(playerid, FemaleSkins[ChangeSkin[playerid]]);
pData[playerid][pSkin] = FemaleSkins[ChangeSkin[playerid]];
}
}
else if(clickedid == RegaSkin[1])
{
if(pData[playerid][pSex] == 1)
{
ChangeSkin[playerid]++;
if(ChangeSkin[playerid] >= sizeof(MaleSkins)) ChangeSkin[playerid] = 0;
SetPlayerSkin(playerid, MaleSkins[ChangeSkin[playerid]]);
pData[playerid][pSkin] = MaleSkins[ChangeSkin[playerid]];
}
else if(pData[playerid][pSex] == 2)
{
ChangeSkin[playerid]++;
if(ChangeSkin[playerid] >= sizeof(FemaleSkins)) ChangeSkin[playerid] = 0;
SetPlayerSkin(playerid, FemaleSkins[ChangeSkin[playerid]]);
pData[playerid][pSkin] = FemaleSkins[ChangeSkin[playerid]];
}
}
else if(clickedid == RegaSkin[2])
{
ChangeSkin[playerid] = 0;
pData[playerid][pSkin] = GetPlayerSkin(playerid);
pTemp[playerid][pChoosingSkin] = false;
for(new i; i < sizeof(RegaSkin); i++)
TextDrawHideForPlayer(playerid, RegaSkin[i]);
CancelSelectTextDraw(playerid);
TogglePlayerControllable(playerid, 1);
UpdatePlayerData(playerid, "skin", pData[playerid][pSkin]);
SpawnPlayer(playerid);
}
else if(clickedid == RegaSkin[3])
{
SendClientMessage(playerid, CWHITE, "Для выхода из игры используйте команду /quit");
CancelSelectTextDraw(playerid);
for(new i; i < sizeof(RegaSkin); i++) TextDrawHideForPlayer(playerid, RegaSkin[i]);
KickEx(playerid);
return true;
}
return false;
}


- - - Добавлено - - -

Можно закрыть. Был подключен фильтрскрипт, я его отключил и все заработало!