[Ajuda] Ajuda ae com Carros ?
#1

tipo nomeu server puis isso :

no public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
string[256];
    new 
McCarro[128];// Pus isso
    
new enginelightsalarmdoorsbonnetbootobjective;// Pus isso
    
GetPlayerName(playeridsendernamesizeof(sendername));
    
format(stringsizeof(string), "%s acaba de Entrar em um Veiculo "sendername);
    
format(McCarrosizeof (McCarro), "Ligar ou desligar o Motor do veiculo precione [Y] e a Luz [N].");// Pus isso
    
SendClientMessage(playerid0xFFFFFFFFMcCarro);// Pus isso
    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    if(
GetVehicleModel(vehicleid) == 462 || GetVehicleModel(vehicleid) == 463 || GetVehicleModel(vehicleid) == 471 || GetVehicleModel(vehicleid) == 521 || GetVehicleModel(vehicleid) == 522 || GetVehicleModel(vehicleid) == 523 || GetVehicleModel(vehicleid) == 581 || GetVehicleModel(vehicleid) == 586// 411 is the infernus model
    
{
          
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);// Pus isso
          
SetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);// Pus isso
    
}
    return 
1;

e no public OnPlayerCommandText(playerid, cmdtext[])
PHP код:
    if (strcmp("/farol"cmdtexttrue10) == 0)
    {
        new 
vehveh GetPlayerVehicleID(playerid);
        new 
enginelightsalarmdoorsbonnetbootobjective;
        {
            if(
GetPVarInt(playerid"lights") == 0)
            {
                
GetVehicleParamsEx(vehvehenginelightsalarmdoorsbonnetbootobjective);
                
SetVehicleParamsEx(vehvehengine,VEHICLE_PARAMS_ONalarmdoorsbonnetbootobjective);
                
SendClientMessage(playerid, -1"Farol do veiculo Ligado.");
                
SetPVarInt(playerid"lights"1);
                return 
1;
            }
            else if(
GetPVarInt(playerid"lights") == 1)
            {
                
GetVehicleParamsEx(vehvehenginelightsalarmdoorsbonnetbootobjective);
                
SetVehicleParamsEx(vehvehengineVEHICLE_PARAMS_OFFalarmdoorsbonnetbootobjective);
                
SendClientMessage(playerid, -1"Farol do veiculo Desligado.");
                
SetPVarInt(playerid"lights"0);
                return 
1;
            }
        }
    }
    if (
strcmp("/motor"cmdtexttrue10) == 0)
    {
        new 
vehveh GetPlayerVehicleID(playerid);
        new 
enginelightsalarmdoorsbonnetbootobjective;
        {
            if(
GetPVarInt(playerid"engine") == 0)
            {
                 
GetVehicleParamsEx(vehvehenginelightsalarmdoorsbonnetbootobjective);
                 
SetVehicleParamsEx(vehvehVEHICLE_PARAMS_ONlightsalarmdoorsbonnetbootobjective);
                 
SendClientMessage(playerid, -1"Motor do veiculo Ligado.");
                 
SetPVarInt(playerid"engine"1);
                 return 
1;
            }
            else if(
GetPVarInt(playerid"engine") == 1)
            {
                 
GetVehicleParamsEx(vehvehenginelightsalarmdoorsbonnetbootobjective);
                 
SetVehicleParamsEx(vehvehVEHICLE_PARAMS_OFFlightsalarmdoorsbonnetbootobjective);
                 
SendClientMessage(playerid, -1"Motor do veiculo Desligado.");
                 
SetPVarInt(playerid"engine"0);
                 return 
1;
            }
        }
    } 
E terceiro no public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
PHP код:
    if((newkeys == 65536) && (IsPlayerInAnyVehicle(playerid)))
    {
        
OnPlayerCommandText(playerid"/motor");
    }
    if((
newkeys == 131072) && (IsPlayerInAnyVehicle(playerid)))
    {
        
OnPlayerCommandText(playerid"/farol");
    } 
Mais quendo entro no meu server eu quero que os carros estao desligados mais tipo entro num carro e ele ja ta ligado e aperto y pra ligar ae fala veiculo ligado e aperto de novo ae desliga

mais queria q todos carros do meu serve ficase desligado e apertava y ligava o veiculo

tem um algun sistema q o carro fica desligado ?
Reply
#2

Ajuda ? seria grato
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)