[Ajuda] Comando
#2

pawn Код:
new bool:motorligado[MAX_PLAYERS];

public OnGameModeInit()
{
    ManualVehicleEngineAndLights();
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    motorligado[playerid] = false;
    return 1;
}


 if (strcmp("/motor", cmdtext, true, 10) == 0)
    {
   
    new engine, lights, alarm, doors, bonnet, boot, objective;
   
    new carro = GetPlayerVehicleID(playerid);
   
    GetVehicleParamsEx(carro, engine, lights, alarm, doors, bonnet, boot, objective);
   
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,Vermelho,"Vocк precisa ser motorista de um veнculo!");

    if(motorligado[playerid] == false)
    {
    motorligado[playerid] = true;
    SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
    SendClientMessage(playerid, -1, "Motor ligado");
    return 1;
    }
    else
    {
    motorligado[playerid] = false;
    SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
    SendClientMessage(playerid, -1, "Motor desligado");
    return 1;
    }


    return 1;
    }
Reply


Messages In This Thread
Comando - by Italoigt - 15.04.2016, 03:21
Re: Comando - by PainNagato - 15.04.2016, 09:36
Re: Comando - by 99fe3rnando - 15.04.2016, 09:39
Re: Comando - by HaRdiiZin - 15.04.2016, 09:50
Re: Comando - by Italoigt - 15.04.2016, 10:53
Re: Comando - by PainNagato - 15.04.2016, 15:02
Re: Comando - by ApocaSamp - 16.04.2016, 07:44

Forum Jump:


Users browsing this thread: 1 Guest(s)