SA-MP Forums Archive
[Pedido] Juntar meu /motoron e meu /motoroff em /motor - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Juntar meu /motoron e meu /motoroff em /motor (/showthread.php?tid=460437)



Juntar meu /motoron e meu /motoroff em /motor - gmstrikker - 28.08.2013

Fala galera fiz dois comandos pra ligar o veiculo, funcionaram direito e tal, mas o problema й que fiz pra ligar por teclas do teclado, sу que com dois comandos fica muito ruim queria passar o /motoron e /motoroff pra apenas /motor, qnd tive-se desligado ligava e qnd tive-se ligado ligava, vlw!

Ou entгo me ajude explicando sou mt novato nessa area, mas to gostando!

Quote:

new motor[MAX_PLAYERS], luz[MAX_PLAYERS], alarme[MAX_PLAYERS], portas[MAX_PLAYERS], capo[MAX_PLAYERS], portamalas[MAX_PLAYERS], objetivo[MAX_PLAYERS];

Quote:

if (strcmp("/motoron", cmdtext, true, 10) == 0)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(motor[playerid] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
motor[playerid] = 1;
format(string, sizeof(string), " %s estб ligando o veiculo.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!");
}
}
}
if (strcmp("/motoroff", cmdtext, true, 10) == 0)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(motor[playerid] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
motor[playerid] = 0;
format(string, sizeof(string), " %s estб desligando o veiculo.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!");
}
}
}




Re: Juntar meu /motoron e meu /motoroff em /motor - PT - 28.08.2013

pawn Код:
if (strcmp("/motor", cmdtext, true, 10) == 0)
{
    new mot, lu, alar, por, cap, porma, ob, carro = GetPlayerVehicleID(playerid);
    if(carro != INVALID_VEHICLE_ID)
    {
        if(motor[playerid] == 0)
        {
            GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
            SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
            motor[playerid] = 1;
            format(string, sizeof(string), " %s estб ligando o veiculo.", PlayerName(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
            SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!");
            return 1;
        }
        if(motor[playerid] == 1)
        {
            GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
            SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
            motor[playerid] = 0;
            format(string, sizeof(string), " %s estб desligando o veiculo.", PlayerName(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
            SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!");
        }
    }
    return 1;
}
simples


Re: Juntar meu /motoron e meu /motoroff em /motor - gmstrikker - 28.08.2013

Valeu funcionou!