id part of name
#1

Hello i have create this for find player ID but all work good but have one problem on player id dont find it good so here is script
pawn Код:
dcmd_id(playerid, params[])
{
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /id <part of name>");
    new players, Names[MAX_PLAYER_NAME];
    for(new i=0; i <= MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerName(i, Names, MAX_PLAYER_NAME);
            new len = strlen(Names);
            new bool:searched=false;
            for(new pos=0; pos <= len; pos++)
            {
                if(searched != true)
                {
                    if(strfind(Names,params,true) == pos)
                    {
                        players++;
                        SendClientMessage(playerid, 0xE89B5BBB, "Players found:");
                        format(string,sizeof(string),"> %s (ID:%d)",Names,playerid);
                        SendClientMessage(playerid, COLOR_WHITE ,string);
                        searched = true;
                    }
                }
            }
        }
    }
    if(players == 0)
    SendClientMessage(playerid, 0xFF0000FF, "Player not found.");
    return 1;
}
Thank you
Reply


Messages In This Thread
id part of name - by ScRipTeRi - 20.12.2013, 14:16
Re: id part of name - by HyperZ - 20.12.2013, 14:21
Re: id part of name - by ikey07 - 20.12.2013, 15:35

Forum Jump:


Users browsing this thread: 1 Guest(s)