admin help
#9

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(makeadmin, 9, cmdtext);
  return 0;
}

dcmd_makeadmin(playerid, params[])
{
  if(PlayerInfo[playerid][pAdmin] != 5) return SendClientMessage(playerid, color, "Sorry, You need to be a level 5 admin to use this command");

  new id, level;
  if(sscanf(params, "ui", id, level)) return SendClientMessage(playerid, color, "USAGE: /makeadmin [playerid] [level]");
  else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, color, "Player not found");
  else if ((level < 1) || (level > 5)) return SendClientMessage(playerid, color, "The admin level can't be bigger then 5 and smaller then 1");
  else
  {  
    PlayerInfo[id][pAdmin] = level;
    SendClientMessage(playerid, color, "Player became admin");
  }
  return 1;
}
btw, this is why your code doesn't work
pawn Код:
PlayerInfo[playerid][pAdmin] = level;
should be
pawn Код:
PlayerInfo[giveplayerid][pAdmin] = level;
Reply


Messages In This Thread
admin help - by sggassasin - 31.08.2009, 07:30
Re: admin help - by Nakash - 31.08.2009, 07:41
Re: admin help - by MenaceX^ - 31.08.2009, 08:07
Re: admin help - by sggassasin - 31.08.2009, 08:13
Re: admin help - by MenaceX^ - 31.08.2009, 08:18
Re: admin help - by sggassasin - 31.08.2009, 08:21
Re: admin help - by MenaceX^ - 31.08.2009, 08:26
Re: admin help - by sggassasin - 31.08.2009, 08:28
Re: admin help - by dice7 - 31.08.2009, 09:10

Forum Jump:


Users browsing this thread: 2 Guest(s)