SA-MP Forums Archive
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(playeridparams[])
{
    new 
id;
    new 
victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
    if(
GetPVarInt(playerid"Level") >= 1)
    {
    if (
sscanf(params"u"id)) return SendClientMessage(playeridCOLOR_REDSERVER_BOT "USAGE: /unmute [id]");
    if (
id == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_REDSERVER_BOT "This player is not connected");
    if(
GetPVarInt(playerid"Level") >= 2) return SendClientMessage(playeridCOLOR_REDSERVER_BOT "Cannot unmute this person!");
    
IsMuted[id] = 0;
    new 
stri[128];
    
GetPlayerName(idvictimnamesizeof(victimname));
    
GetPlayerName(playeridadminnamesizeof(adminname));
    
format(stri,128,SERVER_BOT "%s(%d) has unmuted %s(%d)",adminnameplayeridvictimnameid);
    
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(playeridparams[])
{
    new 
id;
    new 
victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
    if(
GetPVarInt(playerid"Level") >= 1)
    {
    if (
sscanf(params"u"id)) return SendClientMessage(playeridCOLOR_REDSERVER_BOT "USAGE: /unmute [id]");
    if (
id == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_REDSERVER_BOT "This player is not connected");
    if(
GetPVarInt(playerid"Level") >= 2) return SendClientMessage(playeridCOLOR_REDSERVER_BOT "Cannot unmute this person!");
    
IsMuted[id] = 0;
    new 
stri[128];
    
GetPlayerName(idvictimnamesizeof(victimname));
    
GetPlayerName(playeridadminnamesizeof(adminname));
    
format(stri,128,SERVER_BOT "%s(%d) has unmuted %s(%d)",adminnameplayeridvictimnameid);
    
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