SA-MP Forums Archive
My fucking weapon anticheat - 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: My fucking weapon anticheat (/showthread.php?tid=125803)



My fucking weapon anticheat - CTCCoco - 05.02.2010

I create an anticheat that detects if a player have a bazooka or a minigun . Well why some players are banned when connect to the server if they don't have the weapon? WHY?!!!!!!!!!!!!!!

Thanks xD


Re: My fucking weapon anticheat - Calgon - 05.02.2010

Paste your code, as I'm not able to telepathically communicate with you and your script.


Re: My fucking weapon anticheat - CTCCoco - 05.02.2010

Quote:
Originally Posted by CalgonX
Paste your code, as I'm not able to telepathically communicate with you and your script.
Its only a settimer and a getplayerweapon. I put if(IsPlayerConnect(playerid) { if(weaponid == 38 ( for example ) ) { Ban(blablalbla)...

Thanks.


Re: My fucking weapon anticheat - MadeMan - 05.02.2010

Use OnPlayerUpdate.

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid) == 38)
    {
        Ban(playerid);
    }
    return 1;
}



Re: My fucking weapon anticheat - CTCCoco - 05.02.2010

Quote:
Originally Posted by MadeMan
Use OnPlayerUpdate.

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid) == 38)
    {
        Ban(playerid);
    }
    return 1;
}
That's the problem?


Re: My fucking weapon anticheat - MadeMan - 05.02.2010

I just recommend you using this

I don't know what's the problem of your script because you're not showing it.


Re: My fucking weapon anticheat - CTCCoco - 05.02.2010

Don't work. They are banning without any weapon yet

Here is a part of the code:

pawn Код:
new string[256];
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
new arma = GetPlayerWeapon(playerid);
//new ammo = GetPlayerAmmo(playerid);
if(arma == 1 && pArmaId1[playerid] == 0)
{
                        new year, month,day;
                        getdate(year, month, day);
                        format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: Cheto de mierda (%d-%d-%d)", giveplayer,month,day,year);
                        BanLog(string);
                        format(string, sizeof(string), "AdmCmd: %s a sido baneado por el anticheat de CTCCoco, razуn: owned", giveplayer);
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        PlayerInfo[playerid][pLevel] = -999;
                        Ban(playerid);
}
else if(arma == 2 && pArmaId2[playerid] == 0)
{
                        new year, month,day;
                        getdate(year, month, day);
                        format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: Cheto de mierda (%d-%d-%d)", giveplayer,month,day,year);
                        BanLog(string);
                        format(string, sizeof(string), "AdmCmd: %s a sido baneado por el anticheat de CTCCoco, razуn: owned", giveplayer);
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        PlayerInfo[playerid][pLevel] = -999;
                        Ban(playerid);
}
else if(arma == 3 && pArmaId3[playerid] == 0)
{
                        new year, month,day;
                        getdate(year, month, day);
                        format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: Cheto de mierda (%d-%d-%d)", giveplayer,month,day,year);
                        BanLog(string);
                        format(string, sizeof(string), "AdmCmd: %s a sido baneado por el anticheat de CTCCoco, razуn: owned", giveplayer);
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        PlayerInfo[playerid][pLevel] = -999;
                        Ban(playerid);
}
else if(arma == 4 && pArmaId4[playerid] == 0)
{
                        new year, month,day;
                        getdate(year, month, day);
                        format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: Cheto de mierda (%d-%d-%d)", giveplayer,month,day,year);
                        BanLog(string);
                        format(string, sizeof(string), "AdmCmd: %s a sido baneado por el anticheat de CTCCoco, razуn: owned", giveplayer);
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        PlayerInfo[playerid][pLevel] = -999;
                        Ban(playerid);
}
else if(arma == 5 && pArmaId5[playerid] == 0)
{
                        new year, month,day;
                        getdate(year, month, day);
                        format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: Cheto de mierda (%d-%d-%d)", giveplayer,month,day,year);
                        BanLog(string);
                        format(string, sizeof(string), "AdmCmd: %s a sido baneado por el anticheat de CTCCoco, razуn: owned", giveplayer);
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        PlayerInfo[playerid][pLevel] = -999;
                        Ban(playerid);
}
............etc
PLEASE help me.


Re: My fucking weapon anticheat - ~Dangun! - 05.02.2010

i had same problem

put on top
Код:
new PlayerSpawned[MAX_PLAYERS];
this onplayerconnect & disconnect
Код:
public OnPlayerConnect(playerid)
{
  PlayerSpawned[playerid] = 0;
	return 1;
}

public OnPlayerSpawn(playerid)
{
  PlayerSpawned[playerid] = 1;
	return 1;
}
Then in your weapon hack code
Код:
if(PlayerSpawned[i] == 1)



Re: My fucking weapon anticheat - CTCCoco - 05.02.2010

Quote:
Originally Posted by ReteLikker
i had same problem

put on top
Код:
new PlayerSpawned[MAX_PLAYERS];
this onplayerconnect & disconnect
Код:
public OnPlayerConnect(playerid)
{
  PlayerSpawned[playerid] = 0;
	return 1;
}

public OnPlayerSpawn(playerid)
{
  PlayerSpawned[playerid] = 1;
	return 1;
}
Then in your weapon hack code
Код:
if(PlayerSpawned[i] == 1)
Thanks but you are sure that this works? You use it and don't are banning innocent people?

Thanks.


Re: My fucking weapon anticheat - ~Dangun! - 05.02.2010

I am using this also for my anti cheat filterscript. i had this also, people joined and 5 secs later they were banned for a unknown weapon. since i used this it's gone