[SOLVED] Admin immunity in junkbuster
#1

I'm tryin 2 make a litle bit Admin Imunity here ... so they can't get banned for health hacks...
This is the code, and ofcourse it doesn't do shit otherwise I wouldn't post here BUT i'm thinking IS correct no?

Код:
if(JB_Variables[HEALTH_HACK] && !JB_IsPlayerAdmin(i/playerid*))
{
    GetPlayerHealth(i,health);
    if(health>100)
    {
		JB_Ban(i,"Health hack");
		continue;
	}
}

* i or playerid, none work
Thnx for looking trough this, Greetz Riz

PS: this is in a include file
Reply
#2

include files is just for a better tidiness

I think it should be i because its in a loop
But I cant explain why you got a parameter called playerid, dont you have this code in a timer ?
And what is the variable JB_Variables[HEALTH_HACK] for ?
Reply
#3

Код:
public JunkBuster(playerid)
{
	new Float:health,Float:armour,weaponid,aping,reason[64];
	new Float:x,Float:y,Float:z;
	for(new i=0;i<MAX_PLAYERS;i++)
	{
        if(JB_Variables[HEALTH_HACK] && !JB_IsPlayerAdmin(i/playerid*))
        {
            GetPlayerHealth(i,health);
            if(health>100)
            {
		         JB_Ban(i,"Health hack");
		         continue;
	        }
        }
	}
	return 1;
}
* i or playerid, none work

This is the more complete code , if it helps ...
Here the health_hack code, I gess I put everything that has 2 do with it in here;

pawn Код:
#define HEALTH_HACK 3

new JB_Variables[MAX_VARIABLES]=
{
    true,//WeaponHack
    true,//MoneyHack
    true,//Jetpack
    true,//HealthHack
    true,//ArmourHack
    true,//DriveBy
    true,//Spam
    true,//CommandSpam
    true,//BadWords
    true,//CarJackHack
    false,//TeleportHack
    500,//MaxPing
    true,//SpectateHack
    true,//Blacklist
    true,//IpBans
    true,//TempBans
    3,//SpawnKill
    true,//CapsLock
    false,//3DSpeed
    260//MaxSpeed
};
new JB_VariableNames[MAX_VARIABLES][32]=
{
    "WeaponHack",
    "MoneyHack",
    "Jetpack",
    "HealthHack",
    "ArmourHack",
    "DriveBy",
    "Spam",
    "CommandSpam",
    "BadWords",
    "CarJackHack",
    "TeleportHack",
    "MaxPing",
    "SpectateHack",
    "Blacklist",
    "IpBans",// also contains IP-bans
    "TempBans",
    "SpawnKill",//Set this to the max spawnkills you want to allow
    "CapsLock",
    "3DSpeed",
    "MaxSpeed"
};
I'm trying to learn this language for long time but doesn't make any sence 2 me yet xD

Greetz Riz
PS: Just say if u need more code
Reply
#4

Okey, now I know what I thought before

Whats the exact problem ?
Is the code not working or is it working but bans the admins too?
JunkBuster is a timer, right ?
Why does it have the parameter playerid ?
Does JunkBuster (this code) gets called ?
(You should have somewhere SetTimerEx("JunkBester",... or something like that)
Reply
#5

The exact problem is that there is no Admin imunity, and I tried to do this using the "!JB_IsPlayerAdmin" but that doesn't do anything.
Junkbuster is just a Anti-cheat , include file ...
No timer...
The parameter playerid is just a normal parameter? to get the players id ??

Reply
#6

also, this code gets never called ?
Reply
#7

Like the example u gave? no, it get's never called

Greetz

PS: Srry, mist that one in the previous post
Edit: U can kinda discard this post in your mind, I gonna check the code once again maybe tomorrow? ok?

Greetz
Reply
#8

If this helps I got the topic from Double-O-Seven who made this script

http://forum.sa-mp.com/index.php?topic=96625.0

Here you will probably find all your answers , when you do... pls help me out.


Greets Riz
Reply
#9

YOP!

Thnx GO 2?! Double-O-Seven he included the admin imunity in his last release
http://forum.sa-mp.com/index.php?topic=96625.0
Ty for your help though

This topic may be locked

Riz
Reply
#10

Remember!

If you don't have a IsPlayerAdminCall(playerid) in your gamemode, immunity will only work for RCON admins.

Example:
pawn Код:
public IsPlayerAdminCall(playerid)
{
if(PlayerInfo[playerid][pAdmin]>0)
return true;
else
return false;
}
This function you have to make for your gamemode.

//Edit: Timer topic: You don't need to set a timer. Include does this for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)