Help me with my anticheat.
#1

Hello everyone,i found a tutorial about an anticheat and since im new with pawn and all the stuff i though i should add this on my server.I did added everything,no problem,everything went smooth till i needed to add the guns you wont be banned if you spawn.First of all there are the guns i spawn with(deagle and shotgun) and there are some buyable guns.Ive added for example SetPVarInt(playerid,"wslot2",24); for the deagle and so for all the guns but i still get banned when i spawn.How can i make it so i wont get banned for the guns i spawn with and for the guns i can buy?Atm ive added on my gamemode smth like SetPVarInt(playerid,"wslotid",gunid);
with the weapons id i use on server....

Here is the link on the tutorial i used: https://sampforum.blast.hk/showthread.php?tid=140940
Thanks.
Reply
#2

do you have anything that resets the pvar, show the OnPlayerSpawn script
Reply
#3

Here is my onplayerspawn
Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid,99999);
    SetTimerEx("NoSpawnKill",6000,0,"i",playerid);
    SendClientMessage(playerid, 0x80FFFFFF, "You have a SpawnKill protection for 6 seconds!");
    new Random = random(sizeof(RandomSpawns));
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
    return 1;
}
Reply
#4

so where's the PVar in with the pistol of shotty?
Reply
#5

Oh,i should add the pvar there?
Reply
#6

that's probably be best
Reply
#7

Ive added everything there and i still get banned.This is how my onplayerspawn sounds now:
Code:
public OnPlayerSpawn(playerid)
{
    SetPVarInt(playerid,"wslot9",42);
    SetPVarInt(playerid,"wslot3",27);
    SetPVarInt(playerid,"wslot4",28);
    SetPVarInt(playerid,"wslot5",30);
    SetPVarInt(playerid,"wslot5",31);
    SetPVarInt(playerid,"wslot6",33);
    SetPVarInt(playerid,"wslot8",39);
    SetPVarInt(playerid,"wslot12",40);
    SetPVarInt(playerid,"wslot4",29);
    SetPVarInt(playerid,"wslot3",26);
    SetPVarInt(playerid,"wslot9",42);
    SetPlayerHealth(playerid,99999);
    SetTimerEx("NoSpawnKill",6000,0,"i",playerid);
    SendClientMessage(playerid, 0x80FFFFFF, "You have a SpawnKill protection for 6 seconds!");
    new Random = random(sizeof(RandomSpawns));
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
    return 1;
}
Reply
#8

the tutorial is pretty old now and I should probably update it with some better methods I've learned.

show the anticheat part that bans the player, maybe you didn't write it properly
Reply
#9

Alright,here is the ban part in the FS:

Code:
public WeaponCheck()
{
	new string[128];
	new tname[MAX_PLAYER_NAME];
	for(new j;j<MAX_PLAYERS;j++)
	{
		if(IsPlayerConnected(j) && GetPlayerState(j) == PLAYER_STATE_ONFOOT)
	  {
	    new ttemp = 0;
		for(new i = 0; i < 13; i++)
			{
			  new tweap, tammo;
			  GetPlayerWeaponData(j, i ,tweap ,tammo);
			  format(string,sizeof(string),"wslot%d",i);
			  if(GetPVarInt(j,string) != tweap && tweap != 0)
				{
				  ttemp++;
				}
			}
		if(ttemp != 0)
			{
				SetPVarInt(j,"sww",GetPVarInt(j,"sww")+1);
				if(GetPVarInt(j,"sww") > 2)
				{
			  	GetPlayerName(j,tname,sizeof(tname));
	      		CallRemoteFunction("BanIncrease","d",j);
			  	format(string, sizeof(string), "AC BAN: %s has been banned for: Weapon Hack", tname);
				SendClientMessageToAll(0xAA3333AA, string);
				Ban(j);
				}
			}
			else if(ttemp == 0)
			{
				SetPVarInt(j,"sww",0);
			}
		}
	}
}
Reply
#10

Up with this.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)