20.03.2012, 12:48
How i can make a command to work only on some names.For example my name is jimis and i have been added from admin to police dept and i can join.But if someone have name john then he cant join at lspd.
if (strcmp("/mycmd", cmdtext, true, 5) == 0)
{
new pname[20];
GetPlayerName(playerid,pname,sizeof(pname));
if(strcmp(pname,"jimis",true) == 0)//so jimis is name comparing with pname , that is player name using the command
{
//All other command codes goes here like:
SendClientMessage(playerid,-1,"Hi jimis, command is only for you :).");
}
else
{
SendClientMessage(playerid,-1,"Command is only for jimis.");
}
return 1;
}
if(strcmp(pname,"jimis",true) == 0) && if(strcmp(pname,"name2",true) == 0) && if(strcmp(pname,"name3",true) == 0 )