Weapon hack
#1

This is my anti weapon hack but this sometimes ban for no reason !
PHP код:
    if(newkeys KEY_SECONDARY_ATTACK || newkeys KEY_FIRE || newkeys KEY_ACTION  && GetPlayerWeapon(playerid) != 0)
    {
        if(
sSecure[DETECT_WEAPON] == 1)
        {
            if(!
CheckWeapons(playerid))
            {
                new 
m_weapons[13][2];
                for (new 
x=0x<13x++)
                {
                    
GetPlayerWeaponData(playeridxm_weapons[x][0], m_weapons[x][1]);
                }
                
pClient[playerid][SECURE_DELAY] = gettime()+3;
                
format(pClient[playerid][STRING_MEDIUM],SIZE_MEDIUM,""COLOR_GREY" %s(%d) > probably corrupted [weapons:onfoot]",pGeneral[playerid][PLR_NAME],playerid);
                
AdminMessage(pClient[playerid][STRING_MEDIUM]);
                
format(pClient[playerid][SECURE_WARN_TXT],26,"corrupted weapons");
                
pClient[playerid][SECURE_WARN]++;
                return 
1;
            }
        }
    } 
Reply
#2

i dont recommand to use onplayerkeystatechange

listen carfuly

dont give weapons by GivePlayerWeapon, Create a stock GiveWeapon
int the stock save the weapons data like this:
Quote:

stock GiveWeapon(playerid,weapon,ammo)
{
format(str,10,"weap%d",weapon);
SetPVarInt(playerid,str,1);
format(str,10,"wslot%d",GetWeaponSlot(weapon));
SetPVarInt(playerid,str,weapon);
format(str,10,"weapammu%d",weapon);
SetPVarInt(playerid,str,ammo);
format(str,10,"weapammumax%d",weapon);
SetPVarInt(playerid,str,ammo);
GivePlayerWeapon(playerid,weapon,ammo);
}

than go to OnPlayerWeaponShot and check if have the weapon that he shoot with like this:
Quote:

new store[10];
format(store,10,"wslot%d",GetWeaponSlot(weaponid)) ;
if(GetPVarInt(playerid,store) != weaponid && weaponid != 46)
{
// report to admins
ResetPlayerWeapons(playerid);
for(new i = 1; i <= 34; i++)
{
format(store,10,"weap%d",i);
if(GetPVarInt(playerid,store) == 1)
{
format(store,10,"weapammu%d",i);
GivePlayerWeapon(playerid,i,GetPVarInt(playerid,st ore));
}
}
return 0;//Shot wont be fired
}

then you dont need to kick someone because it is reset his weapons, dont let him shot because we returned 0
and give him again the weapons.
have fun, and if you liked it leave a +rep
sorry for my english
Reply
#3

This is the best way for my system because its a bit unique. But it sometimes ban fake .
Reply
#4

Quote:
Originally Posted by Camtasia
Посмотреть сообщение
i dont recommand to use onplayerkeystatechange

listen carfuly

dont give weapons by GivePlayerWeapon, Create a stock GiveWeapon
int the stock save the weapons data like this:

than go to OnPlayerWeaponShot and check if have the weapon that he shoot with like this:

then you dont need to kick someone because it is reset his weapons, dont let him shot because we returned 0
and give him again the weapons.
have fun, and if you liked it leave a +rep
sorry for my english
This is not the safest way to check if a player is hacking or not because OnPlayerWeaponShot works ONLY with weapons which have bullets (even though it won't detect RPG's and a few more) so a player can easily hack a baseball bat or a knife and such.
Reply
#5

It wont impact the server players if they have knife or baseball
it is important to be safe from those weapons, in my server i dont use rpg at all.
and this way dosent fake ban. so... I think its a relly good way
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)