09.02.2014, 17:36
Quote:
You're missing some steps in your code.
You've created the variable 'currentveh', but you haven't actually assigned any value to it. You haven't told the program that currentveh holds the data of your current vehicle. The code doesn't recognize names, you could have as well called it potato, it wouldn't have made any difference for the processing. So, to actually make it hold the right value, let's turn it into this: pawn Код:
Second, it tells the server to put that bit of information inside 'currentveh', so everytime currentveh is called, it's being redirected to that vehicle, that saves us from fetching the information every single time. Now you can use currentveh to redirect to that specific vehicle, allowing you to do all sorts of things with it. Hope this works, cheers! |
Quote:
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. Код:
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. |