05.07.2012, 10:53
How Do Rank in dialog?
in this dialog:
in this dialog:
PHP код:
public OnPlayerUpdate( playerid )
{
new string[ 128 ];
new score;
score = GetPlayerScore(playerid);
format( string, sizeof string, "Score:~r~ %d", score );
TextDrawSetString(Textdraw0, string);
new cash;
cash = GetPlayerMoney( playerid );
format( string, sizeof string, "Money:~r~ %d", cash );
TextDrawSetString(Textdraw1, string );
if(GetPlayerScore(playerid) >= 1000) rank[ playerid ] = 6;
else if(GetPlayerScore(playerid) >= 700) rank[ playerid ] = 5;
else if(GetPlayerScore(playerid) >= 500) rank[ playerid ] = 4;
else if(GetPlayerScore(playerid) >= 200) rank[ playerid ] = 3;
else if(GetPlayerScore(playerid) >= 100) rank[ playerid ] = 2;
else if(GetPlayerScore(playerid) >= 50) rank[ playerid ] = 1;
else if(GetPlayerScore(playerid) >= 0) rank[ playerid ] = 0;
format( string, sizeof string, "Rank:~r~ %d", rank[ playerid ] );
TextDrawSetString( Textdraw2, string );
return 1;
}