03.02.2014, 11:46
Сделал систему кпк на текстдравах и столкнулся с такой проблемой: пишешь первый раз /kpk - всё нормально, второй и последующие разы - не показывается
Видео
Видео
if(iscmd(cmd,"/kpk")){
if(!PlayerKPK[playerid])return SendClientMessage(playerid, -1, "{FF0000}[ИНФОРМАЦИЯ] {ffffff}У вас нет KPK");
{ if(PlayerKPK[playerid] == 1){
TextDrawShowForPlayer(playerid, iFhone[0]);
TextDrawShowForPlayer(playerid, iFhone[1]);//1);
TextDrawShowForPlayer(playerid, iFhone[2]);//2);
TextDrawShowForPlayer(playerid, iFhone[3]);//5);
TextDrawShowForPlayer(playerid, iFhone[4]);//8);
TextDrawShowForPlayer(playerid, iFhone[5]);//12);
TextDrawShowForPlayer(playerid, iFhone[6]);//14);
TextDrawShowForPlayer(playerid, iFhone[7]);//21);
TextDrawShowForPlayer(playerid, iFhone[11]);//49);
TextDrawShowForPlayer(playerid, iFhone[12]);//50);
TextDrawShowForPlayer(playerid, iFhone[13]);//51);
TextDrawShowForPlayer(playerid, iFhone[14]);//52);
TextDrawShowForPlayer(playerid, iFhone[15]);//53);
TextDrawShowForPlayer(playerid, iFhone[16]);//54);
TextDrawShowForPlayer(playerid, iFhone[17]);//55);
TextDrawShowForPlayer(playerid, iFhone[18]);//56);
TextDrawShowForPlayer(playerid, iFhone[19]);
TextDrawShowForPlayer(playerid, KPKText[0]);
TextDrawShowForPlayer(playerid, KPKText[1]);
TextDrawShowForPlayer(playerid, KPKText[2]);
TextDrawShowForPlayer(playerid, KPKText[3]);
TextDrawShowForPlayer(playerid, KPKText[4]);
TextDrawShowForPlayer(playerid, KPKText[5]);
SelectTextDraw(playerid, 0xA3B4C5FF);
SendClientMessage(playerid, -1, "{00FF00}[ПОМОЩЬ] {ffffff}Чтобы выключить KPK, введите /kpkoff");
SendClientMessage(playerid,-1,"{ff0000}[ИНФОРМАЦИЯ] {FFFFFF}KPK находится в режиме разработки");}}
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == KPKText[0]) // If the player clicked on the teleportLS textdraw, teleport him there!
{
CancelSelectTextDraw(playerid);
ShPlDi(playerid, 12, DIALOG_STYLE_LIST, "{FF9900}Справка", "{FFFFFF}[1] Команды сервера\n[2] Правила сервера\n[3] Помощь по развитию (beta)\n[4] Помощь по системам (beta)\n[5] Спросить администрацию(beta)", "Выбрать", "Отмена");
return 1;
}
if(clickedid == KPKText[1]) // Same as above, but for SF
{
CancelSelectTextDraw(playerid);
}
if(clickedid == KPKText[2]) // Same, but for LV
{
CancelSelectTextDraw(playerid);
ShowPlayerDialog(playerid, 290, DIALOG_STYLE_LIST, "{ffffff}Радио", "[1] Hot 109 (NYC) R'n'B\n[2] Radio Record (Club Music)\n[3] DFM (Club Music)\n[4] DI.FM (NYC) (Electro House)\n[5] Europa Plus (R'n'B/Club Music)","Выбрать","Отмена");
}
if(clickedid == KPKText[3])
{
ShPlDi(playerid, 70, DIALOG_STYLE_LIST, "{ffffff}Информация о персонаже.", "Статистика игрока\nСобственность\nТранспорт", "ОК", "");
}
if(clickedid == KPKText[4])
{
CancelSelectTextDraw(playerid);
ShowPlayerDialog(playerid,300,DIALOG_STYLE_LIST,"{ffffff}Услуги доната","[1] Игровая валюта (2р = $10000)\n[2] Смена ника (15р)\n[3] VIP Аккаунт(75 руб/месяц)\n[4] Покупка игрового уровня (50р)\n[5] Снять варны (25 руб)\n[6] Информация\n[7] Проверить баланс","Далее","Отмена");
}
if(clickedid == KPKText[5])
{
CancelSelectTextDraw(playerid);
ShPlDi(playerid, 7, DIALOG_STYLE_LIST, "{ffffff}Global Psition System:", "Места поиска часть №1\nМеста поиска часть № 2\nМеста поиска часть № 3\nМеста поиска часть № 4", "Выбрать", "Отмена");}
// Hide the textdraws after the player has teleport himself.
TextDrawHideForPlayer(playerid,KPKText[0]);
TextDrawHideForPlayer(playerid,KPKText[1]);
TextDrawHideForPlayer(playerid,KPKText[2]);
TextDrawHideForPlayer(playerid,KPKText[3]);
TextDrawHideForPlayer(playerid,KPKText[4]);
TextDrawHideForPlayer(playerid,KPKText[5]);
TextDrawHideForPlayer(playerid,iFhone[0]);
TextDrawHideForPlayer(playerid,iFhone[1]);//1);
TextDrawHideForPlayer(playerid,iFhone[2]);//2);
TextDrawHideForPlayer(playerid,iFhone[3]);//5);
TextDrawHideForPlayer(playerid,iFhone[4]);//8);
TextDrawHideForPlayer(playerid,iFhone[5]);//12);
TextDrawHideForPlayer(playerid,iFhone[6]);//14);
TextDrawHideForPlayer(playerid,iFhone[7]);//21);
TextDrawHideForPlayer(playerid,iFhone[11]);//49);
TextDrawHideForPlayer(playerid,iFhone[12]);//50);
TextDrawHideForPlayer(playerid,iFhone[13]);//51);
TextDrawHideForPlayer(playerid,iFhone[14]);//52);
TextDrawHideForPlayer(playerid,iFhone[15]);//53);
TextDrawHideForPlayer(playerid,iFhone[16]);//54);
TextDrawHideForPlayer(playerid,iFhone[17]);//55);
TextDrawHideForPlayer(playerid,iFhone[18]);//56);
TextDrawHideForPlayer(playerid,iFhone[19]);
CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
return 1;
}
Creates a textdraw for a single player. This can be used as a way around the global text-draw limit. |
Создаёт Текстдрав для одного игрока. Может быть использовано как путь обхода предела глобальных текстдравов. |
if(!PlayerKPK[playerid])return SendClientMessage(playerid, -1, "{FF0000}[ИНФОРМАЦИЯ] {ffffff}У вас нет KPK");
for(new i = 19; i != -1; i--) TextDrawShowForPlayer(playerid, iFhone[i]);
for(new i = 5; i != -1; i--) TextDrawShowForPlayer(playerid, KPKText[i]);
SelectTextDraw(playerid, 0xA3B4C5FF);
SendClientMessage(playerid, -1, "{00FF00}[ПОМОЩЬ] {ffffff}Чтобы выключить KPK, введите /kpkoff");
SendClientMessage(playerid,-1,"{ff0000}[ИНФОРМАЦИЯ] {FFFFFF}KPK находится в режиме разработки");
return 1;
if(iscmd(cmd,"/kpk")){
if(!PlayerKPK[playerid])return SendClientMessage(playerid, -1, "{FF0000}[ИНФОРМАЦИЯ] {ffffff}У вас нет KPK");
for(new i = 19; i != -1; i--) TextDrawShowForPlayer(playerid, iFhone[i]);
for(new i = 5; i != -1; i--) TextDrawShowForPlayer(playerid, KPKText[i]);
SelectTextDraw(playerid, 0xA3B4C5FF);
SendClientMessage(playerid, -1, "{00FF00}[ПОМОЩЬ] {ffffff}Чтобы выключить KPK, введите /kpkoff");
SendClientMessage(playerid,-1,"{ff0000}[ИНФОРМАЦИЯ] {FFFFFF}KPK находится в режиме разработки");
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == KPKText[0]) // If the player clicked on the teleportLS textdraw, teleport him there!
{
ShPlDi(playerid, 12, DIALOG_STYLE_LIST, "{FF9900}Справка", "{FFFFFF}[1] Команды сервера\n[2] Правила сервера\n[3] Помощь по развитию (beta)\n[4] Помощь по системам (beta)\n[5] Спросить администрацию(beta)", "Выбрать", "Отмена");
return 1;
}
if(clickedid == KPKText[1]) // Same as above, but for SF
{
CancelSelectTextDraw(playerid);
}
if(clickedid == KPKText[2]) // Same, but for LV
{
ShPlDi(playerid, 290, DIALOG_STYLE_LIST, "{ffffff}Радио", "[1] Hot 109 (NYC) R'n'B\n[2] Radio Record (Club Music)\n[3] DFM (Club Music)\n[4] DI.FM (NYC) (Electro House)\n[5] Europa Plus (R'n'B/Club Music)","Выбрать","Отмена");
}
if(clickedid == KPKText[3])
{
ShPlDi(playerid, 70, DIALOG_STYLE_LIST, "{ffffff}Информация о персонаже.", "Статистика игрока\nСобственность\nТранспорт", "ОК", "");
}
if(clickedid == KPKText[4])
{
ShPlDi(playerid,300,DIALOG_STYLE_LIST,"{ffffff}Услуги доната","[1] Игровая валюта (2р = $10000)\n[2] Смена ника (15р)\n[3] VIP Аккаунт(75 руб/месяц)\n[4] Покупка игрового уровня (50р)\n[5] Снять варны (25 руб)\n[6] Информация\n[7] Проверить баланс","Далее","Отмена");
}
if(clickedid == KPKText[5])
{
ShPlDi(playerid, 7, DIALOG_STYLE_LIST, "{ffffff}Global Psition System:", "Места поиска часть №1\nМеста поиска часть № 2\nМеста поиска часть № 3\nМеста поиска часть № 4", "Выбрать", "Отмена");}
// Hide the textdraws after the player has teleport himself.
for(new i = 19; i != -1; i--) TextDrawHideForPlayer(playerid, iFhone[i]);
for(new i = 5; i != -1; i--) TextDrawHideForPlayer(playerid, KPKText[i]);
CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == KPKText[0]) // If the player clicked on the teleportLS textdraw, teleport him there!
{
for(new i = 19; i != -1; i--) TextDrawHideForPlayer(playerid, iFhone[i]);
for(new i = 5; i != -1; i--) TextDrawHideForPlayer(playerid, KPKText[i]);
CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
ShPlDi(playerid, 12, DIALOG_STYLE_LIST, "{FF9900}Справка", "{FFFFFF}[1] Команды сервера\n[2] Правила сервера\n[3] Помощь по развитию (beta)\n[4] Помощь по системам (beta)\n[5] Спросить администрацию(beta)", "Выбрать", "Отмена");
return 1;
}
if(clickedid == KPKText[1]) // Same as above, but for SF
{
for(new i = 19; i != -1; i--) TextDrawHideForPlayer(playerid, iFhone[i]);
for(new i = 5; i != -1; i--) TextDrawHideForPlayer(playerid, KPKText[i]);
CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
return 1;
}
if(clickedid == KPKText[2]) // Same, but for LV
{
for(new i = 19; i != -1; i--) TextDrawHideForPlayer(playerid, iFhone[i]);
for(new i = 5; i != -1; i--) TextDrawHideForPlayer(playerid, KPKText[i]);
CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
ShPlDi(playerid, 290, DIALOG_STYLE_LIST, "{ffffff}Радио", "[1] Hot 109 (NYC) R'n'B\n[2] Radio Record (Club Music)\n[3] DFM (Club Music)\n[4] DI.FM (NYC) (Electro House)\n[5] Europa Plus (R'n'B/Club Music)","Выбрать","Отмена");
return 1;
}
if(clickedid == KPKText[3])
{
for(new i = 19; i != -1; i--) TextDrawHideForPlayer(playerid, iFhone[i]);
for(new i = 5; i != -1; i--) TextDrawHideForPlayer(playerid, KPKText[i]);
CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
ShPlDi(playerid, 70, DIALOG_STYLE_LIST, "{ffffff}Информация о персонаже.", "Статистика игрока\nСобственность\nТранспорт", "ОК", "");
return 1;
}
if(clickedid == KPKText[4])
{
for(new i = 19; i != -1; i--) TextDrawHideForPlayer(playerid, iFhone[i]);
for(new i = 5; i != -1; i--) TextDrawHideForPlayer(playerid, KPKText[i]);
CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
ShPlDi(playerid,300,DIALOG_STYLE_LIST,"{ffffff}Услуги доната","[1] Игровая валюта (2р = $10000)\n[2] Смена ника (15р)\n[3] VIP Аккаунт(75 руб/месяц)\n[4] Покупка игрового уровня (50р)\n[5] Снять варны (25 руб)\n[6] Информация\n[7] Проверить баланс","Далее","Отмена");
return 1;
}
if(clickedid == KPKText[5])
{
for(new i = 19; i != -1; i--) TextDrawHideForPlayer(playerid, iFhone[i]);
for(new i = 5; i != -1; i--) TextDrawHideForPlayer(playerid, KPKText[i]);
CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
ShPlDi(playerid, 7, DIALOG_STYLE_LIST, "{ffffff}Global Psition System:", "Места поиска часть №1\nМеста поиска часть № 2\nМеста поиска часть № 3\nМеста поиска часть № 4", "Выбрать", "Отмена");
return 1;
}