BOMB DEATH
#1

Well, I added a bomb script into my script. Now, i want if a player dies because of bomb explosive then it should says

*StoneGold (0) has died from bomb*

How can i script like this? I would be your thankful if you help me. +rep!
Reply
#2

pawn Код:
if(reason == 51)
{
    //code here
    return 1;
}
try this it checks if the player died from an explosion.
Reply
#3

PHP код:
CMD:bomb(playeridparams[])
{
   if(
pData[playerid][pRigged] ==0) return SendClientMessage(playeridRED"You have not rigged any bomb.");
   
SetTimer("carbombs",5000,false);
   return 
1;
}

forward carbombs(playerid);
public 
carbombs(playerid)
{

    new 
Float:n1=GetPVarFloat(playerid,"locx");
    new 
Float:n2=GetPVarFloat(playerid,"locy");
    new 
Float:n3=GetPVarFloat(playerid,"locz");
    new 
vs=GetPVarInt(playerid,"cbv");
    
CreateExplosion(n1,n2,n3,6,1.0);
    
SetVehicleHealth(vs,0);
    
pData[playerid][pRigged] =0;
      return 
1;
 } 
here's my codes. can u put my codes into your script and also tell me where should i add them? onplayerdeath? and do i have to put this into cmd also or what? explain more please. Thanks!
Reply
#4

Just put the code I gave you OnPlayerDeath, and use a string to get the name of the player if(reason == 51) checks the way the player has died, so I made it so it detects if the player died from an explosion.
Reply
#5

Don't you think it will be a problem? if i use /nuke or /explode cmd as admin so it doesn't say player has died from bomb? or car explosive?
Reply
#6

No it will call the reason whenever a player explodes.
Reply
#7

Well, I know it will call whatever i put in message. But i m saying. it will send same message even if player died from car explosive not even bomb or admin used /explode a player
Reply
#8

That's the only way you can check how a player died I believe.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)