SA-MP Forums Archive
Detecting DriveBy - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Detecting DriveBy (/showthread.php?tid=69771)



Detecting DriveBy - Redirect Left - 20.03.2009

How do you reliably detect if a player drive by'd for his kill?

I've tryed doing "if (IsPlayerInAnyVehicle(killerid))" and "if(reason == 29 && IsPlayerInAnyVehicle(killerid)) (29 = SMG)

Neither worked. Any idea?


Re: Detecting DriveBy - Rks25 - 20.03.2009

check anticheats for detecting driveby's.


Re: Detecting DriveBy - Kinetic - 21.03.2009

Код:
OnPlayerDeath(playerid, killerid, reason)
{
  if(IsPlayerInAnyVehicle(killerid))
  {
    if(reason == 28 || reason == 29 || reason == 32)
    {
      new Float:tmpx, Float:tmpy, Float:tmpz;
      GetPlayerPos(playerid, tmpx, tmpy, tmpz);
      SendClientMessage(killerid, 0xff0000ff, "Driveby detected. You have been kicked.");
      SendClientMessage(playerid, 0x000000ff, "You have been killed by driveby, you will now respawn where you died.");
      SpawnPlayer(playerid);
      SetPlayerHealth(playerid, 100);
      SetPlayerPos(playerid, tmpx, tmpy, tmpz);
      Kick(killerid);
      
    }
  }
  return 1;
}