17.09.2016, 16:47
pawn Код:
for(new x = 0; x<= MAX_PLAYERS; x++)
pawn Код:
for(new x = 0; x < MAX_PLAYERS; x++)
2.
pawn Код:
if(playerdeath[playerid] == 0)
{
new Float:HP, Float:AP, Float:remainHP;
GetPlayerHealthEx(playerid,HP);
GetPlayerArmourEx(playerid,AP);
if ( AP >= amount )
{
SetPlayerArmourEx( playerid, AP - amount );
SetPlayerHealthEx( playerid, HP );
}
else if ( AP <= 0 )
{
remainHP = HP - amount;
SetPlayerHealthEx( playerid, remainHP );
if ( remainHP <= 0 && playerdeath[playerid] == 0 )
{
OnPlayerDeath( playerid, issuerid, weaponid );
playerdeath[playerid] = 1;
}
}
else
{
remainHP = HP + ( AP - amount );
SetPlayerArmourEx( playerid, 0.0 );
SetPlayerHealthEx( playerid, remainHP );
if ( remainHP <= 0 && playerdeath[playerid] == 0 )
{
OnPlayerDeath( playerid, issuerid, weaponid );
playerdeath[playerid] = 1;
}
}
}
pawn Код:
if(issuerid != INVALID_PLAYER_ID)
pawn Код:
OnPlayerDeath( playerid, issuerid, weaponid );