hallo ich habe das problem dass mann /motor 2 mal eingeben muss das der motor startet aber warum?
hier mein code
if(strcmp(cmd, "/motor",true) == 0)
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1;
new engine,lights,alarm,doors,bonnet,boot,objective;
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
if(vid != INVALID_VEHICLE_ID)
{
if(engine == VEHICLE_PARAMS_OFF)
{
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
//GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~W~Motor ~g~an!", 2000, 5);
SendClientMessage(playerid,0xBE00FFFF,"Motor gestartet...");
}
else
{
if(gGas[playerid] == 0)
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
//GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~W~Motor ~r~aus!", 2000, 5);
SendClientMessage(playerid,0xBE00FFFF,"Motor gestoppt...");
}
}
return 1;
}
beim erstem mall komtm dann Motor gestoppt...
und erst beim 2. mal kommt motor gestartet