20.02.2019, 12:15
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
this code is blocking other codes that next to it :/
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(m, sizeof(m), "You were killed by hitman. You lost -$%i.", ContractInfo[cid][c_amount]);
SendClientMessage(playerid, COLOR_YELLOW, m);
format(m, sizeof(m), "You have finished a contract of $%i. You received $%d.", ContractInfo[cid][c_amount],ContractInfo[cid][c_amount]/2);
SendClientMessage(killerid, COLOR_YELLOW, m);
GiveMoney(killerid,ContractInfo[cid][c_amount]/2);
mysql_format(dbhandle, m, sizeof(m), "UPDATE contracts SET killer='%i' WHERE id='%i'", PlayerInfo[killerid][pID],ContractInfo[cid][c_SQLID]);
mysql_tquery(dbhandle, m);
SendPlayerToHospital(playerid);
return 1;
}
}