[Include] Driveby - Detect when a PASSENGER is drivebying! (Driver support coming soon)
#1

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:
  • Zh3r0 - For some unknown reason
  • linuxthefish - Testing
  • SA-MP dev team - GetPlayerCameraMode function
Please report any bugs that you might encounter.

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

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
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)