Change Race Past freeze Time
Moderator: Forum Moderator
Change Race Past freeze Time
I know of the cvar to allow changing race past the freeze time but what I want to do is only allow you to change race during the Buy time or only in the buy zone.
The reason for this is I don't like it when players will change to different race mid round just because they are weak or want to be silent or want to hide.
If I set the mp_changeracepastfreezetime to 0 then players are having trouble choosing their race when they enter the game mid round or if their connection is a slower than a few others.
Any ideas on how to solve this.
Currently my cvars are set to this:
mp_freezetime 3
mp_changeracepastfreezetime 1
mp_allowchangerace 1
All the rest are default for a Long term and saved via mysql
The reason for this is I don't like it when players will change to different race mid round just because they are weak or want to be silent or want to hide.
If I set the mp_changeracepastfreezetime to 0 then players are having trouble choosing their race when they enter the game mid round or if their connection is a slower than a few others.
Any ideas on how to solve this.
Currently my cvars are set to this:
mp_freezetime 3
mp_changeracepastfreezetime 1
mp_allowchangerace 1
All the rest are default for a Long term and saved via mysql
-john
- ferret
- Lead Warcraft 3 XP Developer
- Posts: 422
- Joined: Wed Jul 06, 2005 8:20 am
- Location: Atlanta, GA
- Contact:
What kind of connection is too slow to pick a range while dead or at the start of a round? :/
Anyways. I believe buytime is in minutes, so mp_buytime 0.5 is 30 seconds. At least that's what I remember. I haven't touched CS1.6 in over a year, no joke. So if its not mp_buytime, figure out what it really is and replace it in the file I'm posting:
(Understand I'm writing this from work while bored and between tasks, without having written any AMXX in over a year. I believe this code will work however.)
This adds mp_changeracewithbuytime. Set to 1 and you can change race until the buytime ends, rather than the end of the freezetime. If you use mp_changeracepastfreezetime 1 it will still allow race change at any time though, so turn it off.
To recap:
mp_allowchangerace - 1 allows race change, 0 disallows. When set to 1, players can change race while dead or during freeze time.
mp_changeracepastfreezetime - When set to 1, disables the "must be dead or in freeze time" restriction. Living players can change at any time during the round.
mp_changeracewithbuytime - Set to 1 uses buytime instead of freezetime to determine when race change is no longer allowed, when mp_changeracepastfreezetime is set to 0.
I'll add to CVS later. This is the important line, replace it if I got the cvar name wrong:
set_task(get_cvar_float("mp_buytime")*60.0,"end_buytime", 10987)
Anyways. I believe buytime is in minutes, so mp_buytime 0.5 is 30 seconds. At least that's what I remember. I haven't touched CS1.6 in over a year, no joke. So if its not mp_buytime, figure out what it really is and replace it in the file I'm posting:
(Understand I'm writing this from work while bored and between tasks, without having written any AMXX in over a year. I believe this code will work however.)
This adds mp_changeracewithbuytime. Set to 1 and you can change race until the buytime ends, rather than the end of the freezetime. If you use mp_changeracepastfreezetime 1 it will still allow race change at any time though, so turn it off.
To recap:
mp_allowchangerace - 1 allows race change, 0 disallows. When set to 1, players can change race while dead or during freeze time.
mp_changeracepastfreezetime - When set to 1, disables the "must be dead or in freeze time" restriction. Living players can change at any time during the round.
mp_changeracewithbuytime - Set to 1 uses buytime instead of freezetime to determine when race change is no longer allowed, when mp_changeracepastfreezetime is set to 0.
I'll add to CVS later. This is the important line, replace it if I got the cvar name wrong:
set_task(get_cvar_float("mp_buytime")*60.0,"end_buytime", 10987)
- Attachments
-
- warcraft3.sma
- (326.14 KiB) Downloaded 1784 times
-< www.gamehavoc.com >-
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
I am getting a compile error.
Did you use the sma that is on the cvs? that is the only one I can use to compile from, the one that is listed on the website shows to compile and complete but it tried to save it as a amx file and not a amxx but it when I go to the compiled folder it is not present.
In reference to your question about the connection... When you are not the first 2 players on the server and the round starts, then you are not able to select your race except during freezetime unless you use the pastfreezetime cvar.
Thanks
Code: Select all
warcraft3.sma(5149) : error 075: input line too long (after substitutions)
1 Error.
Could not locate output file warcraft3.amx (compile failed).
war3xp@tdow:~/hlds/cstrike/addons/amxmodx/scripting$
In reference to your question about the connection... When you are not the first 2 players on the server and the round starts, then you are not able to select your race except during freezetime unless you use the pastfreezetime cvar.
Thanks
-john
Ok I added the code to the one that I can compile and it did compile except with a loose indention at line 217.
I am testing the new version on my server now. I have noticed that when I add the cvar and then try to check it via console
it gives no setting...meaning it comes back blank unlike when I try it comes back
Thanks
I am testing the new version on my server now. I have noticed that when I add the cvar
Code: Select all
mp_changeracewithbuytime 1
Code: Select all
mp_changeracewithbuytime
Code: Select all
mp_changeracepastfreezetime
Code: Select all
mp_changeracepastfreezetime 0
-john
- ferret
- Lead Warcraft 3 XP Developer
- Posts: 422
- Joined: Wed Jul 06, 2005 8:20 am
- Location: Atlanta, GA
- Contact:
Did you copy ALL of the code changes? The line I posted is not everything I added. I'll list them here:
Change #1:
to
Change #2:
to
Change #3:
Add this function. I put it after start_round():
Change #4:
to
Change #1:
Code: Select all
if(gNewSpawn && gRoundOver)
{
gNewSpawn = false
bFreezeTime = true
#if ITEMS_DROPABLE
new stray_items = 0
do
{
stray_items = find_ent_by_class(stray_items,"wc3item")
if(stray_items > 0)
remove_entity(stray_items)
}
while(stray_items)
#endif
}
Code: Select all
if(gNewSpawn && gRoundOver)
{
gNewSpawn = false
bFreezeTime = true
if(get_cvar_num("mp_changeracewithbuytime") == 1)
set_task(get_cvar_float("mp_buytime")*60.0,"end_buytime", 10987)
#if ITEMS_DROPABLE
new stray_items = 0
do
{
stray_items = find_ent_by_class(stray_items,"wc3item")
if(stray_items > 0)
remove_entity(stray_items)
}
while(stray_items)
#endif
}
Code: Select all
public start_round()
{
bFreezeTime = false
gRoundOver = false
Code: Select all
public start_round()
{
if(get_cvar_num("mp_changeracewithbuytime") == 0)
bFreezeTime = false
gRoundOver = false
Add this function. I put it after start_round():
Code: Select all
public end_buytime()
{
bFreezeTime = false;
return PLUGIN_CONTINUE
}
Code: Select all
register_cvar("mp_allowchangerace","0",0)
register_cvar("mp_changeracepastfreezetime","0",0)
#if ORCNADE_CVAR
register_cvar("mp_alloworcnade","1",0)
#endif
Code: Select all
register_cvar("mp_allowchangerace","0",0)
register_cvar("mp_changeracepastfreezetime","0",0)
register_cvar("mp_changeracewithbuytime","0",0)
#if ORCNADE_CVAR
register_cvar("mp_alloworcnade","1",0)
#endif
-< www.gamehavoc.com >-
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
I made the changes, some of the code wasn't listed exactly as you posted, it had different spacing but I replaced it as per your instructions, at least I think I did all correctly.
Anyway I am getting more compile errors.
It might be best if I just post my sma that I am working with and you can look at it.
Thanks for all your help.
You can see my sma at this link.
http://dm1.tdow.net/war3xp/warcraft3.sma
Anyway I am getting more compile errors.
Code: Select all
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
warcraft3.sma(1885) : warning 217: loose indentation
warcraft3.sma(2117) : warning 217: loose indentation
warcraft3.sma(2117) : error 029: invalid expression, assumed zero
warcraft3.sma(2117) : error 017: undefined symbol "end_buytime"
warcraft3.sma(2125) : warning 225: unreachable code
2 Errors.
Could not locate output file warcraft3.amx (compile failed).
war3xp@avara:~/hlds/cstrike/addons/amxmodx/scripting$
Thanks for all your help.
You can see my sma at this link.
http://dm1.tdow.net/war3xp/warcraft3.sma
-john
- ferret
- Lead Warcraft 3 XP Developer
- Posts: 422
- Joined: Wed Jul 06, 2005 8:20 am
- Location: Atlanta, GA
- Contact:
Don't put
Inside of start_round(). Move it to after it, after this:
That's the line 2117 error. The loose indentation warnings don't matter. The 225 warning is related to the errors above it.
Code: Select all
public end_buytime()
{
bFreezeTime = false;
return PLUGIN_CONTINUE
}
Code: Select all
}
return PLUGIN_CONTINUE
}
-< www.gamehavoc.com >-
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
- ferret
- Lead Warcraft 3 XP Developer
- Posts: 422
- Joined: Wed Jul 06, 2005 8:20 am
- Location: Atlanta, GA
- Contact:
Your original compile error is unrelated to the changes I made. There seems to have been a change in AMXX that has caused one of the messages (French description of blood elf skills) to be too long. I'll research and fix later... If it still happens, do this:
find:
change to:
I deleted a bit of text, should make it small enough. This is probably due to Bailopan making the error checking in the compiler better, and its catching old bugs that have existed for years and years.
find:
Code: Select all
format(title,63,"Competences des %s.",racename[5])
message = "<HTML><head></head><pre><body bgcolor=#000000><font color=#FFB000>Armure Enchanter: Te donne l'armure complete plus (%d, %d, %d) au commencement du round.<p>\
Mana de Protection: Tous les dmg non mortels que tu prendras seront réduits par (%d%%, %d%%, %d%%).<p>\
La Soif de Sang: Ajoute (%d, %d , %d) de dmg à chaque balle et la vitesse de l'ennemi est reduite temporairement.<p>\
Ultimate, L'ombre de Frappe: Emet une puissante force destructrice à un ennemi qui est dans ton champs de vision."
format(message,2047,message,p_crimsonarmor[0],p_crimsonarmor[1],p_crimsonarmor[2],floatround(p_manashield[0]*100),floatround(p_manashield[1]*100),floatround(p_manashield[2]*100),p_bloodlust[0],p_bloodlust[1],p_bloodlust[2])
Code: Select all
format(title,63,"Competences des %s.",racename[5])
message = "<HTML><head></head><pre><body><font>Armure Enchanter: Te donne l'armure complete plus (%d, %d, %d) au commencement du round.<p>\
Mana de Protection: Tous les dmg non mortels que tu prendras seront réduits par (%d%%, %d%%, %d%%).<p>\
La Soif de Sang: Ajoute (%d, %d , %d) de dmg à chaque balle et la vitesse de l'ennemi est reduite temporairement."
format(message,2047,message,p_crimsonarmor[0],p_crimsonarmor[1],p_crimsonarmor[2],floatround(p_manashield[0]*100),floatround(p_manashield[1]*100),floatround(p_manashield[2]*100),p_bloodlust[0],p_bloodlust[1],p_bloodlust[2])
-< www.gamehavoc.com >-
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
Ah, I was not sure about where to place that, Thanksferret wrote:Don't putInside of start_round(). Move it to after it, after this:Code: Select all
public end_buytime() { bFreezeTime = false; return PLUGIN_CONTINUE }
That's the line 2117 error. The loose indentation warnings don't matter. The 225 warning is related to the errors above it.Code: Select all
} return PLUGIN_CONTINUE }
After making the changes this one compiled with only 2 warnings
Code: Select all
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
warcraft3.sma(1890) : warning 217: loose indentation
warcraft3.sma(9571) : warning 217: loose indentation
Header size: 5592 bytes
Code size: 224976 bytes
Data size: 123380 bytes
Stack/heap size: 24576 bytes; max. usage is unknown, due to recursion
Total requirements: 378524 bytes
2 Warnings.
Done.
Code: Select all
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Header size: 5592 bytes
Code size: 224976 bytes
Data size: 123380 bytes
Stack/heap size: 24576 bytes; max. usage is unknown, due to recursion
Total requirements: 378524 bytes
Done.
Here is the version that will compile with out any errors
http://dm1.tdow.net/war3xp/warcraft3.sma
THANKS !!!!!!
-john
- ferret
- Lead Warcraft 3 XP Developer
- Posts: 422
- Joined: Wed Jul 06, 2005 8:20 am
- Location: Atlanta, GA
- Contact:
Ugh. I know why. Too late tonight to fix, and moving tomorrow. I'll have you some more changes sometime this weekend.
-< www.gamehavoc.com >-
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
- ferret
- Lead Warcraft 3 XP Developer
- Posts: 422
- Joined: Wed Jul 06, 2005 8:20 am
- Location: Atlanta, GA
- Contact:
Try this one
- Attachments
-
- warcraft3.sma
- WC3
- (316.52 KiB) Downloaded 1657 times
-< www.gamehavoc.com >-
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
This is the error I get with this last one:
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
warcraft3.sma(2115) : error 017: undefined symbol "ChangeRaceTime"
warcraft3.sma(2115) : warning 217: loose indentation
warcraft3.sma(2115 -- 2117) : warning 215: expression has no effect
warcraft3.sma(2117) : warning 217: loose indentation
1 Error.
Could not locate output file warcraft3.amx (compile failed).
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
warcraft3.sma(2115) : error 017: undefined symbol "ChangeRaceTime"
warcraft3.sma(2115) : warning 217: loose indentation
warcraft3.sma(2115 -- 2117) : warning 215: expression has no effect
warcraft3.sma(2117) : warning 217: loose indentation
1 Error.
Could not locate output file warcraft3.amx (compile failed).
-john
- ferret
- Lead Warcraft 3 XP Developer
- Posts: 422
- Joined: Wed Jul 06, 2005 8:20 am
- Location: Atlanta, GA
- Contact:
Bleh typo
- Attachments
-
- warcraft3.sma
- (316.52 KiB) Downloaded 1738 times
-< www.gamehavoc.com >-
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!
Lazarus Long: And I know you didn't because the Server Files are version 2.2.6 and the file you posted is version 2.2.5, so do as I told you above and don't ever lie to me again or help is gone!