Thist isnt working correctly -.-
#1

ok i have this code under public ONVEHICLESPAWN

pawn Код:
if(GetVehicleModel(vehicleid) == 596 || GetVehicleModel(vehicleid) == 597 || GetVehicleModel(vehicleid) == 598) SetVehicleHealth(vehicleid,1500.0);

    if(GetVehicleModel(vehicleid) == 407 || GetVehicleModel(vehicleid) == 470) SetVehicleHealth(vehicleid,2000.0);

    if(GetVehicleModel(vehicleid) == 428 || GetVehicleModel(vehicleid) == 433 || (vehicleid) == 482) SetVehicleHealth(vehicleid,3000.0);

    if(GetVehicleModel(vehicleid) == 601 || GetVehicleModel(vehicleid) == 528) SetVehicleHealth(vehicleid,4000.0);

    if(GetVehicleModel(vehicleid) == 432) SetVehicleHealth(vehicleid,5000.0);
what i want it to do every vehicle in the server with thos ID's have their set HP but once i restart the server and go into it i have to /respawncars 50000 to make the HP the correct amounts please help
Reply
#2

Here's the sugesstions(I once experienced this when I wanted to count how many cars are in my server),just take a for that goes from i=1 to MAX_VEHICLES,and apply the code in OnGameModeInit,better said add this to OnGameModeInit:

pawn Код:
for(new vehicleid=0;vehicleid<MAX_VEHICLES;vehicleid++)
{
   if(GetVehicleModel(vehicleid) == 596 || GetVehicleModel(vehicleid) == 597 || GetVehicleModel(vehicleid) == 598) SetVehicleHealth(vehicleid,1500.0);
    if(GetVehicleModel(vehicleid) == 407 || GetVehicleModel(vehicleid) == 470) SetVehicleHealth(vehicleid,2000.0);
    if(GetVehicleModel(vehicleid) == 428 || GetVehicleModel(vehicleid) == 433 || (vehicleid) == 482) SetVehicleHealth(vehicleid,3000.0);
    if(GetVehicleModel(vehicleid) == 601 || GetVehicleModel(vehicleid) == 528) SetVehicleHealth(vehicleid,4000.0);
    if(GetVehicleModel(vehicleid) == 432) SetVehicleHealth(vehicleid,5000.0);
}
That will do it,even if you restart.
Reply
#3

nope still dont work i got IG spawn a vehicle ID 432 and its only got 1000 hp please help
Reply
#4

Leave it both on OnVehicleSpawn,but if you want it to apply it hwen you restart also leave it on OnGameModeInit
Reply
#5

but even if i leve it on both the vehicles dont spawn this the 5k hp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)