UC cmd - 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: UC cmd (
/showthread.php?tid=394722)
UC cmd -
Tamer - 23.11.2012
Alright, I am planning to make a command that will set the players admin to 4 which will turn them undercover.
I want it to work this way:
/command (password)
Код:
CMD:pppucucuc(playerid,params[])
{
SendClientMessage(id,RED,"You are undercover.");
PlayerInfo[id][pAdmin] = 4;
return 1;
}
It won't be stored at any place,simply,it will give an error when you type the command: /command default and the password is default,making your admin level 4. But if you do /command madness it will say invalid password!
So I want the password to be editable besides can be used by anyone at any situation. If you write the wrong password it will give you an error.
Thanks
Re: UC cmd -
YoYo123 - 23.11.2012
https://sampforum.blast.hk/showthread.php?tid=187229
Re: UC cmd -
Tamer - 24.11.2012
Bump
AW: UC cmd -
Skimmer - 24.11.2012
Do you want create commands with Parameters?
It's simple, if you use sscanf.
pawn Код:
CMD:akill(playerid,params[])
{
new id; // We create a variable, to save target players ID.
// Player has used the command /akill, but without params.
if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /akill (playerid)");
// We check is the target player connected or not.
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "Player is not connected.");
SetPlayerHealth(id, 0);
return 1;
}
Here's an example again, but now with string and without sscanf.
pawn Код:
CMD:announce(playerid, params[])
{
if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /announce (text)");
GameTextForAll(params, 4000, 3);
return 1;
}