/makeadmin
#2

pawn Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
  {
    if(adminlevel[playerid] == 7)
     {
      if(logged[playerid] == 1)
      {
      new tmp[256], tmp2[256], idx;   tmp = strtok(cmdtext,idx), tmp2 = strtok(cmdtext,idx);
      tmp = strtok(cmdtext, idx);
      new player1, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
      player1 = strval(tmp);
      level = strval(tmp2);
     if(!strlen(tmp))
    {
      SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /makeadmin [playerid] [level]");
    }
    else
    {
       if(adminlevel[playerid] == 7)
      {
       if(logged[playerid] == 1)
       {
      GetPlayerName(player1, playername, sizeof(playername));  GetPlayerName(playerid, adminname, sizeof(adminname));
      format(string,sizeof(string),"You have promoted %s to adminlevel %d ", playername, level);
       SendClientMessage(playerid, COLOR_GREEN, string);
      format(string,sizeof(string),"Administrator %s has promoted %s to adminlevel %d",adminname, playername, level);
      SendClientMessageToAll(playerid, COLOR_GREEN, string);
      adminlevel[playerid] = level;
      return 1;
      }
You forgot some braces.
pawn Код:
}
}
}
}
 return 1;
      }
Reply


Messages In This Thread
/makeadmin - by geerdinho8 - 28.04.2010, 18:10
Re: /makeadmin - by [MWR]Blood - 28.04.2010, 18:19
Re: /makeadmin - by geerdinho8 - 28.04.2010, 18:22
Re: /makeadmin - by geerdinho8 - 28.04.2010, 18:37
Re: /makeadmin - by MadeMan - 28.04.2010, 18:41
Re: /makeadmin - by geerdinho8 - 28.04.2010, 18:46
Re: /makeadmin - by MadeMan - 28.04.2010, 18:48
Re: /makeadmin - by geerdinho8 - 28.04.2010, 18:50
Re: /makeadmin - by [MWR]Blood - 28.04.2010, 18:52
Re: /makeadmin - by geerdinho8 - 28.04.2010, 18:53

Forum Jump:


Users browsing this thread: 3 Guest(s)