SA-MP Forums Archive
[HELP] 3 error (Zh3ro register system) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] 3 error (Zh3ro register system) (/showthread.php?tid=233290)



[HELP] 3 error (Zh3ro register system) - buzifej - 01.03.2011

Код:
public OnPlayerConnect(playerid)
{
        if ( !INI_Exist( pName( playerid ) ) )
               ShowPlayerDialog( playerid, DIALOG_REG_REQ, DIALOG_STYLE_MSGBOX, "{FFFFFF}Password", "{FFFFFF}To play you must register an account!", "Ok", "");
       else

		
			
					SetPVarInt( playerid, "Logged", 1 );
					format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
	        	    INI_ParseFile( PlayerFile, "LoadUser", false, true, playerid, true, false );



                

        return 1;
}
Error's:
undefined symbol "PlayerFile"
error 017: undefined symbol "PlayerFile"
error 017: undefined symbol "PlayerFile"


Re: [HELP] 3 error (Zh3ro register system) - legodude - 01.03.2011

lol that indentation sucks

at top of script
new File:PlayerFile;


Re: [HELP] 3 error (Zh3ro register system) - buzifej - 01.03.2011

again 3 error

error 035: argument type mismatch (argument 1)
error 035: argument type mismatch (argument 1)


Re: [HELP] 3 error (Zh3ro register system) - HyperZ - 01.03.2011

Under OnPlayerConnect:
pawn Код:
new PlayerFile[13 + MAX_PLAYER_NAME];



Re: [HELP] 3 error (Zh3ro register system) - buzifej - 01.03.2011

Ok

2 Error:
(919): error 029: invalid expression, assumed zero
(924) : error 001: expected token: ";", but found "-identifier


Код:
public OnPlayerConnect(playerid )
{				new PlayerFile[13 + MAX_PLAYER_NAME];
	            

        if ( !INI_Exist( pName( playerid ) ) )

		

				//The player joined the server automatic register and create file
				format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );



				new
					INI:PlayerAcc = INI_Open( PlayerFile );

                INI_WriteString( PlayerAcc, "NAME",				  pName( playerid )	   );
			 
				INI_WriteInt( PlayerAcc,    "SCORE",              15                   );
				INI_WriteInt( PlayerAcc,    "KILLS",              0                    );
			
				INI_WriteInt( PlayerAcc,    "MY_SKIN",            0                    );
				INI_WriteInt( PlayerAcc,    "MY_TIME",            12                   );
				INI_WriteInt( PlayerAcc,    "MY_WEATHER",         1                    );

				INI_Close( PlayerAcc );





	   else

		
			
				
					format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
	        	    INI_ParseFile( PlayerFile, "LoadUser", false, true, playerid, true, false );
					SetPVarInt( playerid, "Logged", 1 );


                

        return 1;
}



Re: [HELP] 3 error (Zh3ro register system) - Mike Garber - 01.03.2011

Dude ima report you for domestic abuse if you don't stop throwing around your code like that..


Re: [HELP] 3 error (Zh3ro register system) - HyperZ - 01.03.2011

pawn Код:
public OnPlayerConnect(playerid)
{
    new PlayerFile[13 + MAX_PLAYER_NAME];
    if ( !INI_Exist( pName( playerid ) ) )
    {
        //The player joined the server automatic register and create file
        format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
        new
            INI:PlayerAcc = INI_Open( PlayerFile );
        INI_WriteString( PlayerAcc, "NAME",               pName( playerid )    );
        INI_WriteInt( PlayerAcc,    "SCORE",              15                   );
        INI_WriteInt( PlayerAcc,    "KILLS",              0                    );
        INI_WriteInt( PlayerAcc,    "MY_SKIN",            0                    );
        INI_WriteInt( PlayerAcc,    "MY_TIME",            12                   );
        INI_WriteInt( PlayerAcc,    "MY_WEATHER",         1                    );
        INI_Close( PlayerAcc );
    }
    else
    {
        format( PlayerFile , sizeof PlayerFile, "Accounts/%s.ini", Encode( pName( playerid ) ) );
        INI_ParseFile( PlayerFile, "LoadUser", false, true, playerid, true, false );
        SetPVarInt( playerid, "Logged", 1 );
    }
    return 1;
}
Edit: Not Tested.