Make admin command help. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Make admin command help. (
/showthread.php?tid=485614)
Make admin command help. -
MaDsON - 05.01.2014
I'm trying to make a really simple command, however, it's not working for me. I might be doing something wrong.
What I need in this function, is /makeja - so that if you use the command, it will set [pAdmin] to 2. It will not let you use the command if you have the [pHelper] status of 1 and above.
I need it to logs/makeadmin - send a COLOR_LIGHTBLUE message to the player (SendPlayerMessageEx) saying 'You have been made a Junior Administrator by 'playername that used the command.'
Then it will send a message to the person that used the command. "You have made 'player name that you made a ja' a Junior Administrator.
Then it will ABroadCast a message in COLOR_LIGHTRED "AdmCmd: 'Playername' has made 'New Admin Name' a Junior Administrator.'
Thank you if you take time in doing this for me, it will be greatly appreciated.
Re: Make admin command help. -
Ryan_Bowe - 05.01.2014
....
Re: Make admin command help. -
SyntaxQ - 05.01.2014
Quote:
Originally Posted by Ryan_Bowe
pawn Код:
CMD:makeja(playerid, params[]) { if(PlayerInfo[playerid][pHelper] >= 1) return SendClientMessage(playerid, COLOR_WHITE, "You do not have permission to use this command."); new playerb, string[128]; if(sscanf(params, "i", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeja [playerid]"); if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_WHITE, "The player that you have specefied is not connected."); format(string, sizeof(string), "You have been made a Junior Administrator by %s.", GetPlayerNameEx(playerid)); SendClientMessage(playerb, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "You have made %s a Junior Administrator.", GetPlayerNameEx(playerb)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "AdmCmd: %s has made %s a Junior Administrator.", GetPlayerNameEx(playerid), GetPlayerNameEx(playerb)); ABroadCast(COLOR_LIGHTRED, string, 2); PlayerInfo[playerb][pAdmin] = 2; Log("logs/makeadmin.log", string); return 1; }
Needs to be tested, I do not have my gamemode setup like this to test it, so yeah...
|
It should be:
pawn Код:
if ( sscanf( params, "u", playerb )) return SendClientMessage( playerid, COLOR_WHITE, "USAGE: /makeja [playerid]" );
You have used the wrong format code. (If I'm not wrong)
'i' is for integers..
'u' is for playerid/part of name.
Re: Make admin command help. -
Ryan_Bowe - 05.01.2014
....