SA-MP Forums Archive
[Include] Driveby - Detect when a PASSENGER is drivebying! (Driver support coming soon) - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Driveby - Detect when a PASSENGER is drivebying! (Driver support coming soon) (/showthread.php?tid=273182)



Driveby - Detect when a PASSENGER is drivebying! (Driver support coming soon) - Hiddos - 31.07.2011

I was bored and felt like making this.
Edit: I just noticed I only made driveby support for passengers and totally forgot about driver driveby

Your server needs to be 0.3c R3 or later!

Info
This is a simple include that allows you to find out whether a passenger (NOT the driver) is or isn't drivebying. It comes with two callbacks and one function:

pawn Код:
public OnPlayerStartDriveby(playerid) // Gets called when a player starts drivebying
public OnPlayerStopDriveby(playerid) // Gets called when a player stops drivebying
pawn Код:
native IsPlayerDrivebying(playerid); // Can be used at all times to check if a player is or isn't drivebying.
// Returns 1 if the player IS drivebying, else it returns 0 (obviously)
Here is some example code:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) //Somebody gets killed
{
  if(IsPlayerDrivebying(killerid)) //Checks if the killer is drivebying, and if so..
  {
    SetPlayerHealth(killerid, 0); //..if so, the killer gets killed because driveby is forbidden!
    SendClientMessage(killerid, 0xFF000000, "Thou shall not driveby!");
  }
  return 1;
}
The above code kills (read: should kill) any passenger that kills another player using driveby.

Download
To install and use this include, you just gotta download it and include it at the top of your script using:
pawn Код:
#include <driveby>
Good luck. Not that you need any.

Download
Solidfiles
Pastebin

Credits
Credits go to: Please report any bugs that you might encounter.

Once again, I'll try adding support for driver driveby soon


Re: Driveby - Detect when a PASSENGER is drivebying! (Driver support coming soon) - Zh3r0 - 31.07.2011

pawn Код:
Credits go to:

    Zh3r0 - For some unknown reason
I lol'd! You just asked me a damn question and I said, DUNNO! MAYBE!

Nice filterscript! Good job, can't wait to see that script you're working on you told me on MSN <3


Re: Driveby - Detect when a PASSENGER is drivebying! (Driver support coming soon) - Cypress - 31.07.2011

Good Work! I guess i can use your include to update my filter script!