Posts: 1,070
Threads: 12
Joined: Jun 2009
Reputation:
0
Maybe you added it wrong. What did you do? Try to show what you did. And show the error too.
Posts: 75
Threads: 28
Joined: Apr 2009
Reputation:
0
And how to set "playerid"?
Posts: 2,502
Threads: 26
Joined: Apr 2007
Reputation:
0
You can't, the only way you can do what your trying to do is:
1. If the person is in the car when it blows up
2. If the person somehow owns the car, then you can store the vehicle ID a variable and use it in OnVehicleDeath
Posts: 6,340
Threads: 58
Joined: May 2009
Reputation:
0
Try to check if killerid is a player and send a message to him.
Posts: 2,593
Threads: 34
Joined: Dec 2007
Something like this but it works if u r in the water :/ when your vehicle is explode nothing happens
Код:
stock VehicleDriverID(vehicleid) // by I xD
{
for(new i=0; i<GetMaxPlayers(); i++) if(IsPlayerConnected(i)) if(IsPlayerInVehicle(i,vehicleid)) if(GetPlayerState(i) == 2) return i;
return -1;
}
public OnVehicleDeath(vehicleid, killerid)
{
if(VehicleDriverID(vehicleid) != -1) {
SendClientMessage(VehicleDriverID(vehicleid),0xAA3333AA,"Your car is destroyed!");
}
return 1;
}
Or use SetTimerEx to send this message with 2 sec after explode