SA-MP Forums Archive
Junkbuster to ladmin . - 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: Junkbuster to ladmin . (/showthread.php?tid=248293)



Junkbuster to ladmin . - sMog. - 13.04.2011

Hello i cant understand that step ?
Код:
Step 4)
	You are using a default admin system with for example levels? Not only RCON?
	You can link this admin system with JunkBuster.
	JunkBuster can't recognize your adminsystem so you must add a function.

	Function (This is only an EXAMPLE!):

		public IsPlayerAdminCall(playerid)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
				return 1;
			else
				return 0;
		}

	IMPORTANT:
	This function depends on YOUR admin system. The function above is ONLY FOR GODFATHER so you
	may have to customize this function.
	If you do not add this function admin immunity will only work for RCON-admins!!!
	
	PS:
	JunkBuster is compatible with the default Godfather gamemode! (Tested)
cpde exaple:
Код:
CMD:sethealth(playerid,params[]) {
	if(PlayerInfo[playerid][Level] >= 3) {
	    new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
	    if(isnull(tmp) || isnull(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /sethealth [playerid] [amount]");
		if(strval(tmp2) < 0 || strval(tmp2) > 100 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid, red, "ERROR: Invaild health amount");
		new player1 = strval(tmp), health = strval(tmp2), string[128];
		if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
			CMDMessageToAdmins(playerid,"SETHEALTH");
			format(string, sizeof(string), "You have set \"%s's\" health to '%d", pName(player1), health); SendClientMessage(playerid,blue,string);
			if(player1 != playerid) { format(string,sizeof(string),"Administrator \"%s\" has set your health to '%d'", pName(playerid), health); SendClientMessage(player1,blue,string); }
   			return SetPlayerHealth(player1, health);
	    } else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}



Re: Junkbuster to ladmin . - (SF)Noobanatior - 13.04.2011

pawn Код:
public IsPlayerAdminCall(playerid)
        {
            if(PlayerInfo[playerid][Level] >= 1)
                return 1;
            else
                return 0;
        }
would be your system not sure what a level 1 is though


Re: Junkbuster to ladmin . - sMog. - 13.04.2011

but where i add cmd ?


Re: Junkbuster to ladmin . - sMog. - 14.04.2011

pump


Re: Junkbuster to ladmin . - sMog. - 16.04.2011

I got it thans for help -.-