Saves points but resets after reconnect/spawn
#6

As SOON as i /login password my score goes to 0.
Any Ideas?

Код:
CMD:login( playerid, params[ ] )
{
    new file[ 256 ], Passw[ 500 ]; format( file, sizeof file, DIRECTORY, pName( playerid ) );
    INI_ParseFile(file, "Pass", false, true, playerid);
    GetPVarString( playerid, "pPass", Passw, sizeof Passw );
	if( GetPVarInt( playerid, "pLog" ) == 1 ) return SystemMsg( playerid, "You have already logged-in." );
	if( !INI_Exist ( pName( playerid ) ) ) return SystemMsg( playerid, "This name is not registered. /register password for free $150,000!" );
	if( isnull ( params ) ) return SystemMsg( playerid, "Usage: /login [password]" );
	if( strcmp ( Passw, params, false ) == 0 )
	{
		GivePlayerMoney( playerid, GetPVarInt( playerid, "pCash" ) );
		SetPVarInt( playerid, "pLog", 1 );
		SystemMsg( playerid, "You have successfully logged-in." );
		SetPlayerScore( playerid, GetPVarInt( playerid, "pScore" ) );
	}else SystemMsg( playerid, "Wrong Credentials!" );
	return ( 1 );
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)