Strange Warning
#1

Anyone knows why am i getting this warning ?
Код:
Z:\Scripting and Servers\MyServer\gamemodes\SRP.pwn(35043) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
pawn Код:
public OnPlayerOfflineLogin(playername[])
{
    new string2[64];
    format(string2, sizeof(string2), "users/%s.ini", playername);
    new File: UserFile = fopen(string2, io_read);
    //printf("[DEBUG] OnPlayerOfflineLogin: string2 (%s) | MAX_PLAYERS (%d)", string2, MAX_PLAYERS);
    if ( UserFile )
    {
        //print("[DEBUG] OnPlayerOfflineLogin: UserFile exists, the handle parsed.");
        new key[ 256 ] , val[ 256 ];
        new Data[ 256 ];
        //print("[DEBUG] Starting while ( fread( UserFile , Data , sizeof( Data ) ) )");
        while ( fread( UserFile , Data , sizeof( Data ) ) )
        {
 if( strcmp( key , "ATMCard" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[MAX_PLAYERS][pATMCard] = floatstr( val ); }
Error Line
pawn Код:
if( strcmp( key , "ATMCard" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[MAX_PLAYERS][pATMCard] = floatstr( val ); }
++ REP
Reply
#2

Try wrapping your code in [pawn][./pawn] tags(without the '.') so we can read it a bit better.
EDIT: Which one is line 35043?
Reply
#3

You use floatstr which converts a string to a float. If you want pATMCard to be indeed a float, then add the tag in the enum:
pawn Код:
Float: pATMCard
otherwise if it's supposed to be an integer:
pawn Код:
PlayerInfo[MAX_PLAYERS][pATMCard] = strval( val );
Reply
#4

Quote:
Originally Posted by Drago987
Посмотреть сообщение
Error Line
pawn Код:
if( strcmp( key , "ATMCard" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[MAX_PLAYERS][pATMCard] = floatstr( val ); }
++ REP
This
Reply
#5

pawn Код:
//printf("[DEBUG] OnPlayerOfflineLogin: string2 (%s) | MAX_PLAYERS (%d)", string2, MAX_PLAYERS);
I know you commented this out, but there's no need to format macros. Just use "MAX_PLAYERS":

pawn Код:
printf("[DEBUG] OnPlayerOfflineLogin: string2 (%s) | MAX_PLAYERS ("MAX_PLAYERS")", string2);
Reply
#6

now i got this
Код:
Z:\Scripting and Servers\Shock Roleplay 0.3z\gamemodes\SRP.pwn(6193) : error 021: symbol already defined: "pATMCard"
Z:\Scripting and Servers\Shock Roleplay 0.3z\gamemodes\SRP.pwn(35044) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

The solution is already there but you seem to ignored me. Anyways, here it is:
pawn Код:
PlayerInfo[MAX_PLAYERS][pATMCard] = strval( val );
since ini_GetValue returns an integer.
Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The solution is already there but you seem to ignored me. Anyways, here it is:
pawn Код:
PlayerInfo[MAX_PLAYERS][pATMCard] = strval( val );
since ini_GetValue returns an integer.
Thanks Man,it worked
Quote:
Originally Posted by Konstantions
Посмотреть сообщение
The solution is already there but you seem to ignored me
Actually i didn't see it at first ,Lol x'D
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)