PDA

View Full Version : [Fixed] Enable superhero mid-game


Soloist
11-28-2005, 18:35
Is it not possible to load superhero about a min into a map, and have the xp load correctly. Because I wrote a plugin for my server that lets you chose what mini-mod you want to play. and then it enables that plugin. If superhero gets chosen. the superhero CVAR is set and the round is restarted. Well on every time XP is loaded it resets it. But if I just run superhero on round start it saves it and loads it correctly.

//********************** GENERAL MOD CVARS **********************

//Enables/disables the mod 0=disable, 1=enable
sv_superheros 0

//Flag to determine who can access the important server commands
sh_adminaccess a

//If optional C/D is on a server - don't let people without C/D have powers
sh_cdrequired 0

//Debug Message Level
//ONLY enable this if you are trying to fix something, it prints A LOT of messages
// 0 = Disabled, 1 = Server Print, 2 = Server Log, 3+ = More Messages, Server Log
sh_debug_messages 0

//Number of heros allowed with bind characters - after that you must pick non-bind heros only
sh_maxbinds 3

//Max number of powers players can pick from, this is also limited by the number of levels you have.
sh_maxpowers 30

//What level to start newcomers at
sh_minlevel 2

//Save XP or restart it from 0 each map: 1 = save, 0 = restart each map
sh_savexp 1

//How many days XP is saved after a users last connection
//Recommended max setting of 30 for VAULT style saving. Max value is 365.
sh_xpsavedays 365

//Enable this to save XP at end of every round
//May cause a very small ammount of lag at round end with MySQL saving
sh_endroundsave 1

//This cvar sets the value of XP given/taken from players for Hostage / Bomb events.
//Hostage rescues only get 1/4th the XP because there is usually 4 of them.
sh_bombhostxp 8

//Give new players an average level of XP based on people already playing - 1=on | 0=off
//DO NOT USE WITH LONG-TERM XP
sh_autobalance 0

//Load XP right when a player joins (may cause lag with large user database)
sh_loadimmediate 0

// MercyXP gives players XP if they did not gain any during a round
// 0 = MercyXP system Disabled
// 1 = Give any player a set amount of XP which is set with sh_mercyxp
// 2 = Give only players up to a certian level MercyXP, max level is set with sh_mercyxp
// XP given will be the inverse of the amount they would get for killing
// someone at thier level, then this is diveded by 2 to keep it low.
// So as a players level increases they will get less MercyXP with mode 2
sh_mercyxpmode 2

//Mode 1: How much Mercy XP to give players
//Mode 2: Max level to give MercyXP to players
sh_mercyxp 10

//Command Projector, displays help info to players in a HUD messages non-stop - 1+ = on | 0=off
// 1 - Only show to DEAD players
// 2 - Show to ALL players
sh_cmdprojector 1

//How many highest level heros can a person pick
//If this is set to 2 and a client is at level 9, they can only pick 2 level 9 heroes.
//There is a bunch of complicated math that goes into this system and it limits more than
//just the highest level avliable to that person, try it and see what I mean.
//Set to 0 to disable this limiting of choices
sh_lvllimit 3

// 1 = New style menu, shows disabled heros grayed out
// 0 = Old style menu, hides disabled heros from showing on the menu
sh_menumode 1

//Headshot Multiplyer - if you kill someone with a headshot the XP given
//will be multiplied by the value. Setting this to "1.0" will effectivly
//disable it because x * 1 = x. Any value less than 1.0 is ignored.
sh_hsmult 1.5

//Can clients drop heroes while alive?
//This is OFF by default because many people expliot the server by picking a hero
//like batman, get the weapons, then drop him. This will prevent that kind of activity.
sh_alivedrop 1

// *** MySQL Settings, Only Needed if using the mysql saving method ***
// Uncomment the cvar lines to enable these settings

sh_mysql_host "127.0.0.1"
sh_mysql_user "root"
sh_mysql_pass "godschoir"
sh_mysql_db "sherodb"
sh_mysql_persistent 0

...Heros CVARS...

jtp10181
11-28-2005, 21:52
I think i see the problem. Try the following and let me know

in client_putinserver(id), and readXP(id) remove the checks for !shModActive()

this will allow the XP to load even if its disabled. then when enabled thier XP should be there waiting.

There is prob a similar bug for the saving, if you disable it mid round all that XP would be lost.

Soloist
11-29-2005, 11:26
Ok so far so good. Seems to be working now. Thanks. I'll update if I get problems again.