14.08.2014, 19:41
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted
{
new
weaponName[24],
victimName[MAX_PLAYER_NAME],
attackerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, victimName, sizeof (victimName));
GetPlayerName(issuerid, attackerName, sizeof (attackerName));
GetWeaponName(weaponid, weaponName, sizeof (weaponName));
if (IsHurt[playerid] == 0)
{
new string[64];
format(string,sizeof(string),"(( Has been injured %f , Weapon: %s ))", amount, weaponName);
new Text3D:wounded;
wounded = Create3DTextLabel(string, 0xAA3333AA, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(wounded, playerid, 0.0, 0.0, 0.7);
Update3DTextLabelText(wounded, 0xAA3333AA, string);
}
}
return 1;
}
It compiles without any erros or anything. But when I shot him once, it says " (( Has been injured 46.0000 times )) " But I want when I shoot him once, to says " (( Has been injured 1 time )). Please help!
{
if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted
{
new
weaponName[24],
victimName[MAX_PLAYER_NAME],
attackerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, victimName, sizeof (victimName));
GetPlayerName(issuerid, attackerName, sizeof (attackerName));
GetWeaponName(weaponid, weaponName, sizeof (weaponName));
if (IsHurt[playerid] == 0)
{
new string[64];
format(string,sizeof(string),"(( Has been injured %f , Weapon: %s ))", amount, weaponName);
new Text3D:wounded;
wounded = Create3DTextLabel(string, 0xAA3333AA, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(wounded, playerid, 0.0, 0.0, 0.7);
Update3DTextLabelText(wounded, 0xAA3333AA, string);
}
}
return 1;
}
It compiles without any erros or anything. But when I shot him once, it says " (( Has been injured 46.0000 times )) " But I want when I shoot him once, to says " (( Has been injured 1 time )). Please help!