SA-MP Forums Archive
playeid problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: playeid problem (/showthread.php?tid=487819)



playeid problem - ScRipTeRi - 15.01.2014

hello i have one command for see player info but here is one bug when i do up id 5 it show info only for id 0 then i try down id 5 it work perfect
pawn Код:
dcmd_track(playerid, params[])
    {
    #pragma unused params
    new iPlayer;
    new current_zone = player_zone[iPlayer];
    new string[124];

    if (!sscanf(params, "u", iPlayer))
    if (!IsPlayerConnected(iPlayer)) return SendClientMessage(playerid, 0xE40C0CAA, "Player not found.");
    if (IsPlayerSpawn[iPlayer]==1) return SendClientMessage(playerid, 0xE40C0CAA, "Player has not spawned yet.");
    format(string,sizeof string,"Player: %s (ID:%d)",PlayerName(iPlayer), iPlayer);
    SendClientMessage(playerid,0xE89B5BBB ,string);
    format(string,sizeof string,"> FPS: %d",FPS2[iPlayer]);
    SendClientMessage(playerid,-1 ,string);
    format(string,sizeof string,"> Ping: %d",GetPlayerPing(iPlayer));
    return 1;
}



Re: playeid problem - PinkFloydLover - 15.01.2014

pawn Код:
new current_zone = player_zone[iPlayer];
make sure you put that line below the sscanf line, you haven't defined what iPlayer is, so it defaults to 0, that's why it only works for playerid 0


Re: playeid problem - ScRipTeRi - 19.01.2014

i didn't understand anythink :/ i am no so good in english sorry