05.12.2013, 04:26
Hello everyone. Help solve the problem.
The first code works, the second does not show the player's name. What's the problem?
Using GetPlayerName gave no results
The first code works, the second does not show the player's name. What's the problem?
Using GetPlayerName gave no results
PHP код:
CMD:admins(playerid, params[]){
if(PlayerLogged[playerid] == 0) return true;
if(PlayerInfo[playerid][pAdmin] > 0 || PlayerInfo[playerid][pVIP] == true)
{
new str[256],full = 0;
SendClientMessage(playerid, COLOR_BLUE, "Àäìèíèñòðàöèÿ â ñåòè:");
foreach(new i:Player)
{
if(!IsPlayerConnected(i) || PlayerLogged[i] == 0) continue;
if(PlayerInfo[i][pAdmin] > 0)
{
new admrank[70];
if(PlayerInfo[i][pAdmin] == 1){format(admrank,70,"{FF0000}» {0000ff}Ìë.Àäìèíèñòðàòîð");}
else if(PlayerInfo[i][pAdmin] == 2){format(admrank,70,"{FF0000}» {735184}Àäìèíèñòðàòîð");}
else if(PlayerInfo[i][pAdmin] == 3){format(admrank,70,"{FF0000}» {660099}Ñò.Àäìèíèñòðàòîð");}
else if(PlayerInfo[i][pAdmin] == 4){format(admrank,70,"{FF0000}» {997a8d}Çàì.Ãë.Àäìèíèñòðàòîðà");}
else if(PlayerInfo[i][pAdmin] == 5){format(admrank,70,"{FF0000}» {d53e07}Ãë.Àäìèíèñòðàòîð");}
else if(PlayerInfo[i][pAdmin] == 6){format(admrank,70,"{FF0000}» {FF0000}Ðóêîâîäèòåëü Ïðîåêòà");}
else if(PlayerInfo[i][pAdmin] == 7){format(admrank,70,"{FF0000}» {000000}Developer");}
full++;
format(str,sizeof(str),"%s [ID: %d] - %s\n",PlayerInfo[i][pSendername],i,admrank);
SendClientMessage(playerid, COLOR_WHITE, str);
}
}
if(full == 0) SendClientMessage(playerid, COLOR_WHITE, "Àäìèíèñòðàòîðîâ íåò â ñåòè!");
}
else SendClientMessage(playerid, COLOR_GREY, YouCanNot);
return true;}
PHP код:
CMD:members(playerid, params[]){
if(PlayerLogged[playerid] == 0) return 1;
if(PlayerInfo[playerid][pMember] == 0) return SendClientMessage(playerid, COLOR_GREY, YouCanNot);
SendClientMessage(playerid, 0x33AAFFFF, "×ëåíû îðãàíèçàöèè â ñåòè:");
foreach(new i:Player)
{
if(!IsPlayerConnected(i) || PlayerLogged[i] == 0) continue;
if(PlayerInfo[i][pMember] == PlayerInfo[playerid][pMember]) SendMes(playerid, COLOR_WHITE, "%s » {66ff00}%s",PlayerInfo[i][pSendername], FracRank[PlayerInfo[i][pMember]][PlayerInfo[i][pRank]]);
}
return 1;}