09.02.2014, 14:57
As above said, you need to define currentveh.
The problem is, he's getting the vehicleid of the player that was killed, not the player that killed him.
So, do this instead.
This code checks if the player (playerid) was killed by reason 50.
If so, it gets the killer (killerid)'s vehicleid, and destroys it.
It also sends him a client message saying Heliblading isn't allowed.
The problem is, he's getting the vehicleid of the player that was killed, not the player that killed him.
So, do this instead.
Код:
public OnPlayerDeath(playerid, killerid, reason) { if (reason == 50); { new currentveh; currentveh = GetPlayerVehicleID(killerid); DestroyVehicle(currentveh); SendDeathMessage(killerid, playerid, reason); SendClientMessage(killerid, -1, "Heliblading is not allowed!"); } return 1; }
If so, it gets the killer (killerid)'s vehicleid, and destroys it.
It also sends him a client message saying Heliblading isn't allowed.