SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/09/2019, 09:47 PM   #1
Piotrek
Little Clucker
 
Join Date: Sep 2011
Location: Behind your ass.
Posts: 12
Reputation: 0
Default Trouble with my anti-speedfire

Hello. I'm working for custom anti speedfire based on OnPlayerGiveDamage instead OnPlayerWeaponShoot. The code is looking correct for me, but indeed something gone wrong if we are testing it in game. Yeah - I know that will be not working for shooting in the air/objects or cars, but If I will finish this code then I will make another for protect cars.

Any ideas?
Code:
#include <a_samp>
#include <YSI\y_timers>


new GivenDamage[MAX_PLAYERS];


public OnPlayerConnect(playerid)
{
    GivenDamage[playerid]=0;
    return 1;
}

public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
         if(GetPlayerWeapon(playerid) == WEAPON_FLAMETHROWER || GetPlayerWeapon(playerid) == WEAPON_SPRAYCAN || GetPlayerWeapon(playerid) == WEAPON_FIREEXTINGUISHER)
        {
        //no result
        }
        GivenDamage[playerid]++;
}
ptask RepeatingTimer[1000](playerid)
{
    if(GetPlayerWeapon(playerid) == WEAPON_COLT45 && WEAPON_SILENCED && GivenDamage[playerid] > 3) Kick(playerid);
    if(GetPlayerWeapon(playerid) == WEAPON_DEAGLE && GivenDamage[playerid] > 2) Kick(playerid);
    if(GetPlayerWeapon(playerid) == WEAPON_UZI && WEAPON_MP5 && GivenDamage[playerid] > 5) Kick(playerid);
    if(GetPlayerWeapon(playerid) == WEAPON_M4 && WEAPON_AK47 && GivenDamage[playerid] > 3) Kick(playerid);
    if(GetPlayerWeapon(playerid) == WEAPON_RIFLE && WEAPON_SNIPER && GivenDamage[playerid] > 3) Kick(playerid);
GivenDamage[playerid] =0;
}
Piotrek is offline   Reply With Quote
Old 17/09/2019, 03:04 AM   #2
Cromartie
Little Clucker
 
Cromartie's Avatar
 
Join Date: Oct 2018
Location: BRASIL
Posts: 36
Reputation: 7
Default Re: Trouble with my anti-speedfire

if(GetPlayerWeapon(playerid) == WEAPON_COLT45 && WEAPON_SILENCED && GivenDamage[playerid] > 3) Kick(playerid);

As well? the player has to be 9mm and SILENCED to be kikado
You have to use is OR(||) is not is
Cromartie is offline   Reply With Quote
Old 17/09/2019, 01:40 PM   #3
Smacky
Big Clucker
 
Smacky's Avatar
 
Join Date: Jan 2011
Posts: 119
Reputation: 9
Default Re: Trouble with my anti-speedfire

U using just like this if players have a WEAPON_COLT and also have a Silenced Weapon at a same time. do what Cromartie said.
Smacky is offline   Reply With Quote
Old 20/09/2019, 02:34 AM   #4
Piotrek
Little Clucker
 
Join Date: Sep 2011
Location: Behind your ass.
Posts: 12
Reputation: 0
Default Re: Trouble with my anti-speedfire

Always not working... Why?
Piotrek is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Anti-Cheat ANTIFLY\ANTI GOD\ANTI SKIN BUG\ANTI MONEY HACK\ANTI JETPACK HACK\ANTI GODOFCARS\ANTI FAKEKILL RedMF LanÁamentos/Releases 15 19/07/2018 06:29 PM
Request anti cheat, anti flyhack | anti ammo hack | anti healt hack | anti aimboter Izaki Scripting Help 1 15/06/2015 04:21 PM
[Ajuda] Anti Crasher/Anti Lapirula Anti HAcks J4S0N PortuguÍs/Portuguese 3 18/02/2015 05:28 PM
Anti Flood/Anti Spam/Anti Database Hack CROSS_Hunter Server Support 3 11/09/2012 07:29 AM
Trouble, trouble, trouble... with strcmp I'm assuming 2KY Scripting Help 2 31/08/2012 04:39 AM


All times are GMT. The time now is 05:33 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.