OnPlayerDeath function not being called
#9

Quote:
Originally Posted by TheToretto
View Post
Which one is first?
OnPlayerDeath now looks like
PHP Code:
public OnPlayerDeath(playeridkilleridreason)
{
    print(
"Ok");
    if(
GroupInfo[PlayerInfo[killerid][pGroup]][gType]==GROUP_TYPE_HITMAN){
        new 
cid,m[512];
        if(
IsPlayerInContract(playerid)){
            
cid GetPlayerContractID(playerid);
            
ContractInfo[cid][c_killer] = PlayerInfo[killerid][pID];
            
GiveMoney(playerid,-ContractInfo[cid][c_amount]);
            
format(msizeof(m), "You were killed by hitman. You lost -$%i."ContractInfo[cid][c_amount]);
            
SendClientMessage(playeridCOLOR_YELLOWm);
            
format(msizeof(m), "You have finished a contract of $%i. You received $%d."ContractInfo[cid][c_amount],ContractInfo[cid][c_amount]/2);
            
SendClientMessage(killeridCOLOR_YELLOWm);
            
GiveMoney(killerid,ContractInfo[cid][c_amount]/2);
            
mysql_format(dbhandlemsizeof(m), "UPDATE contracts SET killer='%i' WHERE id='%i'"PlayerInfo[killerid][pID],ContractInfo[cid][c_SQLID]);
            
mysql_tquery(dbhandlem);
            
SendPlayerToHospital(playerid);
            return 
1;
        }
    }
    if (
PlayerInfo[playerid][pInjured] == 0){
        
SendClientMessage(playerid, -1"Reached");
        
PlayerInfo[playerid][pInjured] = 1;
        
GetPlayerPos(playeridinj_x,inj_y,inj_z);
        
GetPlayerFacingAngle(playeridinjured_angle);
    }
    else if (
PlayerInfo[playerid][pInjured] == 1)
    {
        
KillTimer(AcceptDeathTimer[playerid]);
        
KillTimer(LoseHealthTimer[playerid]);
        
AcceptDeath[playerid] = 0;
        
PlayerInfo[playerid][pInjured] = 0;
        
Hospitalized[playerid] = 1;
    }
    return 
1;

Reply


Messages In This Thread
OnPlayerDeath function not being called - by akib - 20.02.2019, 01:22
Re: OnPlayerDeath function not being called - by xSkin - 20.02.2019, 03:31
Re: OnPlayerDeath function not being called - by akib - 20.02.2019, 04:48
Re: OnPlayerDeath function not being called - by TheToretto - 20.02.2019, 06:16
Re: OnPlayerDeath function not being called - by akib - 20.02.2019, 11:03
Re: OnPlayerDeath function not being called - by TheToretto - 20.02.2019, 12:01
Re: OnPlayerDeath function not being called - by akib - 20.02.2019, 12:15
Re: OnPlayerDeath function not being called - by TheToretto - 20.02.2019, 12:31
Re: OnPlayerDeath function not being called - by akib - 20.02.2019, 12:37
Re: OnPlayerDeath function not being called - by Calisthenics - 20.02.2019, 12:50

Forum Jump:


Users browsing this thread: 4 Guest(s)