[BOLLOX I NEED HELP] Car fire?
#6

There's a trick for that called pseudocode, it's really all about translating the code into english

Код:
for(new i; i<200; i++)
{
  if(!IsPlayerConnected(i)) continue;
  if(!IsPlayerInAnyVehicle(i) || !IsPlayerAdmin(i)) continue;
  new Float:fVehicleHealth;
  GetVehicleHealth(GetPlayerVehicleID(i),fVehicleHealth);
  if(fVehicleHealth < 400)
    SetVehicleHealth(GetPlayerVehicleID(i),1000.0);
}
becomes
[quote]
loop through all players
- if the player ID isn't connected -> go to the next player ID
- if the player isn't in any vehicle, or if the player isn't logged in as an RCON admin -> go to the next player ID
- create a variable named fVehicleHealth and store the players current vehicle health in it
- if the health of the car reaches a value of below 400
-- set the vehicle health back to 1000
end loop - next player ID
Reply


Messages In This Thread
[BOLLOX I NEED HELP] Car fire? - by My_Waffles_Bitch_L0L - 11.02.2009, 11:46
Re: [BOLLOX I NEED HELP] Car fire? - by Grove - 11.02.2009, 11:50
Re: [BOLLOX I NEED HELP] Car fire? - by SuperS0nic - 11.02.2009, 11:51
Re: [BOLLOX I NEED HELP] Car fire? - by Grove - 11.02.2009, 11:53
Re: [BOLLOX I NEED HELP] Car fire? - by My_Waffles_Bitch_L0L - 11.02.2009, 12:16
Re: [BOLLOX I NEED HELP] Car fire? - by [RP]Rav - 11.02.2009, 13:00
Re: [BOLLOX I NEED HELP] Car fire? - by My_Waffles_Bitch_L0L - 11.02.2009, 13:19
Re: [BOLLOX I NEED HELP] Car fire? - by [RP]Rav - 11.02.2009, 13:22
Re: [BOLLOX I NEED HELP] Car fire? - by Jefff - 11.02.2009, 13:26

Forum Jump:


Users browsing this thread: 1 Guest(s)