SA-MP Forums Archive
setadmin help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: setadmin help (/showthread.php?tid=137855)



setadmin help - lionlev - 30.03.2010

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?


Re: setadmin help - -Rebel Son- - 01.04.2010

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



Re: setadmin help - Postalityjr - 01.04.2010

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"


Re: setadmin help - Jay420 - 01.04.2010

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.


Re: setadmin help - Wiliam - 09.08.2010

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



Re: setadmin help - Rolyy - 09.08.2010

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