Carbomb system help.
#1

I've made a carbomb system, it works fine but the issue is whenever the player dies through carbomb. The death reason is explosion, how do I show the death reason as carbomb and show the killer ID as the player who bombed him?
Reply
#2

pawn Код:
//OnPlayerDeath
if(killerid == INVALID_PLAYER_ID)
{
    if(reason == 51) // explosion
    {
        //format(str,sizeof(str),"%d died from a carbomb set off by %d", playerid, carbomber[vehicleid]);
        //SendClientMessageToAll(-1, str);
        return 1;
    }
}
something like that i suppose, depending how u implemented the carbomb system u need to save the player id who set it


u probably cant use GetPlayerVehicleID when the player has died already so maybe set it every time he enters a vehicle
Reply
#3

Quote:
Originally Posted by jamesbond007
Посмотреть сообщение
pawn Код:
//OnPlayerDeath
if(killerid == INVALID_PLAYER_ID)
{
    if(reason == 51) // explosion
    {
        //format(str,sizeof(str),"%d died from a carbomb set off by %d", playerid, carbomber[vehicleid]);
        //SendClientMessageToAll(-1, str);
        return 1;
    }
}
something like that i suppose, depending how u implemented the carbomb system u need to save the player id who set it


u probably cant use GetVehicleID when the player has died already so maybe set it every time he enters a vehicle
I don't think that's he wants and when you die by explosion in a car the reason is ID 54 (tested).

Anyway, you need to stock the playerid who planted the bomb in the vehicle.
PHP код:
    if(killerid == INVALID_PLAYER_ID)
    {
        if(
reason == 54// explosion
        
{
            
SendDeathMessage(playerPlantedBombplayerid51);
            return 
1;
        }
    } 
This is working for 1 bomb.
Reply
#4

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
I don't think that's he wants and when you die by explosion in a car the reason is ID 54 (tested).

Anyway, you need to stock the playerid who planted the bomb in the vehicle.
PHP код:
    if(killerid == INVALID_PLAYER_ID)
    {
        if(
reason == 54// explosion
        
{
            
SendDeathMessage(playerPlantedBombplayerid51);
            return 
1;
        }
    } 
This is working for 1 bomb.
well i just looked it up on wiki .. https://sampwiki.blast.hk/wiki/Weapons

says explosion is 51 .. either its a typo or something is wrong
Reply
#5

Its easy.

PHP код:
//OnPlayerDeath 
if(killerid != INVALID_PLAYER_ID)
{
    if(
reason == 51// explosion
    
{
        if(
/*use a variable that stores the vehicle id that is bombed*/)
        {
            if(
/*use a variable to detect the person who attached the car bomb*/)
            {
                
//format the message
                //send it
                //etc stuff below and beyond 
            
}
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)