Vehicle is turned off via script
#1

I created the command / engine to adjust the switching on and off of each individual vehicle. The problem is one. As soon as I get in the vehicle, the engine is off, but if I type the command / engine, it gives me the message "engine shutdown" - as if it was on, even if in reality it is not.
I think I need to set a variable that identifies each vehicle that spawns as off.. the problem is that I do not know where to put this variable.

code:
PHP код:
public OnGameModeInit()
{
    
ManualVehicleEngineAndLights();
public 
OnPlayerCommandText(playeridcmdtext[])
{
COMMAND:engine(playeridparams[])
{
   if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
   new 
str[128];
   new 
vehicle GetPlayerVehicleID(playerid);
   new 
engine,lights,alarm,doors,bonnet,boot,objective;
   
GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
{
  
SetVehicleParamsEx(vehicle,1,1,alarm,doors,bonnet,boot,objective);
  
format(strsizeof(str), "* %s accende il motore del veicolo"GetICName(playerid));
  
SendNearByMessage(playeridACTION_COLORstr10);
}
else
{
  
SetVehicleParamsEx(vehicle,0,0,alarm,doors,bonnet,boot,objective);
  
format(strsizeof(str), "* %s spegne il motore del veicolo"GetICName(playerid)); /// this is the message that appears the first time I type /engine, even if the vehicle is turned off
 
SendNearByMessage(playeridACTION_COLORstr10);
}
}
return 
1;

Reply


Messages In This Thread
Vehicle is turned off via script - by uTorrent - 06.05.2014, 15:21
Re: Vehicle is turned off via script - by Konstantinos - 06.05.2014, 15:39
Re: Vehicle is turned off via script - by uTorrent - 06.05.2014, 15:45
Re: Vehicle is turned off via script - by Konstantinos - 06.05.2014, 15:47
Re: Vehicle is turned off via script - by Vince - 06.05.2014, 15:56
Re: Vehicle is turned off via script - by uTorrent - 06.05.2014, 16:00

Forum Jump:


Users browsing this thread: 1 Guest(s)