[HELP] Car Explosion -
Frankox - 07.07.2009
I have one little problem...
It doesnt show errors or warnings when i press F5, but there is nothing happening...
I wanted it to be like when the car has less then 30 hp that then the car explodes but i wanted the explosion to be very very strong.
So can u help pls?
MSN:
franko.opacak@windowslive.com
public OnVehicleSpawn(vehicleid)
{
new Float
cx, Float
cy, Float
cz;
new Float:abcd;
GetVehicleHealth(vehicleid, abcd);
if(abcd > 30.0)
GetVehiclePos(vehicleid,scx, scy, scz);
CreateExplosion(scx+1,scy+1,scz+1,6,100);
return 1;
}
Re: [HELP] Car Explosion -
Finn - 07.07.2009
You're using
OnVehicleSpawn callback, which means that it's called when the vehicle is spawned and when the vehicle is spawned it surely doesn't have 30.0 health.
You need to use a timer that checks the vehicle's health every second or so, and if the health is under 30.0, make the explosion. Use
SA-MP wiki to get help with timers.
Re: [HELP] Car Explosion -
Frankox - 07.07.2009
Quote:
Originally Posted by Finn
You're using OnVehicleSpawn callback, which means that it's called when the vehicle is spawned and when the vehicle is spawned it surely doesn't have 30.0 health.
You need to use a timer that checks the vehicle's health every second or so, and if the health is under 30.0, make the explosion. Use SA-MP wiki to get help with timers.
|
Kk tnx i already thought that the problem was cuz i wrote the script OnVehicleSpawn jsut wasnt sure...
Re: [HELP] Car Explosion -
Frankox - 07.07.2009
forward CarExplosion(vehicleid);
public OnGameModeInit()
SetTimer("CarExplosion",1000,1);
public CarExplosion(vehicleid)
{
new Float
cx, Float
cy, Float
cz;
new Float:abcd;
GetVehicleHealth(vehicleid, abcd);
if(abcd > 30.0)
GetVehiclePos(vehicleid,scx, scy, scz);
CreateExplosion(scx+1,scy+1,scz+1,6,100);
return 1;
}
Doesnt work, how?
Re: [HELP] Car Explosion -
happyface - 07.07.2009
Quote:
Originally Posted by Frankox
Doesnt work, how?
|
try
pawn Код:
public OnGameModeInit()
{
SetTimer("VehicleHealth",1000, 1);
return 1;
}
pawn Код:
public VehicleHealth()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
new vehicleid = GetPlayerVehicleID(i);
new Float:vhealth = GetVehicleHealth(vehicleid, vhealth);
if(vhealth <= 30)
{
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
SetVehicleHealth(vehicleid, 0);
CreateExplosion(x, y, z, 6, 10.0);
}
}
return 1;
}
Re: [HELP] Car Explosion -
Frankox - 07.07.2009
K, i'll try it.
Ty
Re: [HELP] Car Explosion -
happyface - 07.07.2009
Quote:
Originally Posted by Frankox
K, i'll try it.
Ty
|
i noticed some problems, so i just updated the code above
Re: [HELP] Car Explosion -
Frankox - 07.07.2009
Quote:
Originally Posted by happyface
Quote:
Originally Posted by Frankox
K, i'll try it.
Ty
|
i noticed some problems, so i just updated the code above
|
K, im going to test it...
Re: [HELP] Car Explosion -
Frankox - 08.07.2009
Quote:
Originally Posted by Frankox
Quote:
Originally Posted by happyface
Quote:
Originally Posted by Frankox
K, i'll try it.
Ty
|
i noticed some problems, so i just updated the code above
|
K, im going to test it...
|
Well... Again a problem. Doesnt show warning or error but i dont see the difference between explosions.
The explosion is the same as it was before.
Re: [HELP] Car Explosion -
happyface - 08.07.2009
i used the same explosion id that you used, maybe i misunderstood the problem. your just looking for a bigger explosion?