Warnings
#1

Код:
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(37) : warning 201: redefinition of constant/macro (symbol "strcpy(%0,%1,%2)")
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(1575) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(3597) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(3636) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(3638) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(3897) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5474) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5484) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5515) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5526) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5534) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5538) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5551) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5555) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5568) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5581) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5650) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5724) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5772) : warning 217: loose indentation
C:\Users\RAFAY\Desktop\0.3x\gamemodes\COS-RP.pwn(5780) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


20 Warnings.
.
I see lots of warnings how can I fix them?
Reply
#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
#3

Line 37
pawn Код:
#define strcpy(%0,%1,%2) %0="",strcat(%0,%2,%1)
Reply
#4

Quote:
Originally Posted by Knight_Rider
Посмотреть сообщение
Brackets problem ._. show us the code
And the server can still work
Warnings doesn't matter
Everything you wrote ARE wrong.

It's not a bracket problem, it's just that you cannot indent your code normal. (See how to fix it: https://sampforum.blast.hk/showthread.php?tid=256961)
It's been asked millions times and people are too lazy even to ****** it for a second and fix it in less than a minute.

About the strcpy is already defined. Remove the error line.

Last, warnings matter and they cause problems. Whever someone runs a server, the gamemode is recommended to be compiled with 0 errors and warnings.
Reply
#5

#pragma tabsize 0
Reply
#6

Show us the code.
Reply
#7

You need to leave 4 spaces everytime you open a bracket and thing like that.. just give me the code I'll do it for you.

Quote:
Originally Posted by Knight_Rider
Посмотреть сообщение
Brackets problem ._. show us the code
And the server can still work
Warnings doesn't matter
This is just stupid..
Reply
#8

Quote:
Originally Posted by NoahF
Посмотреть сообщение
#pragma tabsize 0
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.

Quote:
Originally Posted by Rayan_black
Посмотреть сообщение
You need to leave 4 spaces everytime you open a bracket and thing like that
I hope you don't press space 4 times! and use the tab key once.
Reply
#9

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
Indentation is a basic rule at programming, not indented code is not able to be read good.
I hope you don't press space 4 times! and use the tab key once.
Ofcourse, just explaining to him.
Reply
#10

ALL ABOVE!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)