Command help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command help (
/showthread.php?tid=444104)
Command help -
Fernado Samuel - 15.06.2013
Removed
Re: Command help -
RACGaming - 15.06.2013
You have to make a check for the player name.
Re: Command help -
RACGaming - 15.06.2013
pawn Код:
COMMAND:hello(playerid, params[])
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if(!strcmp(pname,"Fernado"))
{
//Your Code goes here, what is this doing if your name is Fernado
}
else SendClientMessage(playerid, 0xFFFFFFFF, "You are not allowed to use this command!");
return 1;
}
Re: Command help -
[HiC]TheKiller - 15.06.2013
You could always do the casual strcmp
pawn Код:
CMD:mycommand(playerid, params)
{
new pname[24];
GetPlayerName(playerid, pname, 24);
if(strcmp(pname, "Fernando", true)) return SendClientMessage(playerid, -1, "Only Fernando can use this command!");
//Command
return 1;
}
EDIT: Looks like RACGaming beat me to it.