SA-MP Forums Archive
Mystery weapon appears - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: Mystery weapon appears (/showthread.php?tid=172146)



Mystery weapon appears - Rachael - 29.08.2010

I don't know if this is a bug, or an error on my part. This did not occur in previous versions of samp, it has started happening with 0.3b

Players are getting autobanned for heat seeking missile launcher ( weapon ID 36 ) detection. I have found it occurs when they enter a vehicle, and have deduced that it may be my anti drivershooting script.

under OnPlayerStateChange
pawn Code:
if(newstate == PLAYER_STATE_DRIVER)
     {
        new newcar = GetPlayerVehicleID(playerid);

        new gun, ammo;
        GetPlayerWeaponData(playerid,4,gun,ammo);
        if(gun == 29)
        {
            GivePlayerWeapon(playerid,29,-ammo);
            PutPlayerInVehicle(playerid,newcar,0);
        }
    }
and this is the script that autobans them ( simplified for this example )

pawn Code:
for (new j=12; j>0; j--)
{
GetPlayerWeaponData(playerid,j,weapon[j],ammo);
if(weapon[j] == 36)
{
    ... ban script

}
if anyone has any idea why this is happenning I would be grateful. Similarly if anyone knows a different and perhaps more efficient way to stop drivershooting.


Re: Mystery weapon appears - Mark_Weston - 29.08.2010

just delete this function
for (new j=12; j>0; j--)
{
GetPlayerWeaponData(playerid,j,weapon[j],ammo);
if(weapon[j] == 36)
{
... ban script

}
or just chagne weapon id to 1000 or somethin


Re: Mystery weapon appears - Venturas - 29.08.2010

Maybe your players are actually hacking.


Re: Mystery weapon appears - Rachael - 29.08.2010

obviously I don't want to delete my anticheat.


Re: Mystery weapon appears - CracK - 29.08.2010

Maybe you should add one more check?
Like this:
Code:
if(weapon[j] == 36 && ammo) // checks if ammo != 0



Re: Mystery weapon appears - Finn - 29.08.2010

This could be the same bug as this one.