Warnings
#2

Quote:
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.
Reply


Messages In This Thread
Warnings - by Dare Devil..... - 01.06.2013, 10:43
Re: Warnings - by Knight_Rider - 01.06.2013, 10:45
Re: Warnings - by Dare Devil..... - 01.06.2013, 10:49
Re: Warnings - by Konstantinos - 01.06.2013, 10:55
Re: Warnings - by NoahF - 01.06.2013, 11:06
Re: Warnings - by OpticKiller - 01.06.2013, 11:09
Re: Warnings - by Rayan_black - 01.06.2013, 11:12
Re: Warnings - by Konstantinos - 01.06.2013, 11:16
Re: Warnings - by Rayan_black - 01.06.2013, 11:18
Re: Warnings - by Knight_Rider - 01.06.2013, 11:36

Forum Jump:


Users browsing this thread: 3 Guest(s)