18.10.2013, 07:52
Tem que fazer uma correзгo. Nisto
pawn Код:
new killedBY[MAX_PLAYERS] = {-1, ...};
public OnPlayerConnect(playerid)
{
killedBY[playerid] = -1;
// resto do cуdigo da sua OnPlayerConnect
}
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
new Float:Life, Float:Coleete, Float:Dano;
GetPlayerArmour(damagedid, Coleete);
GetPlayerHealth(damagedid, Life);
if(Coleete > 0)
{
if(amount > Coleete)
{
Dano = amount - Coleete;
Life = Life - Dano;
SetPlayerArmour(damagedid, 0.0);
SetPlayerHealth(damagedid, Life);
return 1;
}
Coleete = Coleete - amount;
SetPlayerArmour(damagedid, Coleete);
}
if(Coleete < 1)
{
Life = Life - amount;
SetPlayerHealth(damagedid, Life);
if(Life < 0.0) {
killedBY[damageid] = playerid;
}
}
return 1;
}
public OnPlayerDeath(playerid,killerid, reason) {
if(!IsPlayerConnected(killerid) && IsPlayerConnected(killedBY[playerid]))
killerid = killedBY[playerid], killedBY[playerid] = -1;
// resto do cуdigo da sua onplayerdeath
}