30.12.2016, 12:15
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) //erro function heading differs from prototype
{
new animlib[32], animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, 32, animname, 32);
if(pInfo[playerid][pQuebrado] == 0) // Checa se o jogador nao estiver com a perna quebrada
{
if(amount > 15 && strcmp("FALL_FALL", animname, true) == 0) // Quando cai de uma certa altura
{
if(pInfo[playerid][pQuebrado] == 0)
{
pInfo[playerid][pQuebrado] = 1;
GameTextForPlayer(playerid, "~w~Broken Leg!", 1500, 3);
PlayerTextDrawShow(playerid, BrokenL[playerid]);
}
}
if(issuerid != INVALID_PLAYER_ID && weaponid != 0) // Quando leva tiro na perna
{
if(amount > 20)
{
if(pInfo[playerid][pSangrando] == 0)
{
pInfo[playerid][pSangrando] = 1;
SangueTimer[playerid] = SetTimerEx("Sangrar", 10000, true, "d", playerid);
PlayerTextDrawShow(playerid, Bleed[playerid]);
}
}
if(weaponid == 34 && bodypart == 9)
{
if(pInfo[playerid][pTemCapacete] == 1)
{
GameTextForPlayer(issuerid, "~y~Player Using Helmet!", 2000, 3);
GameTextForPlayer(playerid, "~g~Helmet Protected You!", 2000, 3);
}
else
{
SetPlayerHealth(playerid, 0);
GameTextForPlayer(issuerid, "~r~Headshot!", 2000, 3);
}
}
if(bodypart == 7 || bodypart == 8)
{
if(pInfo[playerid][pQuebrado] == 0) // Checa se o jogador n ta com a perna quebrada
{
pInfo[playerid][pQuebrado] = 1;
GameTextForPlayer(playerid, "~w~Broken Leg!", 1500, 3);
PlayerTextDrawShow(playerid, BrokenL[playerid]);
}
}
}
}
return 1;
}