I suggest to make non accessible races non-selectable, further to show your current total level in the changerace menu. Just an example:

If you are willing to make it (partial) official or for those who want to change their changerace-menu, here are the changes I made to menu.inc (example):
Code: (sourcepawn)
public War3Source_ChangeRaceMenu(client)
{
if (GetClientTeam(client) > 1)
{
ChangeClientTeam(client, 1);
PrintHintText(client, "You must be Spectator to change race!");
}
if(m_bBeenLoaded[client])
{
new Handle:crMenu=CreateMenu(War3Source_CRMenu_Selected);
SetMenuExitButton(crMenu,true);
// Iteriate through the races and print them out
new Handle:race;
decl String:rbuf[4];
decl String:rname[64];
decl String:rdisp[128];
new vecpos=GetClientVectorPosition(client);
if(vecpos>=0)
{
new total_level=0;
for(new z=1;z<RACE_COUNT;z++)
{
total_level+=GetLevel(vecpos,z);
}
SetMenuTitle(crMenu,"[War3Source] Select your desired race.\n \nSome races require a Minimum of total\nlevel. You get your total level if you add\nall levels from all your races.\n \nYour current total level: %d\n \n", total_level);
for(new x=1;x<RACE_COUNT;x++)
{
race=Race(x);
Format(rbuf,4,"%d",x);
GetArrayString(race,0,rname,64);
Format(rdisp,128,"%s (Level %d)",rname,GetLevel(vecpos,x));
new minlevel=GetConVarInt(GetArrayCell(race,12));
if(minlevel<0) minlevel=0;
if(minlevel>0)
{
Format(rdisp,128,"%s (MinLvl %d)",rdisp,minlevel);
}
if(HasAccess(client,race))
{
if(minlevel>total_level)
{
AddMenuItem(crMenu,rbuf,rdisp,ITEMDRAW_DISABLED);
}
else
{
AddMenuItem(crMenu,rbuf,rdisp);
}
}
}
DisplayMenu(crMenu,client,MENU_TIME_FOREVER);
}
}
}
{
if (GetClientTeam(client) > 1)
{
ChangeClientTeam(client, 1);
PrintHintText(client, "You must be Spectator to change race!");
}
if(m_bBeenLoaded[client])
{
new Handle:crMenu=CreateMenu(War3Source_CRMenu_Selected);
SetMenuExitButton(crMenu,true);
// Iteriate through the races and print them out
new Handle:race;
decl String:rbuf[4];
decl String:rname[64];
decl String:rdisp[128];
new vecpos=GetClientVectorPosition(client);
if(vecpos>=0)
{
new total_level=0;
for(new z=1;z<RACE_COUNT;z++)
{
total_level+=GetLevel(vecpos,z);
}
SetMenuTitle(crMenu,"[War3Source] Select your desired race.\n \nSome races require a Minimum of total\nlevel. You get your total level if you add\nall levels from all your races.\n \nYour current total level: %d\n \n", total_level);
for(new x=1;x<RACE_COUNT;x++)
{
race=Race(x);
Format(rbuf,4,"%d",x);
GetArrayString(race,0,rname,64);
Format(rdisp,128,"%s (Level %d)",rname,GetLevel(vecpos,x));
new minlevel=GetConVarInt(GetArrayCell(race,12));
if(minlevel<0) minlevel=0;
if(minlevel>0)
{
Format(rdisp,128,"%s (MinLvl %d)",rdisp,minlevel);
}
if(HasAccess(client,race))
{
if(minlevel>total_level)
{
AddMenuItem(crMenu,rbuf,rdisp,ITEMDRAW_DISABLED);
}
else
{
AddMenuItem(crMenu,rbuf,rdisp);
}
}
}
DisplayMenu(crMenu,client,MENU_TIME_FOREVER);
}
}
}
The problem I still have is to sort the races by Minimum Level. It is not true that sourcemod loads plugins alphabetically. Bailopan said that there is no guaranteed order on any operating system. https://forums.alliedmods.net/showthread.php?t=79391 I'll post a solution as soon as I'll find one ... and if anyone is interested.
Ben




Logged



DarkEnergy