Help with admin commands ? - 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: Help with admin commands ? (
/showthread.php?tid=244310)
Help with admin commands ? -
Alex.Cone - 26.03.2011
Hy there ! How can I make commands that just admins can use it ?
Re: Help with admin commands ? -
Davz*|*Criss - 26.03.2011
https://sampwiki.blast.hk/wiki/IsPlayerAdmin
Thanks.
Re: Help with admin commands ? -
-Rebel Son- - 26.03.2011
yay a nice person!, Well bud, You need a admn system, or a Account system. If you have a account system ad a variable called level or adminlevel or whatever, and Do somthing like thsis.
heres a admin command of mine you can kinda get an idea from
PHP код:
CMD:unmute(playerid, params[])
{
new id;
new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
if(GetPVarInt(playerid, "Level") >= 1)
{
if (sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, SERVER_BOT "USAGE: /unmute [id]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, SERVER_BOT "This player is not connected");
if(GetPVarInt(playerid, "Level") >= 2) return SendClientMessage(playerid, COLOR_RED, SERVER_BOT "Cannot unmute this person!");
IsMuted[id] = 0;
new stri[128];
GetPlayerName(id, victimname, sizeof(victimname));
GetPlayerName(playerid, adminname, sizeof(adminname));
format(stri,128,SERVER_BOT "%s(%d) has unmuted %s(%d)",adminname, playerid, victimname, id);
SendClientMessageToAll(COLOR_GREEN,stri);
return 1;
}else return SendClientMessage(playerid,COLOR_RED,SERVER_BOT "You arent Authorised!");}
Re: Help with admin commands ? -
Davz*|*Criss - 26.03.2011
Quote:
Originally Posted by -Rebel Son-
yay a nice person!, Well bud, You need a admn system, or a Account system. If you have a account system ad a variable called level or adminlevel or whatever, and Do somthing like thsis.
heres a admin command of mine you can kinda get an idea from
PHP код:
CMD:unmute(playerid, params[])
{
new id;
new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
if(GetPVarInt(playerid, "Level") >= 1)
{
if (sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, SERVER_BOT "USAGE: /unmute [id]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, SERVER_BOT "This player is not connected");
if(GetPVarInt(playerid, "Level") >= 2) return SendClientMessage(playerid, COLOR_RED, SERVER_BOT "Cannot unmute this person!");
IsMuted[id] = 0;
new stri[128];
GetPlayerName(id, victimname, sizeof(victimname));
GetPlayerName(playerid, adminname, sizeof(adminname));
format(stri,128,SERVER_BOT "%s(%d) has unmuted %s(%d)",adminname, playerid, victimname, id);
SendClientMessageToAll(COLOR_GREEN,stri);
return 1;
}else return SendClientMessage(playerid,COLOR_RED,SERVER_BOT "You arent Authorised!");}
|
No. that's hard for him to understand cuz he is newbie scripter and first of all he need to learn from
https://sampwiki.blast.hk/wiki/IsPlayerAdmin
Not directly start making admin fs or gm.
Re: Help with admin commands ? -
Alex.Cone - 26.03.2011
But here is not explained how to make admin command just admin spawn . I just wanna know how to OnPlayerTextCommand make command just for admins