Personal use 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)
+--- Thread: Personal use command (
/showthread.php?tid=442623)
Personal use command -
N00bKiller - 08.06.2013
Hello guys, today I wanna ask is it possible to create a command for one player use?
Example: My name is abcdef and I can use command: /adwaok but other people can't use this command...
Is it possible?
Re: Personal use command -
stundje - 08.06.2013
I don't know if this is possible, but you could try to make it admin only and create a new admin rank, or if your the only server owner for example: [pAdmin] ==
Re: Personal use command -
N00bKiller - 08.06.2013
That will cost me some times...
The command is for someone...
AW: Personal use command -
Nero_3D - 08.06.2013
You could check with strcmp if the name matches
pawn Код:
CMD:adwaok(playerid, params[]) {
new
name[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, name, sizeof name);
if(strcmp(name, "abcdef ", false) == 0) {
return true;
}
return false;
}
But this is only secure if the players need to login after connection otherwise everyone just could take his name and use the command
Re: Personal use command -
Guest123 - 08.06.2013
this is tutorial
pawn Код:
CMD:healme(playerid,params[])
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(!strcmp(playername, "Guest123", true))
#pragma unused params
{
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
SendClientMessage(playerid, -1, "you was healed !");
}
else return SendClientMessage(playerid, -1, "ERROR: You're Not Guest123!");
return 1;
}
Re: Personal use command -
N00bKiller - 08.06.2013
Thank you guest, it worked!
+REP
Can I ask 1 more? how to add 3D text label for only 1 person? just like the question Personal use command
Re: Personal use command -
bensmart469 - 08.06.2013
PHP код:
new accname[MAX_PLAYER_NAME];
GetPlayerName(playerid, accname, sizeof(accname));
if(!strcmp(accname, "THENAME", true))
{
//3d text label code here
}