getid
#6

pawn Код:
dcmd_getid(playerid,params[])
    {
        new search[24],string[35],name[24],bool:found;
        if(sscanf(params,"u",search)) return SendClientMessage(playerid,COLOR_RED,"Usage: /getid [Playername]");
        if(!(3 < strlen(search) < 24)) return SendClientMessage(playerid,COLOR_GREY,"Search length must be greater than 3.");
        SendClientMessage(playerid, COLOR_GREY, "Results:");
        for(new i,g=GetMaxPlayers(); i < g; i++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerName(i,name,24);
                if(strfind(search,name,true) != -1)
                {
                    format(string, sizeof(string), "%s (ID:%i)",name,i);
                    SendClientMessage(playerid, COLOR_GREY, string);
                    found=true;
                }
            }
        }
        if(!found) SendClientMessage(playerid,COLOR_RED,"No match found.");
        return 1;
    }
Reply


Messages In This Thread
getid - by Bessensap - 27.10.2010, 12:04
Re: getid - by dLu - 27.10.2010, 12:19
Re: getid - by BMUK - 27.10.2010, 12:28
Re: getid - by Bessensap - 27.10.2010, 12:35
Re: getid - by BMUK - 27.10.2010, 13:16
Re: getid - by Jefff - 27.10.2010, 13:22
Re: getid - by Bessensap - 27.10.2010, 13:34

Forum Jump:


Users browsing this thread: 1 Guest(s)