[Ajuda] Gasolina
#1

No meu gm nemhum veiculo gasta gasolina oq fasso :
Reply
#2

Criar um SetTimer para retirar 1 de gasolina em determinado tempo.
Reply
#3

exemplo:
pawn Код:
SetTimer("gasosa", "5000"...
Reply
#4

e onde eu boto esse SetTimer("gasosa", "5000" :
Reply
#5

Qual o nome da sua calback de gasolina?
Reply
#6

No OnGameModeInit
Reply
#7

PHP код:
public CheckGas()
{
    new 
string[128];
    for(new 
i=0;i<MAX_PLAYERS;i++)
    {
        if(
IsPlayerConnected(i))
           {
               
SetPlayerWantedLevel(iWantedPoints[i]);
               if(
GetPlayerState(i) == PLAYER_STATE_DRIVER)
               {
                   new 
vid GetPlayerVehicleID(i);
                 if(
GetVehicleModel(GetPlayerVehicleID(i)) != 481 && 510)
                   {
                    if(
Gas[vid] >= 1)
                    {
                        
//format(string, sizeof(string), "~p~Gasolina: ~w~%d~p~ R: ~w~%d",Gas[vid],Marchas[i][1]);
                        
format(stringsizeof(string), "~p~Gasolina: ~w~%d",Gas[vid]);
                           if(
Gas[vid] <= 10)
                            
PlayerPlaySound(i10850.00.00.0);
                          if(
Teste[i] == && Player[i][LastSpeed] > 10 && GetVehicleModel(vid) != 462 && GetVehicleModel(vid) != 481 && GetVehicleModel(vid) != 510)
                          {
                              
tempGas[vid] ++;
                              if(
tempGas[vid] >= 20)
                              {
                                  
tempGas[vid] = 0;
                                
Gas[vid]--;
                            }
                        }
                       }
                       else
                       {
                        if(
Teste[i] == 0)
                        {
                              
NoFuel[i] = 1;
                               
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,0,0,0,0,0,0);
                               
GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~veўculo sem combustўvel",1500,6);
                           }
                    }
                } 
Reply
#8

pawn Код:
SetTimer("CheckGas", "75000", "1000");
Reply
#9

PHP код:
C:\Documents and Settings\Administrador\Desktop\Gta San Andreas\PH 1.7\gamemodes\elite.pwn(15783) : eqrror 035argument type mismatch (argument 2)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


1 Error

Deu esse erro ai
Reply
#10

pawn Код:
SetTimer("CheckGas", 75000, true);
Reply


Forum Jump:


Users browsing this thread: 8 Guest(s)