SA-MP Forums Archive
help? - 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)
+--- Thread: help? (/showthread.php?tid=609321)



help? - Micko123 - 11.06.2016

I have this race system that is in FS. I can't put it in gamemode for some reasons. So i have one problem. When someone joins race his engine is turned off so if he wants to race he need to press "2" after countdown ends to turn it on. How can i make that engine is turned on as soon as he join race


Re: help? - MBilal - 11.06.2016

Well are you freezing player when he join race?

or u doing Setvehicleparams?

if setvehicleparams use that his engine will be turn on.
Code:
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);



Re: help? - Micko123 - 11.06.2016

I use freeze player. any ideas?


Re: help? - MBilal - 11.06.2016

unfreeze him when he join
Code:
TogglePlayerControllable(playerid, 1);



Re: help? - d1git - 11.06.2016

Freeze the player when he joins the race.

Code:
TogglePlayerControllable(playerid, false);
Turn the engine on.

Code:
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
When the timer runs out, unfreeze the player.

Code:
TogglePlayerControllable(playerid, true);