05.06.2009, 06:31
Most people will learn from examples, especially if they have struggled with the problem themselves for a bit. I always offer as much explanation as I can to the posts I write.
I understand your frustration in this being a scripting discussion board with few discussion topics (****** has made some fantastic ones), and many "How do I..." topics. If we teach each other when we have problems, we can excel as a community. We're all on the same team here.
On that note, I am not sure if you can stop them from car jacking, but you can definitely remove them after (and possibly punish them?). I'm not sure how this code will run, as a_samp.inc says PLAYER_STATE_ENTER_VEHICLE_DRIVER is "used internally".
I understand your frustration in this being a scripting discussion board with few discussion topics (****** has made some fantastic ones), and many "How do I..." topics. If we teach each other when we have problems, we can excel as a community. We're all on the same team here.

On that note, I am not sure if you can stop them from car jacking, but you can definitely remove them after (and possibly punish them?). I'm not sure how this code will run, as a_samp.inc says PLAYER_STATE_ENTER_VEHICLE_DRIVER is "used internally".
pawn Код:
OnPlayerStateChange(playerid, newstate, oldstate) {
if(newstate == PLAYER_STATE_ENTER_VEHICLE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) {
// Player is entering a vehicle?
} else if(newstate == PLAYER_STATE_DRIVER) {
// Player has entered a vehicle
}
return 1;
}

