01.06.2013, 11:16
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:
Instead of:
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.
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;
}
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;
}
Quote:
You need to leave 4 spaces everytime you open a bracket and thing like that
|
