SA-MP Forums Archive
Command for a specified nick - 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 for a specified nick (/showthread.php?tid=543394)



Command for a specified nick - Bondage - 26.10.2014

How do i make a cmd for a specified nick, only the user with that nick can use that cmd. I forgot the functions and all, could anyone please give me an example cmd?


Re: Command for a specified nick - DavidBilla - 26.10.2014

Hmm. Try something like this

pawn Код:
CMD:special(playerid, params[])
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    if(strcmp(name,"examplename",false)==0)
    {
    //Your function
    }
    else return SendClientMessage(playerid,-1,"Unknown command");
    return 1;
}