get playerid form name dosn't work
#3

pawn Код:
dcmd_id(playerid, params[])
{
    if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /id [Part of name]");
    new players, string[128], name[MAX_PLAYER_NAME];
    format(string,sizeof(string),"Searched for: %s",params);
    SendClientMessage(playerid,0xFFFFFFFF,string);
    for(new i=0; i <= MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerName(i, name, MAX_PLAYER_NAME);
            new len = strlen(name);
            new bool:searched=false;
            for(new pos=0; pos <= len; pos++)
            {
                if(searched != true)
                {
                    if(strfind(name,params,true) == pos)
                    {
                        players++;
                        format(string,sizeof(string),"%d. %s (ID: %d)",players,name,i);
                        SendClientMessage(playerid, 0x00FF00FF ,string);
                        searched = true;
                    }
                }
            }
        }
    }
    if(players == 0)
    SendClientMessage(playerid, 0xFF0000FF, "No Players Localized!");
    return 1;
}
Reply


Messages In This Thread
get playerid form name dosn't work - by ScRipTeRi - 15.08.2013, 19:39
Re: get playerid form name dosn't work - by ScRipTeRi - 15.08.2013, 20:10
Re: get playerid form name dosn't work - by Dragonsaurus - 15.08.2013, 20:24
Re: get playerid form name dosn't work - by RedJohn - 15.08.2013, 20:34
Re: get playerid form name dosn't work - by Jefff - 15.08.2013, 21:05
Re: get playerid form name dosn't work - by ScRipTeRi - 15.08.2013, 22:26
Re: get playerid form name dosn't work - by Pottus - 15.08.2013, 22:37
Re: get playerid form name dosn't work - by ScRipTeRi - 16.08.2013, 10:10

Forum Jump:


Users browsing this thread: 1 Guest(s)