Why doesn't this code work?
#1

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
Reply


Messages In This Thread
Why doesn't this code work? - by ThePS3Guy - 09.08.2009, 05:06
Re: Why doesn't this code work? - by ruarai - 09.08.2009, 05:39
Re: Why doesn't this code work? - by ThePS3Guy - 09.08.2009, 06:06
Re: Why doesn't this code work? - by ruarai - 09.08.2009, 06:08
Re: Why doesn't this code work? - by ThePS3Guy - 09.08.2009, 06:17
Re: Why doesn't this code work? - by ruarai - 09.08.2009, 06:26
Re: Why doesn't this code work? - by ThePS3Guy - 09.08.2009, 06:32

Forum Jump:


Users browsing this thread: 1 Guest(s)