Please Help me.
#1

Please help me when i am compiling my script it is generating an error.Here is the error (
Quote:

C:\Users\Steve\Downloads\nG.pwn(2332) : warning 219: local variable "PlayerName" shadows a variable at a preceding level

)

CODE:

Quote:

stock PlayerConnect(playerid)
{
new tmp3[50],PlayerName[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME) ;
GetPlayerIp(playerid,tmp3,50);
if(strlen(dini_Get("records.cfg", tmp3)) == 0)
dini_Set("records.cfg", tmp3, PlayerName);
else
{
if( strfind( dini_Get("records.cfg", tmp3), PlayerName, true) == -1 )
{
format(string,sizeof(string),"%s,%s", dini_Get("records.cfg",tmp3), PlayerName);
dini_Set("records.cfg", tmp3, string);
}
}
new File: file = fopen("accounts.cfg", io_append);
format(string,sizeof(string),"%s\r\n",PlayerName);
fwrite(file,string);
fclose(file);
return 1;
}

Please Help me out i cant find the problem
Reply
#2

Hey Try this one

PHP код:
    stock PlayerConnect(playerid)
    {
            new 
tmp3[50],plName[MAX_PLAYER_NAME],string[128];
            
GetPlayerName(playerid,plName,MAX_PLAYER_NAME) ;
            
GetPlayerIp(playerid,tmp3,50);
            if(
strlen(dini_Get("records.cfg"tmp3)) == 0)
            
dini_Set("records.cfg"tmp3plName);
            else
        {
    
        {
            
format(string,sizeof(string),"%s,%s"dini_Get("records.cfg",tmp3), plName);
            
dini_Set("records.cfg"tmp3string);
        }
        }
            new 
Filefile fopen("accounts.cfg"io_append);
            
format(string,sizeof(string),"%s\r\n",plName);
            
fwrite(file,string);
            
fclose(file);
            return 
1;
    } 
the warning means you've already have PlayerName
Reply
#3

It worked!! Thanks bro.
Reply
#4

better you use this
Код:
PlayerConnect(playerid)
on login dialog
because it loads how many players joined and with how many accounts with how many ips

gl
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)