Send Player(s) To Class Selection After Restart?
#1

Evening. I seem to be having issues with server restarts and gTeam's. When I restart the server, everything is fine except for when the players who were online before the restart log in to their accounts. They don't get sent to class selection screen, unlike if they were to quit the server and join like normal. The server simply spawns them and then all of our custom functions, commands, etc are messed up because they aren't in the correct gTeam's. Could somebody be of assistance? Thanks!
Reply
#2

Restart? As in close and open the server.exe or /gmx or what?

Mine seems to work when I press restart on ServerFFS, it sends them torClass Selection
Reply
#3

https://sampwiki.blast.hk/wiki/ForceClassSelection

Good riddance!
Reply
#4

Quote:
Originally Posted by Darklom
Посмотреть сообщение
Restart? As in close and open the server.exe or /gmx or what?

Mine seems to work when I press restart on ServerFFS, it sends them torClass Selection
I have a custom command which saves all server and player data, then does "SendRconCommand("gmx");". So when using "gmx".

Quote:
Originally Posted by Sledge
Посмотреть сообщение
I am currently using that function, but the first time the player dies they are sent to class selection. I don't want to kill them the first time they spawn, either... so unless there is a way to reverse that commands functionality...?
Reply
#5

put it under onplayerconnect.
Reply
#6

Quote:
Originally Posted by Sledge
Посмотреть сообщение
put it under onplayerconnect.
It still makes the first death cause the player to go to the request class screen.
Reply
#7

I understood your first post, then after reading some of your replies, I got lost. Could you explain again, preferably in a bulleted list (they're always easier to read )

If I'm thinking correctly, your problem could be solved by setting the players spawn information. Once again, may be thinking on a totally different subject.

And are you sure ForceClassSelection kills the player in OnPlayerConnect? I don't recall it happening for me.
Reply
#8

https://sampwiki.blast.hk/wiki/ForceClassSelection

RealCop, you could use tPS and not kill the player too.
Reply
#9

Quote:
Originally Posted by Grim_
Посмотреть сообщение
I understood your first post, then after reading some of your replies, I got lost. Could you explain again, preferably in a bulleted list (they're always easier to read )

If I'm thinking correctly, your problem could be solved by setting the players spawn information. Once again, may be thinking on a totally different subject.

And are you sure ForceClassSelection kills the player in OnPlayerConnect? I don't recall it happening for me.
The Problem: When the server restarts, all of the previously connected players (before the restart) will be bugged. When the server is back online (after a "gmx"), once they log in they will spawn immediately, instead of needing to select their team/class like normal. Still with me?

Attempted Solutions: As aforementioned, using "ForceClassSelection" before the player spawns should do what I need it to do. It does, but then causes another bug to occur. When a player dies for the first time, they will be sent to the class selection screen instead of spawning like normal after a death. All other deaths are fine... I am currently using "TogglePlayerSpectating" in my script as I have a dialog registration system and don't like the "< > (spawn)" bar at the bottom of the screen during registration/login. Once they log in, they are toggled as "not spectating".

EDIT: I am willing to show portions of my code if absolutely necessary.

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/ForceClassSelection

RealCop, you could use tPS and not kill the player too.
Yep, tried both of them. I further explained the situation above.
Reply
#10

Just tested it with a friend, I presume as I normally would. I could only imagine it would be parts of your code.

You can give us your OnPlayerConnect, OnPlayerDisconnect, and your custom GMX function. Start only with the ones that you think would be most likely to cause it.

If you really don't want to reveal the code, just keep screwing around with it and hopefully you will find the problem.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)