[Ajuda] Gasolina - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Gasolina (
/showthread.php?tid=289764)
[Ajuda] Gasolina -
' Bigode - 12.10.2011
No meu gm nemhum veiculo gasta gasolina oq fasso :
Re: [Duvida] Gasolina -
Hardware - 12.10.2011
Criar um SetTimer para retirar 1 de gasolina em determinado tempo.
Re: [Duvida] Gasolina -
Cristhian - 12.10.2011
exemplo:
pawn Код:
SetTimer("gasosa", "5000"...
Re: [Duvida] Gasolina -
' Bigode - 12.10.2011
e onde eu boto esse SetTimer("gasosa", "5000" :
Re: [Duvida] Gasolina -
Dolby - 12.10.2011
Qual o nome da sua calback de gasolina?
Re: [Duvida] Gasolina -
Hardware - 12.10.2011
No OnGameModeInit
Re: [Duvida] Gasolina -
' Bigode - 12.10.2011
PHP код:
public CheckGas()
{
new string[128];
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SetPlayerWantedLevel(i, WantedPoints[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(string, sizeof(string), "~p~Gasolina: ~w~%d",Gas[vid]);
if(Gas[vid] <= 10)
PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
if(Teste[i] == 0 && 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);
}
}
}
Re: [Duvida] Gasolina -
Cristhian - 12.10.2011
pawn Код:
SetTimer("CheckGas", "75000", "1000");
Re: [Duvida] Gasolina -
' Bigode - 12.10.2011
PHP код:
C:\Documents and Settings\Administrador\Desktop\Gta San Andreas\PH 1.7\gamemodes\elite.pwn(15783) : eqrror 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
Deu esse erro ai
Re: [Duvida] Gasolina -
Dolby - 12.10.2011
pawn Код:
SetTimer("CheckGas", 75000, true);