register_event("ResetHUD", ....... -resolved again
I get the following error when compiling this code:
Code:
(41) : error 035: argument type mismatch (argument 1)Code:
|
Re: register_event("ResetHUD", .......
The mismatch is coming from get_cvar_num. That is "old" way of getting a cvar's value, it expects a string argument that is the cvar's name, ie: get_cvar_num("zombiehp"). Since you are using cvar ids, use get_pcvar_num instead.
|
Re: register_event("ResetHUD", .......
Thank you very much for the extremely fast and to the point reply.
It compiled with no errors. :up: :up: |
Re: register_event("ResetHUD", ....... -new issue
Bah, compiled with no errors but it doesn't do its job...
I'm trying to set all bots health to 300 or whatever the zombiehp cvar says. Is health supposed to be a float or an integer? What am I doing wrong? |
Re: register_event("ResetHUD", ....... -new issue
try
Code:
register_event("ResetHUD", "zombie_health", "b") |
Re: register_event("ResetHUD", ....... -new issue
Thank you so much for the quick reply Emp` I just finished having lots of fun in my server with this plugin now working :D :D :D
|
Re: register_event("ResetHUD", ....... -resolved again
Code:
Code:
Won't this cuase it so that every time the Hud is reset, the npc will get his HP restored? O.o Read this before using ResetHUD to make sure your using the correct event. http://forums.alliedmods.net/showthread.php?t=42159 If I'm not mistaken, doesn't ResetHUD also activate even in the middle of the round? So wouldn't the 'zombies' heal in the middle of the round? O.o |
Re: register_event("ResetHUD", ....... -resolved again
RestHUD is also called when using sv_restart <#> and when starting a demo recording, I don't know what you mean by "in the middle of a round." Anyway, this plugin is meant for TS (The Specialists) where there aren't any rounds to speak of, so that drops out. Also, I don't plan on recording a demo, but even if I would, I wouldn't mind having the bots' health be reset to the given value.
Just in case you were wondering, the purpose of the plugin is so that all of the bots or 'zombies' will spawn with a different amount of hp than 100 every time they spawn. As far as I know, the plugin works flawlessly, except for the inconvenience that when you change the zombiehp cvar, the zombie won't receive the given amount of hp until it dies. |
| All times are GMT -4. The time now is 04:49. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.