[infinite health?] Please help me! [SOLVED]
#1

Can I make it so that the cars in my gamemode do not take damage? And so that it takes no visual damage? Please tell me how if you can....
Reply
#2

pawn Код:
forward myTimer();
 
public OnGameModeInit()
{
  SetTimer("myTimer", 1000, true);
  return true;
}
 
public myTimer()
{
  new
      v;
  /* use you're own define for maximum amount of vehicles,
  because i doubt you're using 2000 vehicles which is equal to MAX_VEHICLES define. */

  for(v = 0; v < MAX_VEHICLES; v++) RepairVehicle(v);
  return true;
}
Reply
#3

Ok, I have a car spawning command so what would happen if I leave it to 2,000 cars?
Reply
#4

Quote:
Originally Posted by devteamsnDOTcom
Ok, I have a car spawning command so what would happen if I leave it to 2,000 cars?
The 2000x-loop is big and it could lag server a bit because the timer is set to 1 second.

Just use your own amount (amount of vehicles you're using in your script).

OR you could search for "OnVehicleLoseHealth"-callback or something similar and use RepairVehicle(...) function in this callback.
Reply
#5

Ok, Where do I set it, because I do not see a 2,000 anywhere in the code.
Reply
#6

Quote:
Originally Posted by devteamsnDOTcom
Ok, Where do I set it, because I do not see a 2,000 anywhere in the code.
Quote:
Originally Posted by Don Correlli
Quote:
/* use you're own define for maximum amount of vehicles,
because i doubt you're using 2000 vehicles which is equal to MAX_VEHICLES define. */

for(v = 0; v < MAX_VEHICLES; v++) RepairVehicle(v);

Reply
#7

so put...
Код:
for(v = 0; v < 100; v++) RepairVehicle(v);
If I want it to be 100?
Reply
#8

Quote:
Originally Posted by devteamsnDOTcom
so put...
Код:
for(v = 0; v < 100; v++) RepairVehicle(v);
If I want it to be 100?
If you have 99 or less vehicles on the server, yes.
Reply
#9

It dont work for me?
Reply
#10

Just set the vehicles' health to 99999, no need for a timer.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)