SA-MP Forums Archive
Need little help - 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: Need little help (/showthread.php?tid=323489)



Need little help - Rock1 - 05.03.2012

Hello. I'll be direct.

I need and example of how to make a level system based on experience(points)
example: if a player reached X amount of experience he goes to another level and so on.

I just need a little example.

I'll just give you another example:
Convoy Trucking(not advertising) have a thing like this..if you reach 100 truck missions you go from "Rookie Trucker" to "Respected Trucker", i hope you know what i mean..


Re: Need little help - new121 - 05.03.2012

What is your saving system? and can you show us your variables being used to save the player info?


Re: Need little help - Rock1 - 05.03.2012

I use BUD[ Blazing User Database ] by Slice.

It is not needed, i just wanna know how to do it, just show me an example with any variables, i can change them later..


Re: Need little help - new121 - 05.03.2012

Just make it so each delivery he gains X amount of expirience then make a repeating timer that checks if a player has enough expirience and if he does then it increases his level by one.


Re: Need little help - Rock1 - 06.03.2012

I made this:
Код:
new  Bit1: AdvancedDrifter <MAX_PLAYERS>,
	Bit1: ProDrifter <MAX_PLAYERS>,
	Bit1: MasterDrifter <MAX_PLAYERS>,
	Bit1: DriftKing <MAX_PLAYERS>;

public OnPlayerUpdate(playerid)
{
   	if( Bit1_Get( AdvancedDrifter, playerid ) == 0 )
	{
		if( Bit16_Get( TotalScore, playerid ) > 1000 )
		{
	 		SetPlayerDriftTitle( "Advanced Drifter");
	 		if( rText_Viewing( playerid ) )
    		rText_Update( playerid, "~w~Congratulations! You have more than 50.000 Drift Points and you gain a new rank ~r~Advanced Drifter!", true, 5 );
			else
    		rText_Show( playerid, "~w~Congratulations! You have more than 50.000 Drift Points and you gain a new rank ~r~Advanced Drifter!", 5);
	    	Bit1_Set( AdvancedDrifter , playerid, 1 );
		}
	}
	if( Bit1_Get( ProDrifter, playerid ) == 0 )
	{
		if( Bit16_Get( TotalScore, playerid ) > 100000 )
		{
	 		SetPlayerDriftTitle( "Pro Drifter");
	 		if( rText_Viewing( playerid ) )
    		rText_Update( playerid, "~w~Congratulations! You have more than 50.000 Drift Points and you gain a new rank ~r~Pro Drifter!", true, 5 );
			else
    		rText_Show( playerid, "~w~Congratulations! You have more than 50.000 Drift Points and you gain a new rank ~r~Pro Drifter!", 5);
	    	Bit1_Set( ProDrifter , playerid, 1 );
		}
	}
	if( Bit1_Get( MasterDrifter, playerid ) == 0 )
	{
		if( Bit16_Get( TotalScore, playerid ) > 500000 )
		{
	 		SetPlayerDriftTitle( "Master Drifter");
	 		if( rText_Viewing( playerid ) )
    		rText_Update( playerid, "~w~Congratulations! You have more than 50.000 Drift Points and you gain a new rank ~r~Master Drifter!", true, 5 );
			else
    		rText_Show( playerid, "~w~Congratulations! You have more than 50.000 Drift Points and you gain a new rank ~r~Master Drifter!", 5);
	    	Bit1_Set( MasterDrifter , playerid, 1 );
		}
	}
	if( Bit1_Get( DriftKing, playerid ) == 0 )
	{
		if( Bit16_Get( TotalScore, playerid ) > 1000000 )
		{
	 		SetPlayerDriftTitle( "Drift King");
	 		if( rText_Viewing( playerid ) )
    		rText_Update( playerid, "~w~Congratulations! You have more than 50.000 Drift Points and you gain a new rank ~r~Drift King!", true, 5 );
			else
    		rText_Show( playerid, "~w~Congratulations! You have more than 50.000 Drift Points and you gain a new rank ~r~Drift King!", 5);
	    	Bit1_Set( DriftKing , playerid, 1 );
		}
	}
    return 1;
}
stock SetPlayerDriftTitle( title[ ] )
{
	format( DriftTitle, sizeof( DriftTitle ), "%s", title );
	
	return 1;
}
For me it works fine but for another player doesen't work..