SA-MP Forums Archive
Stupid question. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Stupid question. (/showthread.php?tid=271812)



Stupid question. - Jmarr - 26.07.2011

New question:

How would I make it so that on a key press (the number 2) the engine begins to start, and how would I add a time limit to how long it would take to start it? Like 1 second or something. Thanks!

-------------------------------------------------------------------------
What I need to know, is what is wrong with this code. It's no doubt wrong, I am quite new to pawn. I want it so that when the driver enters the vehicle, the engine turns off (so I can code an ignition feature). This is what I've gotten so far:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsPlayerInAnyVehicle(playerid))
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, 0, 0, 0, 0, 0, 0);
}
}
    return 1;
}



Re: Stupid question. - =WoR=Varth - 26.07.2011

Put ManualVehicleEngineAndLights(); inside your OnGameModeInit


Re: Stupid question. - Jmarr - 26.07.2011

Works! Thanks.


Re: Stupid question. - Jmarr - 26.07.2011

Added a new question.


Re: Stupid question. - =WoR=Varth - 26.07.2011

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/SetTimerEx


Re: Stupid question. - Jmarr - 26.07.2011

Hmm, I guess I'll have to actually, *gulps* learn something.

Thanks for the links.