SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Filterscripts (https://forum.sa-mp.com/forumdisplay.php?f=17)
-   -   [FilterScript] Anti DB(Drive-By) Kill [SIMPLE] - My first FS! [+REP1] (https://forum.sa-mp.com/showthread.php?t=497553)

VenomMancer 27/02/2014 02:54 PM

Anti DB(Drive-By) Kill [SIMPLE] - My first FS! Updates v.1.2
 
Anti DB(Drive-By) Kill v1.2

Hello guys, i have idea for make this one :D
I dont know, if this has been released!


Here :
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    if(GetPlayerState(issuerid) == PLAYER_STATE_DRIVER || GetPlayerState(issuerid) == PLAYER_STATE_PASSENGER )
    {
        new Float:Health;
        GetPlayerHealth(playerid, Health);
        GetPlayerHealth(issuerid, Health);
        SetPlayerHealth(issuerid, Health - 20); // Make when player DB Kill, issuerid health will -20 /1 shoot
        SetPlayerHealth(playerid, Health + 100); // playerid health will +100 /1 shoot
        GameTextForPlayer(issuerid,"~r~~h~~h~Stop Drive by kill ~n~ or you will die!",4000,3);
    }
    return 1;
}

Or this :
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    if(GetPlayerState(issuerid) == PLAYER_STATE_DRIVER || GetPlayerState(issuerid) == PLAYER_STATE_PASSENGER )
    {
        GameTextForPlayer(issuerid,"~r~~h~~h~Stop Shoot ~n~ or you will kicked!",4000,3);
        PlayerPlaySound(issuerid,1085,0.0,0.0,0.0);
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new angga[256];
    new kname[MAX_PLAYER_NAME];
    GetPlayerName(killerid, kname, sizeof(kname));
    if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER || GetPlayerState(killerid) == PLAYER_STATE_PASSENGER )
    {
        format(angga, sizeof(angga), ":: SERVER :: %s has been kicked from server! (Reason : Drive-by kill)!",kname);
        SendClientMessageToAll(-1,angga);
        SetTimerEx("playerkick", 2000, 0, "i", killerid);
    }
    return 1;
}

forward playerkick(playerid);
public playerkick(playerid)
{
    Kick(playerid);
    return 1;
}

Simple! :D
Give me +REP1 for my 1st realesed FS!

Thanks :D

Ha$H_Sexyboy 27/02/2014 02:57 PM

Re: Anti DB(Drive-By) Kill [SIMPLE] - My first FS! [+REP1]
 
It's cool nice.

VenomMancer 27/02/2014 03:01 PM

Re: Anti DB(Drive-By) Kill [SIMPLE] - My first FS! [+REP1]
 
Quote:

Originally Posted by Ha$H_Sexyboy (Post 2932124)
It's cool nice.

Thanks :D

theomanking 27/02/2014 03:33 PM

Re: Anti DB(Drive-By) Kill [SIMPLE] - My first FS! [+REP1]
 
Awesome,
+2 Repulations!

VenomMancer 27/02/2014 03:42 PM

Re: Anti DB(Drive-By) Kill [SIMPLE] - My first FS! [+REP1]
 
Thanks Theo :D

VenomMancer 27/02/2014 04:29 PM

Re: Anti DB(Drive-By) Kill [SIMPLE] - My first FS! [+REP1]
 
If have bug, please tell me :D
Sorry for 2 post :D

Pottus 27/02/2014 04:33 PM

Re: Anti DB(Drive-By) Kill [SIMPLE] - My first FS! [+REP1]
 
Why not use OnPlayerUpdate() to check their armed weapon? If you want to disable drive by why bother checking after the fact when you can prevent it before it even happens. Now I can understand doing this as an additional measure of prevention but if it happens in OnPlayerTakeDamage() a kick would be in order.

VenomMancer 27/02/2014 05:06 PM

Re: Anti DB(Drive-By) Kill [SIMPLE] - My first FS! [+REP1]
 
OnplayerUpdate, will make the server lag!

BTW .. Updates!

Sagna 27/02/2014 05:15 PM

Re: Anti DB(Drive-By) Kill [SIMPLE] - My first FS! [+REP1]
 
how would the server lag if u use onplayerupdate??

Pottus 27/02/2014 05:39 PM

Re: Anti DB(Drive-By) Kill [SIMPLE] - My first FS! [+REP1]
 
Quote:

Originally Posted by VenomMancer (Post 2932311)
OnplayerUpdate, will make the server lag!

BTW .. Updates!

Complete non-sense.


All times are GMT. The time now is 01:17 PM.

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