Making a cmd that only a X name can use. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Making a cmd that only a X name can use. (
/showthread.php?tid=275683)
Making a cmd that only a X name can use. -
ricardo178 - 10.08.2011
Hello. I am trying to make a cmd, that only me and my friend can open, so only our names can.
If someone can help me... I am using ZCMD as cmd processor.
THANK YOU.
Re: Making a cmd that only a X name can use. -
linuxthefish - 10.08.2011
Get the player name, compare it with
Strcmp, then process the command. then return 0 for all other names.
AW: Making a cmd that only a X name can use. -
Nero_3D - 10.08.2011
/\ in words
pawn Код:
CMD:command(playerid, params[]) {
new
name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
if(!strcmp(name, "recardo178", false) || !strcmp(name, "yourfriend", false)) {
return true;
}
return false;
}
Re: Making a cmd that only a X name can use. -
ricardo178 - 10.08.2011
It works. Thank you very much.