SA-MP Forums Archive
Engine - 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: Engine (/showthread.php?tid=292546)



Engine - Dripac - 24.10.2011

I use now a custom engine system, but i always have to press twice Engine on in dialog to start it or turn it off

What could this cause? Also the Door Open doesn't work


Re: Engine - [MWR]Blood - 24.10.2011

Doors aren't synced. You can only lock/unlock them but not see them actually opened.
About the engine, show some code!


Re: Engine - Dripac - 24.10.2011

Quote:
Originally Posted by [MWR]Blood
Посмотреть сообщение
Doors aren't synced. You can only lock/unlock them but not see them actually opened.
About the engine, show some code!
Ah okay thanks, and there the code for the engine

OnDialogResponse

pawn Код:
case 4:
            {
                if(GetPVarInt(playerid, "Engine") == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    SetPVarInt(playerid, "Engine", 1);
                }
                else if(GetPVarInt(playerid, "Engine") == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                    SetPVarInt(playerid, "Engine", 0);
                }
            }
And the command

pawn Код:
ShowPlayerDialog(playerid,15152,DIALOG_STYLE_LIST,"Fahrzeug","Licht (an/aus)\nMotorhaube (auf/zu)\nKofferraum (auf/zu)\nTьre (auf/zu)\nMotor (an/aus)\nAlarm (an/aus)","Auswдhlen", "Abbrechen");
As said, first time i have to click 2 times on engine and then it will work