- 0
Problema system Engine
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
Tudo
Am un cod pentru pornirea motorului dar cand pornesc motorul se aprind si luminile iar eu le vreau separat, cand apas pe tasta 2 sa porneasca/opreasca motorul iar pe CTRL sa pornesc/opresc luminile
if(newkeys & KEY_SUBMISSION) //Number 2 or + in your keyboard. { if(IsPlayerInAnyVehicle(playerid)) // If the player is in any vehicle (I should have done this to state driver but anyways). { new engine, lights, alarm, doors, bonnet, boot, objective; // Variables to store the status. new vid = GetPlayerVehicleID(playerid); // We need to get players vehicle to get the params. GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective); // We need to get vehicle params in order to change them. if(engine == 0) // If engine is OFF the code below turns on the engine. { SetVehicleParamsEx(vid,1,1,alarm,doors,bonnet,boot,objective); SendClientMessage(playerid,-1,"You turned ON your vehicle engine and lights."); return 1; } else if(engine == 1) // If the engine is ON so we turn it off. { SetVehicleParamsEx(vid,0,0,alarm,doors,bonnet,boot,objective); SendClientMessage(playerid,-1,"You turned OFF your vehicle engine and lights."); return 1; } else if(engine == -1) // If the params are unset let's take a example when you spawn a car as admin. { SetVehicleParamsEx(vid,1,1,alarm,doors,bonnet,boot,objective); } } }Multumesc de ajutor .
5 answers to this question
Recommended Posts