[Ajuda] Como colocar uma Tecla para ligar o motor...
#1

Preciso colocar Ctrl para ligar e desligar o motor dos carros, jб tentei tudo e nгo consigo... quem puder ajudar agradeзo!!!

public Startup(playerid, vehicleid)

PHP код:
    else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && !vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && !IsASalesVehicle(newcar))
    {
        
SendClientMessage(playeridCOLOR_GREEN"Atencao! Use /ingnicao ou pressione SHIFT para ligar o carro!");
        
TogglePlayerControllable(playeridfalse);
        
vehicleEntered[playerid][vehicleid] = true;
    } 

PHP код:
    if(!strcmp(cmd"/ingnicao"true))
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
IsPlayerInAnyVehicle(playerid))
            {
                new 
idcar GetPlayerVehicleID(playerid);
                if(!
engineOn[GetPlayerVehicleID(playerid)])
                {
                    if(
GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
                    if(
pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
                     if(
CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999 || IsASalesVehicle(idcar))
                        return 
SendClientMessage(playeridCOLOR_GREY,"* Voce nao pode ligar esse carro!");
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
format(stringsizeof(string), "* %s gira a chave e tentar ligar o motor do veнculo."sendername);
                    
ProxDetector(30.0playeridstringCOLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5);
                    
SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
                    
GameTextForPlayer(playerid"~w~Dando ingnicao no carro...",3500,3);
                    
gEngine[playerid] = 1;
                    return 
1;
                }
                else if(
engineOn[GetPlayerVehicleID(playerid)])
                {
                    if(
GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
                    if(
pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
                    if(
CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
                        return 
SendClientMessage(playeridCOLOR_GREY,"* Voce nao pode desligar esse carro!");
                    
format(stringsizeof(string), "* %s gira a chave e desliga o motor do veнculo."sendername);
                    
ProxDetector(30.0playeridstringCOLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5);
                    
GameTextForPlayer(playerid"~w~Tirando a chave do carro.",3500,3);
                    
gEngine[playerid] = 0;
                    
TogglePlayerControllable(playerid0);
                    return 
1;
                }
            }
     }
        return 
1;
    } 
Reply


Messages In This Thread
Como colocar uma Tecla para ligar o motor... - by escolano - 07.06.2013, 00:53
Re: Como colocar uma Tecla para ligar o motor... - by MonFiTy - 07.06.2013, 01:26
Re: Como colocar uma Tecla para ligar o motor... - by Cromado - 07.06.2013, 22:43

Forum Jump:


Users browsing this thread: 1 Guest(s)