setadmin help
#1

How can I turn this:
Код:
	if(strcmp(cmd, "/setadmin", true) == 0 || strcmp(cmd, "/makeadmin", true) == 0)
	{
    new player[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdmin] < 11 && !IsPlayerAdmin(playerid)) return DenyMessage(playerid, 11);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadmin or /makeadmin [playerid] [AdminLevel]");
		giveplayerid = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    new level = strval(tmp);
    	if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
    	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, player, sizeof(player));
    PlayerInfo[giveplayerid][pAdmin] = level;
    printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
    format(string, sizeof(string), "Admin \"%s\" has set your Admin Level to %d.",player, level);
    SendClientMessage(giveplayerid, COLOR_GREEN, string);
    format(string, sizeof(string), "You have given \"%s\" level %d admin.", giveplayer, PlayerInfo[giveplayerid][pAdmin]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    	return 1;
	}
In to: When I write /padmin <id> and it will make player admin level 1?
Reply
#2

at the top, where it says "/setadmin" change it to.. "padmins"
Reply
#3

Quote:
Originally Posted by [N
BL!nk ]
at the top, where it says "/setadmin" change it to.. "padmins"
Correction DONT change it to "padmins" ! change it to "padmin"
Reply
#4

pawn Код:
if(strcmp(cmd, "/padmin", true) == 0)
{
  new player[MAX_PLAYER_NAME];
  if(PlayerInfo[playerid][pAdmin] < 11 && !IsPlayerAdmin(playerid)) return DenyMessage(playerid, 11);
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /padmin [playerid]");
  giveplayerid = ReturnUser(tmp);
  tmp = strtok(cmdtext, idx);
  if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  GetPlayerName(playerid, player, sizeof(player));
  PlayerInfo[giveplayerid][pAdmin] = 1;//The admin level will be set to '1'
  printf("Admin %s made %s an admin.", player, giveplayer);
  format(string, sizeof(string), "Admin \"%s\" has made you an admin.",player);
  SendClientMessage(giveplayerid, COLOR_GREEN, string);
  format(string, sizeof(string), "You have given admin rights to \"%s\" ", giveplayer, PlayerInfo[giveplayerid][pAdmin]);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  return 1;
}
Don't know if that will work, but as I wasted a minute "editing" that command, it should do at least something.
/padmin [id] and it will set the "id's" admin level to 1.
Reply
#5

you need to make how much admins are there and i would suggest making a antispam for that cmd every 24h you could use it so it doesnt get abused
Reply
#6

just put there setadmin
not /setadmin
remove the / and it should work probably.. Unless the codes you have entered in the script wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)