Originally Posted by Knight_Rider
Indentation is a basic rule at programming, not indented code is not able to be read good.
What you suggest him actually is do it like that:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) { if(issuerid != INVALID_PLAYER_ID) { new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME]; new weaponname[24]; GetPlayerName(playerid, victim, sizeof (victim)); GetPlayerName(issuerid, attacker, sizeof (attacker)); GetWeaponName(weaponid, weaponname, sizeof (weaponname)); format(string, sizeof(string), "%s has made %.0f damage to %s, weapon: %s", attacker, amount, victim, weaponname); SendClientMessageToAll(0xFFFFFFFF, string); } return 1; }
Instead of:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) { if(issuerid != INVALID_PLAYER_ID) { new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME]; new weaponname[24]; GetPlayerName(playerid, victim, sizeof (victim)); GetPlayerName(issuerid, attacker, sizeof (attacker)); GetWeaponName(weaponid, weaponname, sizeof (weaponname)); format(string, sizeof(string), "%s has made %.0f damage to %s, weapon: %s", attacker, amount, victim, weaponname); SendClientMessageToAll(0xFFFFFFFF, string); } return 1; }
I don't know about you, but I'd prefer the second one.
I hope you don't press space 4 times!  and use the tab key once.
|