SA-MP Forums Archive
Class selection only the first time - 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: Class selection only the first time (/showthread.php?tid=485502)



Class selection only the first time - renegadegaming - 04.01.2014

Hey!

I've encountered a problem and was unable to find a way out.
I want the class selection thing to show up only the first time you login. That means you register the first time, choose a class and the next time you will not get the class selection screen, but return where you were.

How is that possible to do?


Re: Class selection only the first time - Seif- - 04.01.2014

This depends on when you let the players register. Are they obliged to register when they first connect? If so, if they're not registered, return 0 in OnPlayerRequestSpawn. This will stop them from spawning.
Then in OnPlayerRequestClass, spawn them if they're logged in (SetSpawnInfo + SpawnPlayer), otherwise let them view the classes if not.


Re: Class selection only the first time - Beckett - 04.01.2014

It's simple assign a variable example:
pawn Код:
enum PlayerInfo
{
Your variables are here.
blabla
}
new your_enum_variable_here
Then when the player logs in for the first time
Put this.
pawn Код:
blabla = 1;
Make this variable save upon disconnect then when he logs in again OnPlayerRequestClass check if that variable is 1 if 1 then instant spawn him if 0 then not, if you still didn't get it reply here and I will try to explain as much as I can.


Re: Class selection only the first time - renegadegaming - 04.01.2014

Thank you very much! Valuable information