Alguem poderia me ajudar a criar comando de /daradmin
#1

Gente estou criando um servidor de RPG do 0 mais sу estou com dъvida de como poderia criar um comando para dar admin no meu servidor, vocкs podem criar? pode ser de 1 level sу. Exemplo:/DarLider [id] [level].
Reply
#2

This is completely different to your gamemode.
And btw, this is ENGLISH only as far as i know.
but you can do it like this.

PHP код:
new AdminLevel[MAX_PLAYERS];
//==============================================================================
CMD:makemeadmin(playeridparams[])
{
if(!
IsAdmin(playerid1)) return SendClientMessage(playeridCOLOR_RED"You are not admin!"); // must be loggedin on rcon.
AdminLevel[playerid] = 6;
return 
1;
}
CMD:adminexamplecommand(playerid,params[])
{
if(
AdminLevel[playerid] >=1//Now to add a restriction in commands you can do this
{
        
// do something
}else return SendClientMessage(playerid,GREY,"You are not an admin");
return 
1;

You can also add some sort of /setlevel ID LEVEL

PHP код:
CMD:setlevel(playerid,params[])
{
    new 
levels,str[128],ID,mode[128];
    if(
AdminLevel[playerid] >=|| IsPlayerAdmin(playerid)) // = level 6 or higher / or logged into rcon
    
{
        if(
sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid,GREY,"USAGE: /setlevel [playerid] [Level 1-6]");
        if(
levels 6) return SendClientMessage(playerid,GREY,"LEVELS AVAILABLE 1-4");
        if(!
IsPlayerConnectedEx(ID))return SendClientMessage(playerid,GREY,"Invalid player ID");
        if(
AdminLevel[ID]==levels) return SendClientMessage(playerid,GREY,"That player is already this Administrator level");
        if(
levels==0)
        {
mode="{FFFFFF}Regular Player";}
        if(
levels==1)
        {
mode="{00CC00}Helper";}
        if(
levels==2)
        {
mode="{FF0000}Moderator";}
        if(
levels==3)
        {
mode="{FF0000}Administrator";}
        if(
levels==4)
        {
mode="{FF0000}Senior Administrator";}
        if(
levels==5)
        {
mode="{FF0000}Manager Administrator";}
        if(
levels==6)
        {
mode="{FF0000}Leader Administrator";}
        
format(str,sizeof(str),"An Administrator has set your level to %s",mode);
        
SendClientMessage(ID,YELLOW,str);
        
format(str,sizeof(str),"You have set %s's level to %s",PlayerName(ID),mode);
        
SendClientMessage(playerid,YELLOW,str);
        
AdminLevel[ID]=levels;
     }else return 
0;
      return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)