18.02.2012, 14:14
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;
}
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;
}