MantisBT - Zandronum
View Issue Details
0003556Zandronum[All Projects] Suggestionpublic2018-10-20 18:272020-05-22 23:47
Michaelis 
 
normalfeatureN/A
newopen 
 
 
0003556: Letting modders change player class without ConsoleCommand
Part of phasing out the dangerous ConsoleCommand (https://zandronum.com/tracker/view.php?id=1070).

It would be great to have SetPlayerClass(player, classname); to replace ConsoleCommand("playerclass nyx").

Primary use case is mods implementing their own class selection through ACS menu or "Choose Your Difficulty"-like galleries on maps, akin to Quake 1 intro.
No tags attached.
child of 0001070new Dusk Phasing out the dangerous ConsoleCommand for various additional/improved ACS commands 
Issue History
2018-10-20 18:27MichaelisNew Issue
2018-10-21 12:21LeonardRelationship addedchild of 0001070
2018-10-25 10:33MichaelisNote Added: 0020146
2018-10-25 10:33MichaelisNote Edited: 0020146bug_revision_view_page.php?bugnote_id=20146#r12265
2020-05-22 23:47JaxOf7Note Added: 0021342

Notes
(0020146)
Michaelis   
2018-10-25 10:33   
Also add boolean "respawn now?". Defaults to false.
If it is false, then using SetPlayerClass is exactly equal to setting playerclass with console.
If it is true, then player is killed and respawned as new class immediately.
In a game mode with limited lives, e.g. Survival or LMS, life is not deducted.

SetPlayerClass(int player, str classname[, bool respawnNow]);

(0021342)
JaxOf7   
2020-05-22 23:47   
To add onto this
I've been using ConsoleCommand("Playerclass (class)") in some of my mods.
Specifically, having a user variable for each team designating a class for each team so it automatically sets your class upon joining that team.
(ex: Team0 Ghostbuster, Team1 Jitterskull)
Thing is though, this kicks you for user info flood if you're not careful.
Even kicks if you are careful.
Would appreciate something that never kicks players.