Strange Warning - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Strange Warning (
/showthread.php?tid=503073)
Strange Warning -
Drago987 - 27.03.2014
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
Re: Strange Warning -
Zeppo - 27.03.2014
Try wrapping your code in [pawn][./pawn] tags(without the '.') so we can read it a bit better.
EDIT: Which one is line 35043?
Re: Strange Warning -
Konstantinos - 27.03.2014
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:
otherwise if it's supposed to be an integer:
pawn Код:
PlayerInfo[MAX_PLAYERS][pATMCard] = strval( val );
Re: Strange Warning -
Drago987 - 27.03.2014
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
Re: Strange Warning -
Corekt - 27.03.2014
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);
Re: Strange Warning -
Drago987 - 27.03.2014
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.
Re: Strange Warning -
Konstantinos - 27.03.2014
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.
Re: Strange Warning -
Drago987 - 27.03.2014
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