[HELP] Makeadmin command doesn't work
#1

Hello... Im making a new GM, and I added "AdminLvl" to my Enum Pinfo... I also coppied a makeadmin command from wiki... But... My command does not work When I compile it, it's perfect, but when I go in game and type /makeadmin, nothing happends....

Here's the command I used :


Код:
COMMAND:makeadmin(playerid,cmdtext[])
{
        new cmd[256], idx;
		cmd = strtok(cmdtext, idx);
       new string[128];
       new tmp[256];
       new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
       new giveplayerid;
       if (IsPlayerAdmin(playerid))
       {
               tmp = strtok(cmdtext, idx);
               if(!strlen(tmp))
               {
                       SendClientMessage(playerid, Crvena, "USAGE: /makeadmin [playerid] [level]");
                       SendClientMessage(playerid, Crvena, "FUNCTION: Player will be an admin.");
                       return 1;
               }
               giveplayerid = ReturnUser(tmp);
               tmp = strtok(cmdtext, idx);
               new level = strval(tmp);
               if(giveplayerid != INVALID_PLAYER_ID)
               {
                       GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                       GetPlayerName(playerid, player, sizeof(player));
                       PlayerInfo[giveplayerid][AdminLvl] = level;
                       printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
                       format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level,  player);
                       SendClientMessage(giveplayerid, 0x00C2ECFF, string);
                       format(string, sizeof(string), "You have given %s level %d admin.",  giveplayer,PlayerInfo[giveplayerid][AdminLvl]);
                               SendClientMessage(playerid, 0x00C2ECFF, string);
               }
               else if(giveplayerid == INVALID_PLAYER_ID)
               {
                       format(string, sizeof(string), "%i is not an active player.", giveplayerid);
                       SendClientMessage(playerid, 0xE60000FF, string);
               }
       }
       else
       {
           SendClientMessage(playerid, 0xE60000FF, "You are not a lead admin!");
       }
       return 1;
}
Reply


Messages In This Thread
[HELP] Makeadmin command doesn't work - by .sparkY - 15.11.2010, 13:45
Re: [HELP] Makeadmin command doesn't work - by Jochemd - 15.11.2010, 14:30
Re: [HELP] Makeadmin command doesn't work - by .sparkY - 15.11.2010, 14:32
Re: [HELP] Makeadmin command doesn't work - by mmrk - 15.11.2010, 14:50
Re: [HELP] Makeadmin command doesn't work - by Jochemd - 15.11.2010, 14:58
Re: [HELP] Makeadmin command doesn't work - by .sparkY - 15.11.2010, 15:12
Re: [HELP] Makeadmin command doesn't work - by Kidemo - 15.11.2010, 15:14
Re: [HELP] Makeadmin command doesn't work - by Jochemd - 15.11.2010, 15:14
Re: [HELP] Makeadmin command doesn't work - by .sparkY - 15.11.2010, 15:57
Re: [HELP] Makeadmin command doesn't work - by mmrk - 15.11.2010, 16:36

Forum Jump:


Users browsing this thread: 1 Guest(s)