I'm curious, what does playermoney have anything to do with going back to class selection after dying or not?
Look for ForClassSelection in your code.
PHP код:
// Sends the player back to class selection
COMMAND:reclass(playerid, params[])
{
// Force the player back into class-selection
ForceClassSelection(playerid);
// Turning spectator mode on and off again makes the player respawn inside class-selection after using "ForceClassSelection"
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
// Let the server know that this was a valid command
return 1;
}
// Kills the player
COMMAND:kill(playerid, params[])
{
// Kill the player by setting his health to 0
SetPlayerHealth(playerid, 0.0);
// Let the server know that this was a valid command
return 1;
}
I have these commands in my own gamemode.
When I die, or use the /kill command, I respawn as usual, everytime.
When I use /reclass, I'll end up in class selection and can spawn again.
When I die the first time after respawning (after having used /reclass), I'll end up in class selection again.
From the second time I die (and everytime after that), I respawn as usual without going to class selection.
So it's actually ForceClassSelection which sends you back to class selection when you die.
It requires you to die first to cancel returning to class selection feature of that command.
Your script may have ForceClassSelection inside OnPlayerSpawn or OnPlayerDeath, sending you to class selection everytime you die.
PHP код:
// Sends the player back to class selection
COMMAND:reclass(playerid, params[])
{
// Force the player back into class-selection
ForceClassSelection(playerid);
// Kill the player by setting his health to 0
SetPlayerHealth(playerid, 0.0);
// Let the server know that this was a valid command
return 1;
}
If I would use this command to get to class selection, you go to class selection as well.
But after spawning, you won't go back to class selection when you die the first time.