Raised This Month: $32 Target: $400
 8% 

Solved Fetching FunCommands CVar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 08-18-2017 , 09:35   Fetching FunCommands CVar
Reply With Quote #1

Hi,
I have this in my code:
PHP Code:
ConVar cvBeaconRadius;

public 
OnPluginStart() {
    
cvBeaconRadius FindConVar("sm_beacon_radius");

And later use it in my beacon creating method, getting the cvar's FloatValue. On my test server it seems to work fine, but on my public server it just prints errors like this:
PHP Code:
Call stack trace:
   [
0ConVar.FloatValue.get 
and it won't work.

What have I done wrong??
__________________

Last edited by condolent; 08-18-2017 at 16:34.
condolent is offline
psychonic

BAFFLED
Join Date: May 2008
Old 08-18-2017 , 13:02   Re: Fetching FunCommands CVar
Reply With Quote #2

Use OnAllPluginsLoaded instead of OnPluginLoaded. Your plugin is probably loading before funcommands.
psychonic is offline
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 08-18-2017 , 13:32   Re: Fetching FunCommands CVar
Reply With Quote #3

Quote:
Originally Posted by psychonic View Post
Use OnAllPluginsLoaded instead of OnPluginLoaded. Your plugin is probably loading before funcommands.
Works like a charm! Thanks
__________________
condolent is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode