18.02.2011, 12:46
(
Last edited by Vukilore; 19/02/2011 at 08:02 AM.
)
Hi All 
How are you ?
i have a problem with a command...
I would have a command than when we type /moteur, the engine of the vehicle go on, and when we retype /moteur, the engine go off...
I'm a beginner and i can't resolve this problem
(Sorry for my bad english, i'm french)
Can you help me ? that's be cut thanks

How are you ?

i have a problem with a command...
I would have a command than when we type /moteur, the engine of the vehicle go on, and when we retype /moteur, the engine go off...
I'm a beginner and i can't resolve this problem
(Sorry for my bad english, i'm french)
Code:
if(strcmp("/moteur", cmdtext, true) == 0) { if(IsPlayerInAnyVehicle(playerid)) { new vid = GetPlayerVehicleID(playerid); if(vid != INVALID_VEHICLE_ID) { GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); if(engine == VEHICLE_PARAMS_ON) { GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); PlayerPlaySound(playerid, 1022, 0.0, 0.0, 0.0); GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~y~Le moteur se ~r~ferme..", 3000, 3); } if(engine == VEHICLE_PARAMS_OFF) { GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective); PlayerPlaySound(playerid, 1021, 0.0, 0.0, 0.0); GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~y~Le moteur ~g~s'allume..", 3000, 3); } } } return 1; }
