[Ajuda] sistema de motor
#1

Ola eu coloquei um sistema de motor no meu server sу que tem um porem quando entra nele digita /motor paw e liga normal mais se vc sair do veiculo e entrar dinovo vc tem que digitar dinovo e eu queria que se deixasse o veiculo ligado e saнsse e voltasse pra ele, ele ja ficava ligado.

codigos

PHP код:
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new 
vid GetPlayerVehicleID(playerid);
        new 
engine,lights,alarm,doors,bonnet,boot,objective;
        if(
EngineCarro[vid] == && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
        
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
        
SendClientMessage(playerid,COLOR_WHITE"* {00CD00}Para Ligar{FFFFFF} ou {EE0000}Desligar{FFFFFF} o Veiculo aperte {00CD00}'CTRL'{FFFFFF} ou digite: /motor.");
    } 
PHP код:
    if(strcmp(cmd"/motor",true) == 0)//na public OnPlayerCommandText
    
{
        new 
vid GetPlayerVehicleID(playerid);
        new 
engine,lights,alarm,doors,bonnet,boot,objective;
        if(
IsPlayerInAnyVehicle(playerid))
        {
            if(
EngineCarro[vid] == && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                new 
viados[MAX_PLAYER_NAME];
                
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                
SendClientMessage(playerid0xFFFFFFAA"Motor {2F991A}Ligado!");
                
EngineCarro[vid] = 1;
                
GetPlayerName(playeridviadossizeof(viados));
                
format(stringsizeof(string), "* %s Girou a chave e ligou o veiculo."viados);
                
ProxDetector(20.0playeridstringROXO,ROXO,ROXO,ROXO,ROXO);
            }
            else if(
EngineCarro[vid] == && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                new 
viados[MAX_PLAYER_NAME];
                
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                
SendClientMessage(playerid0xFFFFFFAA"Motor {E31919}Desligado!");
                
EngineCarro[vid] = 0;
                
GetPlayerName(playeridviadossizeof(viados));
                
format(stringsizeof(string), "* %s Girou a chave e desligou o veiculo."viados);
                
ProxDetector(20.0playeridstringROXO,ROXO,ROXO,ROXO,ROXO);
            }
        }
        return 
1;
       } 
Reply
#2

Troque essa parte:
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid);
        new engine,lights,alarm,doors,bonnet,boot,objective;
        if(EngineCarro[vid] == 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
        SendClientMessage(playerid,COLOR_WHITE, "* {00CD00}Para Ligar{FFFFFF} ou {EE0000}Desligar{FFFFFF} o Veiculo aperte {00CD00}'CTRL'{FFFFFF} ou digite: /motor.");
    }
por essa:
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {  
        SendClientMessage(playerid,COLOR_WHITE, "* {00CD00}Para Ligar{FFFFFF} ou {EE0000}Desligar{FFFFFF} o Veiculo aperte {00CD00}'CTRL'{FFFFFF} ou digite: /motor.");
    }
Reply
#3

agora quando eu entro em algum veiculo ele ja ta ligado!
Reply
#4

ajuda ae
Reply
#5

Alguem ajuda ae
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)