Posts: 100
Threads: 18
Joined: Oct 2015
Reputation:
0
hey hey,
on my server i got a small army base in LS, to make it more realistic and more logical i want to make some vehicles (Rhino, Hunter, Hydra etc.) spawn with an amount of health that's not the default 1.000, like a Rhino will spawn with 10.000 health. Any ideas how this is possible?
Posts: 1,208
Threads: 36
Joined: Apr 2015
PHP код:
public OnVehicleSpawn(vehicleid){
new vehm = GetVehicleModel(vehicleid);
if(vehm == 520 || vehm == 432 || vehm == 425){
SetVehicleHealth(vehicleid, 10000.0);
}
return 1;
}
Posts: 100
Threads: 18
Joined: Oct 2015
Reputation:
0
Will that also work with vehicles that are spawned under OnGamemodeInit?
Posts: 1,208
Threads: 36
Joined: Apr 2015
maybe
add under vehicles
PHP код:
public OnGameModeInit(){
//code
for(new i = 0; i <= MAX_VEHICLES; i++){
if(IsValidVehicle(i)){
new vehm = GetVehicleModel(i);
if(vehm == 520 || vehm == 432 || vehm == 425){
SetVehicleHealth(i, 10000.0);
}
}
}
return 1;
}
Posts: 100
Threads: 18
Joined: Oct 2015
Reputation:
0
I will try this when I am home, I think you can replace SetVehicleHealth wilth other things also (like AddVehicleComponent), so I can make a sultan spawn tuned?
Posts: 1,208
Threads: 36
Joined: Apr 2015
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
OnVehicleSpawn is called when vehicles REspawn, not the first spawn. You'll need to hook CreateVehicle/AddStaticVehicle(Ex).
Posts: 1,208
Threads: 36
Joined: Apr 2015
Quote:
Originally Posted by MP2
OnVehicleSpawn is called when vehicles REspawn, not the first spawn. You'll need to hook CreateVehicle/AddStaticVehicle(Ex).
|
already I gave what to do
hook is unnecessary
Posts: 100
Threads: 18
Joined: Oct 2015
Reputation:
0
"error 017: undefined symbol "IsValidVehicle""
any idea?