03.09.2014, 05:27
I'm making a login system which prevents displaying classes for a player until login:
It works good, no classes are shown. The problem is that after a player is logged in, it does not show the classes automatically, the player have to click on arrow button to see a class. I tried ForceClassSelection with and without TogglePlayerSpectating/SpawnPlayer, but no luck:
The only solution I found is to actually spawn player and get him back to class selection:
But I don't like it because it shows the spawned player for some time before return to class selection. Is there a better solution?
Код:
public OnPlayerRequestClass(playerid, classid)
{
if (!Players[playerid][IsLoggedIn])
{
LoadPlayer(playerid);
return 0;
}
else
{
SetClassSelectionCamera(playerid);
return 1;
}
}
Код:
OnPlayerLoggedIn(playerid)
{
ForceClassSelection(playerid);
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
}
Код:
OnPlayerLoggedIn(playerid)
{
ForceClassSelection(playerid);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
}


