Global vehicles health
#1

Hello,here is my problem.

I want to set the hp of every vehicle to 980,so i used this:

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    SetVehicleHealth(vehicleid, 980.0);
    return 1;
}
But when the vehicles spawns,they have everytime 1000 hp.How to fix this?
Reply
#2

PHP код:
public OnPlayerEnterVehicle(vehicleid,playerid//this maybe wrong one i didn't script for a month from now so
{
    
SetVehicleHealth(vehicleid980.0);
    return 
1;

Reply
#3

Wrong,but thanks for the help.
Reply
#4

OnVehicleSpawn is called when a vehicle respawns. If you want OnVehicleCreate, you can use this: https://sampforum.blast.hk/showthread.php?tid=348044
Reply
#5

nvm i wasn't reading it properly
Reply
#6

pawn Код:
forward SetVehicleHealthEx(vehicleid,Float:vHealth);
public SetVehicleHealthEx(vehicleid,Float:vHealth)
    return SetVehicleHealth(vehicleid,vHealth);
   

public OnVehicleSpawn(vehicleid)
{
    SetTimerEx("SetVehicleHealthEx",500,false,"df",vehicleid,980.0);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)