24.04.2012, 00:55
pawn Code:
forward UpdateXPMeter ( playerid );
public UpdateXPMeter ( playerid )
{
switch ( accInfo [ playerid ] [ Experience ] )
{
case 0:
{
for( new n; n < MAX_LEVEL_STAGES; n ++ )
{
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ n ], -1 );
}
}
case 1:
{
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 0 ], 16777215 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 1 ], -1 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 2 ], -1 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 3 ], -1 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 4 ], -1 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 5 ], -1 );
}
case 2:
{
for( new n; n < 2; n ++ )
{
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ n ], 16777215 );
}
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 2 ], -1 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 3 ], -1 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 4 ], -1 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 5 ], -1 );
}
case 3:
{
for( new n; n < 3; n ++ )
{
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ n ], 16777215 );
}
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 3 ], -1 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 4 ], -1 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 5 ], -1 );
}
case 4:
{
for( new n; n < 4; n ++ )
{
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ n ], 16777215 );
}
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 4 ], -1 );
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 5 ], -1 );
}
case 5:
{
for( new n; n < 5; n ++ )
{
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ n ], 16777215 );
}
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ 5 ], -1 );
}
case MAX_LEVEL_STAGES: // Otherwise known as '6'
{
for( new n; n < MAX_LEVEL_STAGES; n ++ )
{
PlayerTextDrawColor( playerid, XPLVL [ playerid ] [ n ], 16777215 );
}
}
}
return true;
}