Engine CMD is not working... (you'd think it would be simple)
#1

pawn Код:
CMD:en(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new engine,lights,alarm,doors,bonnet,boot,objective;
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(engine == 0)
        {
            SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
            new str[128];
            format(str, sizeof(str), "* %s twists the key in the ignition, turning the engine [ON]. *", GetName(playerid));
            SendRangeMessage(playerid, COLOR_DO, str, 15);
            return 1;
        }
        else if(engine == 1)
        {
            SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
            new str[128];
            format(str, sizeof(str), "* %s twists the key in the ignition, turning the engine [OFF]. *", GetName(playerid));
            SendRangeMessage(playerid, COLOR_DO, str, 15);
            return 1;
        }
    }
    return 1;
}
RESOLVED: there is a third parameter for vehicles other than off and on, and that is unspecified, or -1.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)