I took out the ammunation in my server and created an anti spawn weapon script, it stores the weapon id into its slot and checks if the players weapons differ from what the server has, it's really effective since cheaters learn there's some weapons that are forbidden so they cheat weapons that aren't forbidden.
at the top
Code:
new sw[MAX_PLAYERS];
in "OnFilterScriptInit()"
Code:
SetTimer("WeaponCheck",5000,1);
in the onplayerconnect, disconnect, death and spawn.
Then I have this.
Code:
forward WeaponCheck();
public WeaponCheck()
{
new string[128];
new name[30];
new Float:health[MAX_PLAYERS];
for(new j;j<MAX_PLAYERS;j++)
{
GetPlayerHealth(j,health[j]);
if(IsPlayerConnected(j) && health[j] >= 10 && GetPlayerState(j) == PLAYER_STATE_ONFOOT)
{
if (CallRemoteFunction("OnPlayerWeaponCheck","d",j))
{
sw[j]++;
if(sw[j] >= 3)
{
GetPlayerName(j,name,sizeof(name));
CallRemoteFunction("BanIncrease","d",j);
format(string, sizeof(string), "AC BAN: %s has been banned", name);
SendClientMessageToAll(colour_red, string);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(j,X,Y,Z);
format(string, sizeof(string), "AC Ban: spawned weapons position(%f,%f,%f)",X,Y,Z);
sw[j] = 0;
BanEx(j,string);
}
}
else if(!CallRemoteFunction("OnPlayerWeaponCheck","d",j)) sw[j] = 0;
}
}
}
all the above is in a filterscript.
in the Game Mode I have this at the top
Code:
new WeaponCheck[MAX_PLAYERS][12];
every time a player gets a weapon
Code:
WeaponCheck[playerid][2] = 23;
23 is the weaponid and 2 is the slot
then this function for the filterscript to call
Code:
forward OnPlayerWeaponCheck(playerid);
public OnPlayerWeaponCheck(playerid)
{
for(new i = 0; i < 12; i++)
{
new tweap, tammo;
GetPlayerWeaponData(playerid, i ,tweap ,tammo);
if(tweap != WeaponCheck[playerid][i]) return tweap;
}
return 0;
}