PDA

View Full Version : How to make the admin immune?


[LHT]Bally
04/05/2012, 07:07 PM
i was wondering how i would make admin immune to this system

this is how the admin is called if(APlayerData[playerid][PlayerLevel] < 1)

#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <sscanf>

forward ResetCount(playerid);
new bool:IsPlayerInModShop[MAX_PLAYERS];
forward ResetCommandCount(playerid);

#define SpamLimit (4000)

#define red 0xFF0000

#define version "1.0"


#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Virtual Homer ");
print("Download from sa-mp server");
print("--------------------------------------\n");
return 1;

}


public OnFilterScriptExit()
{
print(" Virtual Homers Anti-Spam Unloaded.");
return 1;
}

#endif
public OnPlayerText(playerid, text[])
{
new TCount, KMessage[128];

TCount = GetPVarInt(playerid, "TextSpamCount");

TCount++;

SetPVarInt(playerid, "TextSpamCount", TCount);

if(TCount == 2) {
SendClientMessage(playerid, 0xFFFFFF, "{ff0000}[Virtual Homer Spam Warning You Will be Kicked for Spamming");
}
else if(TCount == 3) {
GetPlayerName(playerid, KMessage, sizeof(KMessage));
format(KMessage, sizeof(KMessage), " {ff0000}Virtual Homer Has kicked: {00ff00}%s {ff0000}For Spamming", KMessage);
SendClientMessageToAll(0xFFFFFF, KMessage);
print(KMessage);
Kick(playerid);
}

SetTimerEx("ResetCount", SpamLimit, false, "i", playerid);

return 1;
}

public ResetCount(playerid)
{
SetPVarInt(playerid, "TextSpamCount", 0);
}
public ResetCommandCount(playerid)
{
SetPVarInt(playerid, "CommandSpamCount", 0);
}

public OnEnterExitModShop(playerid, enterexit, interiorid)
{
if(!enterexit) IsPlayerInModShop[playerid] = false;
else IsPlayerInModShop[playerid] = true;
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
if(!IsPlayerInModShop[playerid])
{
new sendername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Vehicle Part Tune Hack", sendername);
SendClientMessageToAll(red, string);
format( string, sizeof(string), "VIRTUAL HOMER ");
GameTextForAll( string, 5000, 3 );
BanEx(playerid, "Tune Hack");
}
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
if(!IsPlayerInModShop[playerid])
{
new sendername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Vehicle Paint Tune Hack", sendername);
SendClientMessageToAll(red, string);
format( string, sizeof(string), "VIRTUAL HOMER ");
GameTextForAll( string, 5000, 3 );
BanEx(playerid, "Tune Hack");
}
}




public OnPlayerSpawn(playerid)
{
SetPlayerArmour(playerid, 0.0);
return 1;
}
public OnPlayerUpdate(playerid)
{
if(!IsPlayerAdmin(playerid))
{
if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN || GetPlayerWeapon(playerid) == 16 || GetPlayerWeapon(playerid) == 17 || GetPlayerWeapon(playerid) == 18 || GetPlayerWeapon(playerid) == WEAPON_SATCHEL || GetPlayerWeapon(playerid) == WEAPON_ROCKETLAUNCHER)
{
new sendername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 128, "{00ff00}%s {ff0000}Has Been Banned by {ff0000}Virtual Homer {ff0000}for {00ff00}Weapon Hack", sendername);
SendClientMessageToAll(red, string);
format( string, sizeof(string), "VIRTUAL HOMER ");
GameTextForAll( string, 5000, 3 );
for ( new i = 0; i != MAX_PLAYERS; ++i ) PlayerPlaySound(i, 1057, 0.0, 0.0, 10.0);
TogglePlayerControllable(playerid, 0);
BanEx(playerid, "Weapon Hack");
return 1;
}
new Float:health;
if(GetPlayerHealth(playerid, health) > 999999)
{
new sendername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Health Hack", sendername);
SendClientMessageToAll(red, string);
format( string, sizeof(string), "VIRTUAL HOMER ");
GameTextForAll( string, 5000, 3 );
TogglePlayerControllable(playerid, 0);
BanEx(playerid, "Health Hack");
return 1;
}
new Float:armor;
if(GetPlayerArmour(playerid, armor) == 100)
{
new sendername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Armour Hack", sendername);
SendClientMessageToAll(red, string);
format( string, sizeof(string), "VIRTUAL HOMER ");
GameTextForAll( string, 5000, 3 );
TogglePlayerControllable(playerid, 0);
BanEx(playerid, "Armor Hack");
return 1;
}
}
return 1;
}

ViniBorn
04/05/2012, 07:11 PM
Example

if(!IsPlayerInModShop[playerid] && APlayerData[playerid][PlayerLevel] < 1)

if(!IsPlayerAdmin(playerid) && APlayerData[playerid][PlayerLevel] < 1)

If APlayerData[playerid][PlayerLevel] aren't in the same code, you can use PVars

[LHT]Bally
04/05/2012, 07:16 PM
it says its not defined but i dont know how to define it lol

ViniBorn
04/05/2012, 07:20 PM
This is because the variable APlayerData should be in another script.

As I told you, you can use pVar to use the same information in different scripts.

You can also integrate this to your FS GM...