09.08.2009, 05:06
Before I post the code, credit for this goes to ev0lutionnn
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if((newstate == 4) && (oldstate == 2)) { // State 4 = Exiting a vehicle, State 2 = Driver - This makes sure he is now exiting the vehicle, and he was the driver (not a passenger)
DestroyVehicle(GetPlayerVehicleID(playerid)); // Not sure if this works because he technically isn't in a vehicle, but I think it should still return his vehicle ID
}
return 1;
}
It compiles correctly, and it "looks" like it should work (opinion of a noob scripter, me) but it just doesn't work.
PS: how do I post scripts in that Pawno script box that everyone seems to use? I searched and I cant find it. I found the samp pastebin, but I cant find out how to post that into a post
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if((newstate == 4) && (oldstate == 2)) { // State 4 = Exiting a vehicle, State 2 = Driver - This makes sure he is now exiting the vehicle, and he was the driver (not a passenger)
DestroyVehicle(GetPlayerVehicleID(playerid)); // Not sure if this works because he technically isn't in a vehicle, but I think it should still return his vehicle ID
}
return 1;
}
It compiles correctly, and it "looks" like it should work (opinion of a noob scripter, me) but it just doesn't work.
PS: how do I post scripts in that Pawno script box that everyone seems to use? I searched and I cant find it. I found the samp pastebin, but I cant find out how to post that into a post