Engine Not Turning On/Variable problem?
#1

pawn Код:
command(engine, playerid, params[])
{
    #pragma unused params
    new string[128];
    SendClientMessage(playerid, WHITE, "pragma unsued params");
    if(IsPlayerInAnyVehicle(playerid))
    {
        SendClientMessage(playerid, WHITE, "Isplayerinanyvehicle");
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            SendClientMessage(playerid, WHITE, "playeR_state_driver");
            new vehicleid = GetPlayerVehicleID(playerid);
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            if(EngineOn[vehicleid] == 0) //turn off
            {
                SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
                format(string, sizeof(string), "* %s starts the engine of the %s", GetName(playerid), VehicleNames[vehicleid-400]);
                NearByMessage(playerid, NICESKY, string);
                EngineOn[vehicleid] = 1;
            }
            else if(EngineOn[vehicleid] == 1) //turn on
            {
                SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
                format(string, sizeof(string), "* %s stops the engine of the %s", GetName(playerid), VehicleNames[vehicleid-400]);
                NearByMessage(playerid, NICESKY, string);
                EngineOn[vehicleid] = 0;
            }
        }
    }
    return 1;
}
This is my engine command. Everything goes fine until it reaches the actual part where the engine goes on. Please help.
Reply


Messages In This Thread
Engine Not Turning On/Variable problem? [FIXED] - by Sledge - 21.07.2011, 03:30
Re: Engine Not Turning On/Variable problem? - by Steven82 - 21.07.2011, 04:21
Re: Engine Not Turning On/Variable problem? - by Sledge - 21.07.2011, 04:45
Re: Engine Not Turning On/Variable problem? - by iFriSki - 21.07.2011, 05:38
Re: Engine Not Turning On/Variable problem? - by Sledge - 21.07.2011, 05:39
Re: Engine Not Turning On/Variable problem? - by antonio112 - 21.07.2011, 11:12
Re: Engine Not Turning On/Variable problem? - by Sledge - 21.07.2011, 17:46
Re: Engine Not Turning On/Variable problem? - by MadeMan - 21.07.2011, 17:51
Re: Engine Not Turning On/Variable problem? - by Sledge - 21.07.2011, 17:54

Forum Jump:


Users browsing this thread: 1 Guest(s)