SA-MP Forums Archive
Need to know something - 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)
+--- Thread: Need to know something (/showthread.php?tid=644409)



Need to know something - akib - 07.11.2017

How to detect weapon hacks?

my server have deagle gun and it is unlimited [ like a roleplay ]
but to get gun need to do something special like mats collection

if a player do weapon hack how i can detect it?

please show it with an example

Thanks.


Re: Need to know something - Gameluner - 07.11.2017

Код:
forward Weapons(playerid); public Weapons(playerid) {
    GetPlayerWeaponData(playerid, c, weaponid, ammo);
    if (weaponid != 24 ) return BanEx(playerid, "WeaponHack"); }

public OnPlayerConnect(playerid) {
    SetTimer("Weapons", 10000, 1); }

public OnPlayerDisconnect(playerid) {
    KillTimer(Weapons(playerid)); }
I think this could help, it will detect, if you have something else than Deagle.
Sorry for some mistakes, I wrote it quickly


Re: Need to know something - Eoussama - 07.11.2017

Quote:
Originally Posted by Gameluner
Посмотреть сообщение
Код:
forward Weapons(playerid); public Weapons(playerid) {
    GetPlayerWeaponData(playerid, c, weaponid, ammo);
    if (weaponid != 24 ) return BanEx(playerid, "WeaponHack"); }

public OnPlayerConnect(playerid) {
    SetTimer("Weapons", 10000, 1); }

public OnPlayerDisconnect(playerid) {
    KillTimer(Weapons(playerid)); }
I think this could help
Please avoid writing code like this, no offense, but this is so bad it's cancerous.


Re: Need to know something - Gameluner - 07.11.2017

I like it, sorry
Код:
forward Weapons(playerid); public Weapons(playerid) 
{
    GetPlayerWeaponData(playerid, c, weaponid, ammo);
    if (weaponid != 24 ) return BanEx(playerid, "WeaponHack"); 
}

public OnPlayerConnect(playerid) 
{
    SetTimer("Weapons", 10000, 1); 
}

public OnPlayerDisconnect(playerid) 
{
    KillTimer(Weapons(playerid)); 
}
//Nope, it doesn't work. Sorry, I don't have time to work on it.