Command - 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: Command (
/showthread.php?tid=89351)
Command -
Agent Smith - 01.08.2009
How do you create a command so that only a certain person can use it, Like Sam_Hamilton.
Re: Command -
Mowgli - 01.08.2009
Are you using a Register System? if you are please tell us which you are using..
if not, then get one, because this would mean that name is not protected and anyone can log in with it, unless only a Certain ip can use it...
Re: Command -
Agent Smith - 01.08.2009
I am using a Register/Login system, I just wanted to know how to make commands that a certain Name can Only use.
Re: Command -
Djiango - 01.08.2009
pawn Код:
new name[24];
GetPlayerName(playerid, name, sizeof(name));
if(strcmp("YourName", name, true) == 0)
{
//do stuff
}
Mowgli means that any player can join the server, using "YourName" and gain access to this function.
So to prevent that, we need to know if you have anything that checks, if a player is logged in or not.
Like so..
pawn Код:
if(strcmp("YourName", name, true) == 0 && PlayerInfo[playerid][LoggedIn] == 1)
{
Re: Command -
Agent Smith - 01.08.2009
Thanks guys