[Ajuda] Combustнvel nгo desconta
#4

Seu cуdigo parece muito confuso.

Fiz aqui rapidamente pra vocк, adapte ao seu gamemode e veja as alteraзхes e otimizaзгo feita.
Se houver algum erro me comunique pois criei por aqui e mesmo e nem copilei.

PHP код:
SetTimerEx("CombustivelVeiculo"15000true"i"playerid);
forward CombustivelVeiculo(playerid); 
public 
CombustivelVeiculo(playerid

    if(!
IsPlayerInAnyVehicle(playerid)) return 1// retorna se nao tiver em veiculos
    
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1//retorna se nao tiver como motorista
    
new modelo GetVehicleModel(GetPlayerVehicleID(playerid));
    if(
modelo == 509 || modelo == 510) return 1// retorna se tiver em bikes 
 
    
format(formatosizeof(formato),"~y~~h~Combustivel:~w~ %i"InfoPlayer[playerid][Combustivel]); 
    
TextDrawSetString(CombustivelT[playerid],formato); 
    
TextDrawShowForPlayer(playeridCombustivelT[playerid]); 
             
    if(
InfoPlayer[playerid][Combustivel] < 5
    { 
        
SendClientMessage(playerid0xFF0808AA"Seu combustнvel estб acabando, vб atй um posto de gasolina mais prуximo!"); 
        
PlayerPlaySound(playerid10570.00.010.0); 
        return 
0
    } 
    if(
InfoPlayer[playerid][Combustivel] == 0
    { 
        
SendClientMessage(playerid0xFF0808AA"Seu combustнvel acabou!"); 
        
RemovePlayerFromVehicle(playerid);
        return 
0
    }
    
InfoPlayer[playerid][Combustivel] --;
    return 
1

Reply


Messages In This Thread
Combustнvel nгo desconta - by Ley - 29.05.2018, 21:40
Re: Combustнvel nгo desconta - by PT - 29.05.2018, 22:05
Re: Combustнvel nгo desconta - by AutoMatic2 - 29.05.2018, 22:14
Re: Combustнvel nгo desconta - by Cleyson - 30.05.2018, 00:02

Forum Jump:


Users browsing this thread: 2 Guest(s)