SA-MP Forums Archive
Any way to force login - 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: Any way to force login (/showthread.php?tid=595404)



Any way to force login - yvoms - 02.12.2015

well, i made a registration system on samp, and i would like to force players to log in before getting to the class selection screen, anyone hass any idea how to do this?


Re: Any way to force login - Vince - 02.12.2015

You can't, really. If a dialog shown in OnPlayerConnect is responded to, either by clicking one of the buttons or pressing escape, the class selection will be shown regardless of whether that dialog gets shown again (e.g. wrong password). You can only prevent players from spawning.


Re: Any way to force login - yvoms - 02.12.2015

Ah okay thank you


Re: Any way to force login - PrO.GameR - 02.12.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
You can't, really. If a dialog shown in OnPlayerConnect is responded to, either by clicking one of the buttons or pressing escape, the class selection will be shown regardless of whether that dialog gets shown again (e.g. wrong password). You can only prevent players from spawning.
Isn't it possible with player spectating ? so well thats one way to do it maybe ? PlayerSpectating > login > he spawns as soon as you get him out of the spectating > kill him + forceclassSelection

That works, but it's not really a neat way.


Re: Any way to force login - Riddick94 - 02.12.2015

So, one day I was trying to get rid of all this crap from my gamemode like spawn buttons (GUI), class request stuff and other.. so I just started thinking logically that day and said to myself that I should really spawn players as soon as they connect (timerEx 300ms or something) and then I can do whatever I want with them once they are spawned. Set their virtual world to their own ID so they are never going to be visible for anybody else and create your own Class selection (if necessary, but it wasn't for me).

Once that's done, I just don't have to give a fuck about Class selection callbacks, spawn buttons and mess around with Spectating mode. It's just better for me to keep it server-sided anyways.

It isn't hard to create it all from scratch. I don't really know if anybody did something like that before and released it, but just give it a try, I find it better personally.