If name is ### player get's acces to a command.
#4

pawn Код:
//Use this stock, paste it at the bottom of your script outside other callbacks.
stock IsPlayerName(playerid, const name[], bool:ignore_case=false)
{
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof playername);
    if(!strcmp(playername, name, ignore_case)) return true;
    return false;
}
Example usage:
pawn Код:
CMD:guy(playerid, params[])
{
    if(IsPlayerName(playerid, "Some_Guy"))
    {
   
        SendClientMessage(playerid, -1, "Hello some guy!");
   
    } else SendClientMessage(playerid, -1, "You're not some guy!");
   
    return true;
}
Reply


Messages In This Thread
If name is ### player get's acces to a command. - by davelord - 18.02.2012, 13:45
Re: If name is ### player get's acces to a command. - by John Rockie - 18.02.2012, 13:54
Re: If name is ### player get's acces to a command. - by Twisted_Insane - 18.02.2012, 14:11
Re: If name is ### player get's acces to a command. - by iPLEOMAX - 18.02.2012, 14:14

Forum Jump:


Users browsing this thread: 1 Guest(s)