Don't allow players to leave the Class Selection until login?
#1

Hi,

I'm working on a login system for my Server.
Now I want to prevent players from spawning before login.
I done this by returning zero in OnPlayerRequestSpawn().
But the player can be spawned without login (e.g. kill by admin).

Is it possible to return to the Class Selection until the player login?
Reply
#2

Use "ForcePlayerClassSelection" then "SpawnPlayer" if they're not logged in.
Reply
#3

Currently I have the problem that the player can falls from the Class Selection place (I don't know why).
I try /cmdlist (The command is not in any Filterscript or in the game mode) and can select the player color.
If I select a row from the menu the player falls from the Class Selection place.
Then the player dies but the functions OnPlayerSpawn() or OnPlayerDeath() didn't get called.

//EDIT: I restarted the server and the command "/cmdlist" does not work anymore.
Reply
#4

Make it Easy,
In the Top of the Script that.
Код:
new LoggedIn[MAX_PLAYERS];
Then by your /login Command
Код:
LoggedIn[playerid] = 1;
and then your OnPlayerSpawn
Код:
public OnPlayerSpawn(playerid)
{
if(LoggedIn[playerid] == 0)
ForceClassSelection(playerid);
return 1;
}
Reply
#5

Quote:
Originally Posted by kavkus
Код:
public OnPlayerSpawn(playerid)
{
if(LoggedIn[playerid] == 0)
ForceClassSelection(playerid);
return 1;
}
... If I fall down from the Class Selection place, OnPlayerSpawn() won't be called.
But I think the problem has been fixed. I can't get out of the Class Selection place without login.
Reply
#6

public OnPlayerRequestSpawn(playerid)
{
return LoggedIn[playerid];
}

Now, if you have other code under OnPlayerRequestSpawn, add this to the top of the function:
if(!LoggedIn[playerid])
{
return 0;
}
Reply
#7

Good luck finding one . Or just learn how to do it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)