Help! OnPLayerSpawn - 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: Help! OnPLayerSpawn (
/showthread.php?tid=462468)
Help! OnPLayerSpawn -
Day_Jons - 07.09.2013
Hello, I need your help
![Smiley](images/smilies/smile.png)
give an example, let's say I go to the server, the window Sign in / Register below and we see 3 boxes (<<, >>, Spawn) Spawn klick when a player spawns, I can not catch up with how to make that it does not spawn for just a chat to write (for example: "Login / Register").
P.S. Use TogglePlayerSpectating etc. does not help.
Tell me what to do, thanks in advance.
Re: Help! OnPLayerSpawn -
Konstantinos - 07.09.2013
pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
if( /* CHECK IF THEY DID NOT REGISTER/LOGIN */ )
{
SendClientMessage (playerid, 0xFF0000FF, "You need to register/login first." );
return 0; // Returning 0 will prevent the player from spawning
}
return 1;
}
Re: Help! OnPLayerSpawn -
Day_Jons - 07.09.2013
Quote:
Originally Posted by Konstantinos
pawn Код:
public OnPlayerRequestClass( playerid, classid ) { if( /* CHECK IF THEY DID NOT REGISTER/LOGIN */ ) { SendClientMessage (playerid, 0xFF0000FF, "You need to register/login first." ); return 0; // Returning 0 will prevent the player from spawning } return 1; }
|
Thank you very much, understood!
Re: Help! OnPLayerSpawn -
playbox12 - 07.09.2013
That works, but TogglePlayerSpectating also definitely works to bypass the screen as a whole. Just add TogglePlayerSpectating under OnPlayerRequestClass (with the same if check to see if he's logged in etc).
Re: Help! OnPLayerSpawn -
Konstantinos - 07.09.2013
TogglePlayerSpectating will re-spawn the player and it will prevent the player class, but he asked something to prevent them from spawning
before they register/login.