Detect PlayerVehicleDeath
#1

I'm trying to make it so when somebody shoots another player that is in a rustler (Dogfight type server) and there vehicle gets destroyed it announces it to the server e.g. "NAME took down NAME" or something like that.

The code below i found a while back but it doesent really do what i want it to do :L

PHP код:
public OnVehicleDeath(vehicleidkillerid)
{
    new 
string[128];
    if (
killerid != GetVehicleDriver(vehicleid) && (GetVehicleDriver(vehicleid) != INVALID_PLAYER_ID || killerid != INVALID_PLAYER_ID))
    {
        
format(stringsizeof(string), "[KILL] - %s Took Down  %s"PlayerName(GetVehicleDriver(vehicleid)), PlayerName(killerid));
        
SendClientMessageToAll(COLOR_RED,string);
    }
    return 
1;

If you have any idea of an include or some code that would be able to make this happen please let me know! Thanks
Reply
#2

Why no OnPlayerDeath man? and check if playerid was in a vehicle
Reply
#3

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
Why no OnPlayerDeath man? and check if playerid was in a vehicle
Because if he does no damage to the pilot, the killerid will be INVALID_PLAYER_ID. Unless I misunderstood.
Reply
#4

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Because if he does no damage to the pilot, the killerid will be INVALID_PLAYER_ID. Unless I misunderstood.
Exactly, i am trying to make it so if the "Killer" Shoots another player down on the killers screen it says "You killed NAME" and on the guy who died screen it says "Killed by NAME"
Reply
#5

I had a re-search and I found something that it may be usefull.

https://sampforum.blast.hk/showthread.php?tid=140765

Probably a combination with vehicle's position is a good way to detect it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)