30.07.2011, 14:51
Quote:
How I can do something like this:
[pawn] new oldHealth,NewHealth; SendClientMessageToAll(BLUE, %s changed his health from %d to %d",oldHealth,NewHealth); return 1; [pawn] |
pawn Код:
//OnPlayerUpdate
static
Float: cHealth,
Float: pHealth[MAX_PLAYERS];
GetPlayerHealth(playerid, cHealth);
if(cHealth != pHealth[playerid]) {
OnPlayerHealthChange(playerid, pHealth[playerid], cHealth);
pHealth[playerid] = cHealth;
}
pawn Код:
OnPlayerHealthChange(playerid, Float: oldhealth, Float: newhealth) {
new tmp[128];
GetPlayerName(playerid, tmp, MAX_PLAYER_NAME);
format(tmp, sizeof tmp, "%s changed his health from %.0f to %.0f", oldhealth, newhealth);
SendClientMessageToAll(BLUE, tmp);
}