OnPlayerDeath function not being called
#7

I have a part of my script as a include file, called groups.inc

In groups.inc, I used y_hooks, something like that Hook:gs_OnPlayerDeath(playerid,killerid,reason)

inside that i placed this code
PHP Code:
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;
        }
    } 
this code is blocking other codes that next to it :/
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: 3 Guest(s)