CreateExplosionEx
#1

Hi,
I'm trying to use the following code in order to ensure a player's death in the explosion.
Код:
CreateExplosionEx(playerid, x,y,z, 1, 250.0);
Previously I used CreateExplosion and it didn't kill the player, it decreased his health to approx 20HP.
I tried using the explosion include where I can edit the damage(250.0 is the damage parameter) but it doesnt decrease health at all.

What seems to be the problem? Thanks.
Reply
#2

idk the problem but I made an system to make the player get the damage u specified
it is this
PHP код:
stock CreateExplosionEx(playeridFloat:xFloat:yFloat:ztypFloat:radFloat:h)
{
     
CreateExplosion(xyztyprad);
     new 
Float:ph;
    
GetPlayerHealth(playeridph);
    
ph ph h;
    
SetPlayerHealth(playeridph);

Float:h is the how much health u want to take from the player set it to 100 if u want to kill him in game it will be like an real explosion it wont be like it is scripter
I updated it a bit for u so u don't need to put the coordinates u just put the playerid type radius and the taken health
PHP код:
stock CreateExplosionEx(playeridtypFloat:radFloat:h)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
     
CreateExplosion(xyztyprad);
     new 
Float:ph;
    
GetPlayerHealth(playeridph);
    
ph ph h;
    
SetPlayerHealth(playeridph);

PS: the radius is how much the spread of the explosion should be
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)