Pq essas tentativas n vгo /limparlider -
maikons - 21.05.2014
Estou com um problema no meu /limparlider, tentei solucionar de 3 formas, mas nenhuma funcionou...
Problema: Eu admin dou /limparlider [iddaorg], blz, limpa lб nas informaзхes da ORG, mas a variavel do player (lider), continua com o valor da org em vez de ser setada para 0
Soluзгo 1: Quando o player spawnar checar se lб no INFOORG (onde salva as informaзхes da ORG) o lнder salvo lб й == ao player que logou na hora
Exemplo lб o Lider 0 й Pedro_Junior eu Maikon_Santos entrei entгo meu lider й setado pra 0, else nada acontece sу logo normal
pawn Код:
new idorg = GetPlayerOrg(playerid);
if(PlayerInfo[playerid][pLider] > 0) {
if(PlayerInfo[playerid][idorg]) {
if(InfoOrg[idorg][Lider] != PlayerName(playerid) ) {
SendClientMessage(playerid, COLOR_LIGHTRED, "Seu lнder foi retirado por um administrador!");
PlayerInfo[playerid][pLider] = 0;
SetPlayerSkin(playerid,7);
}
}
return 1;
}
if(InfoOrg[idorg][Lider] != PlayerName(playerid) ) {
erro previsivel jб que nгo sabia como comparar isso /\
Soluзгo 2
Tentei entгo lб no /limparlider pegar o Player atual lнder e por lб mesmo setar a variavel lнder dele pra 0, mas tambйm nгo funcionou...
pawn Код:
if (strcmp("/limparlider", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 7)
{
SendClientMessage(playerid, COLOR_GRAD2, "Somente admins 4+ podem usar este comando!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /limparlider [organizaзгo]");
SendClientMessage(playerid, COLOR_RED, "Recomendavel usar sу com lнder online!");
return 1;
}
new Vaga2 = strval(tmp);
if(Vaga2 < 1 || Vaga2 > 29) { SendClientMessage(playerid, COLOR_GREY, "Vaga mнnima 1 mбximo 29!"); return 1; }
new id=GetPlayerID(InfoOrg[Vaga2][Lider]);
format(string, sizeof(string), "ADMIN: %s limpou a vaga %d do lнder %s",PlayerName(playerid), Vaga2, InfoOrg[Vaga2][Lider]);
LideresLog(string);
if(IsPlayerOnline(InfoOrg[Vaga2][Lider])) DemitirLider(id);
strmid(InfoOrg[Vaga2][Lider], "Ninguem", 0, strlen("Ninguem"), 255);
format(gstring, 128, "ORG Arquivos/Org%d.cfg", Vaga2);
dini_Set(gstring,"Lider","Ninguem");
format(string, sizeof(string), "Vocк limpou o lнder da organizaзгo Nє %d",Vaga2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(gstring, 128, "Players/%s.ini", InfoOrg[Vaga2][Lider]);
dini_Set(gstring,"Lider","0");
return 1;
}
as duas fails 
Compilaзгo sem erros, porem aqui nada acontece:
format(gstring, 128, "Players/%s.ini", InfoOrg[Vaga2][Lider]);
dini_Set(gstring,"Lider","0");
O que eu to fazendo de errado?
Alguem pode me ajudar namoral , unica coisa q n to conseguidno resolver!
Outro topico ninguem tava entendo nada fiz esse organizado tintin por titin deleta ele lб
Re: Pq essas tentativas n vгo /limparlider -
maikons - 21.05.2014
Comandos que ficam algumas das variбveis acima
pawn Код:
if (strcmp("/orgs", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
new DialogNGL[1500];
format(string,sizeof(string), "{FFFFFF} 1 - {0080C0}Policia Militar:{FF9000} %s\n", InfoOrg[1][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 2 - {004080}Marinha:{FF9000} %s\n", InfoOrg[2][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 3 - {008000}Exercito:{FF9000} %s\n", InfoOrg[3][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 4 - {FF8080}Mйdicos:{FF9000} %s\n", InfoOrg[4][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 5 - {0000FF}Aztecas:{FF9000} %s\n", InfoOrg[5][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 6 - {2E2E2E}Al-Qaeda:{FF9000} %s\n", InfoOrg[6][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 7 - {0080FF}Presidente: {FF9000}%s\n", InfoOrg[7][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 8 - {808080}Hitmans:{FF9000} %s\n", InfoOrg[8][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 9 - {FF8000}Reporteres:{FF9000} %s\n", InfoOrg[9][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 10 - {00FFFF}Taxistas:{FF9000} %s\n", InfoOrg[10][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 11 - {804000}Policia Federal:{FF9000} %s\n", InfoOrg[11][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 12 - {B70004}Cosa Nostra:{FF9000} %s\n", InfoOrg[12][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 13 - {2C2691}Yakuza:{FF9000} %s\n", InfoOrg[13][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 14 - {00FF00}Groove:{FF9000} %s\n", InfoOrg[14][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 15 - {80FFFF}Guerrilheiros Israelita:{FF9000} %s\n", InfoOrg[15][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 16 - {9D5009}Polнcia Civil: {FF9000}%s\n", InfoOrg[16][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 17 - {800080}Ballas: {FF9000}%s\n", InfoOrg[17][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 18 - {FFFF00}Vagos:{FF9000} %s\n", InfoOrg[18][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 19 - {FF0000}Comando Vermelho:{FF9000} %s\n", InfoOrg[19][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 20 - {7CB900}PCC: {FF9000}%s\n", InfoOrg[20][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 21 - {0BA6AE}Mayans:{FF9000} %s\n", InfoOrg[21][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 22 - {CD1010}Sons Of Anarchy:{FF9000} %s\n", InfoOrg[22][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 23 - {B900B9}Drifters:{FF9000} %s\n", InfoOrg[23][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 24 - {17A252}Terceiro Comando Puro:{FF9000} %s\n", InfoOrg[24][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 25 - {00FFFF}Amigos dos Amigos:{FF9000} %s\n", InfoOrg[25][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 26 - {FF8000}D.E.T.R.A.N:{FF9000} %s\n", InfoOrg[26][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 27 - {A7A5C7}Triads:{FF9000} %s\n", InfoOrg[27][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 28 - {FF8040}Hamas:{FF9000} %s\n", InfoOrg[28][Lider]);
strcat(DialogNGL,string);
format(string,sizeof(string), "{FFFFFF} 29 - {008040}P.Rodoviaria Federal:{FF9000} %s\n\n", InfoOrg[29][Lider]);
strcat(DialogNGL,string);
ShowPlayerDialog(playerid, 8723, DIALOG_STYLE_MSGBOX, "{00ECEC}Lнderes das Organizaзхes", DialogNGL, "Fechar", "");
}
return true;
}
Re: Pq essas tentativas n vгo /limparlider -
SpeakDS - 21.05.2014
PHP код:
if (strcmp(cmd, "/limparlider", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < MASTER)
{
SendClientMessage(playerid, COLOR_GRAD2, "Somente admins master ou dono podem usar este comando!");
return true;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /limparlider [organizaзгo]");
return true;
}
new Vaga2 = strval(tmp);
if(Vaga2 < 1 || Vaga2 > 29) { SendClientMessage(playerid, COLOR_GREY, "Vaga mнnima 1, mбximo 29 !"); return true; }
new id=GetPlayerID(InfoOrg[Vaga2][Lider]);
format(string, sizeof(string), "ADMIN: %s limpou a vaga %d do lнder %s",PlayerName(playerid), Vaga2, InfoOrg[Vaga2][Lider]);
LideresLog(string);
if(IsPlayerOnline(InfoOrg[Vaga2][Lider])) DemitirLider(id);
strmid(InfoOrg[Vaga2][Lider], "Ninguem", 0, strlen("Ninguem"), 255);
format(gstring, 128, "ORG Arquivos/Org%d.cfg", Vaga2);
dini_Set(gstring,"Lider","Ninguem");
format(string, sizeof(string), "Vocк limpou o lнder da organizaзгo Nє %d",Vaga2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return true;
}