SA-MP Forums Archive
FINDID command refusing to work - 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: FINDID command refusing to work (/showthread.php?tid=419393)



FINDID command refusing to work - UnknownGamer - 28.02.2013

pawn Код:
CMD:findid(playerid, params[])
{
    new giveplayerid, giveplayer[MAX_PLAYER_NAME], string[256];
    if(sscanf(params, "u", giveplayerid)) return SCM(playerid, COLOR_GREY, "USAGE: /findid [playername]");
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        format(string, sizeof(string), "Player Name: %s (Player-ID: %d).", giveplayer, i);
        SCM(playerid, COLOR_LIGHTRED, string);
    }
    return 1;
}
Can someone correct me why that displays hundreds of IDS?, and not just the player id?


Re: FINDID command refusing to work - Mance - 28.02.2013

PHP код:
CMD:findid(playeridparams[])
{
    new 
giveplayeridgiveplayer[MAX_PLAYER_NAME], string[256];
    if(
sscanf(params"u"giveplayerid)) return SCM(playeridCOLOR_GREY"USAGE: /findid [playername]");
    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
    
format(stringsizeof(string), "Player Name: %s (Player-ID: %d)."giveplayergiveplayerid);
    
SCM(playeridCOLOR_LIGHTREDstring);
    return 
1;