17.02.2018, 14:55
When i use /pl i could see the stats of myself but i cant see it... and when i use /pl [id] i can see others but still cant see mine..
Plz check the code and plz help to rewrite it ? plz
Plz check the code and plz help to rewrite it ? plz
PHP код:
CMD:pl(playerid, params[])
{
new ofplayerid;
if(IsNumeric1(params))
{
ofplayerid = strval(params);
if(!IsPlayerConnected(ofplayerid)) return SendClientMessage(playerid,COLOR_RED,"[Error] Player Not Connected");
}
else
{
ofplayerid = INVALID_PLAYER_ID;
SendClientMessage(playerid,COLOR_RED,"[Error] Not an valid player");
}
if( IsPlayerConnected(ofplayerid) && ofplayerid != playerid)
{
//destroy all labels first
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
DestroyPlayerLabel(playerid, i);
}
CreatePlayerLabel(playerid, ofplayerid);
g_LABEL_MODE[playerid] = MODE_SINGLE_PLAYER;//enable labels
}
else
{
if(g_LABEL_MODE[playerid] == MODE_DISABLED)//enable labels
{
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(IsPlayerConnected(i))
{
if(i != ofplayerid)
{
CreatePlayerLabel(playerid, i);
}
}
}
g_LABEL_MODE[playerid] = MODE_ENABLED;
}
else//disable labels
{
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
DestroyPlayerLabel(playerid, i);
}
g_LABEL_MODE[playerid] = MODE_DISABLED;
}
}
return 1;
}