Raised This Month: $ Target: $400
 0% 

How to get value of a pubvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-14-2014 , 16:19   How to get value of a pubvar
Reply With Quote #1

How can I get a value of a pubVar in a plugin?

Last edited by WildCard65; 06-14-2014 at 16:46.
WildCard65 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-15-2014 , 00:20   Re: How to get value of a pubvar
Reply With Quote #2

GetPubvarAddrs
__________________
asherkin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-15-2014 , 08:00   Re: How to get value of a pubvar
Reply With Quote #3

Does it work with booleans?
WildCard65 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-15-2014 , 10:36   Re: How to get value of a pubvar
Reply With Quote #4

Of course, it's just getting you a memory address.
__________________
asherkin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-16-2014 , 11:25   Re: How to get value of a pubvar
Reply With Quote #5

Does it only work with structs?
WildCard65 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-16-2014 , 11:28   Re: How to get value of a pubvar
Reply With Quote #6

It's just getting you a memory address, it works with any data type.
__________________
asherkin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-16-2014 , 11:30   Re: How to get value of a pubvar
Reply With Quote #7

Can you show me an example for the following?
Strings
anything non-arrays not strings
arrays not strings
structs of strings and non-strings and non-string arrays

Last time I tried with strings, it ended up giving me a blank string when the var itself had a value
WildCard65 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-16-2014 , 11:37   Re: How to get value of a pubvar
Reply With Quote #8

What are you trying to use them for?
__________________
asherkin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-16-2014 , 11:51   Re: How to get value of a pubvar
Reply With Quote #9

In short terms:
I'm working on a head start ff2 2.0.0 alpha from scratch and I want a more versatile sub plugin system where the following commands aren't needed to be executed by the main plugin (sm plugins load/unload) so that all sub plugins of FF2 can reside in the subplugin folder (freaks) without risk of being reloaded when it doesn't want to, also with a system to allow subplugins to choose if they want loaded on round start or map start and unloaded when map ends or round ends.
But... I can't rely on plugin handles as if the plugin is reloaded via the console commands, the handle is lost and screws up the main plugin.
So to work around this (hopefully), I'm making an extension to SourceMod that holds a reference to subplugins via IPlugin class with plugin listeners but it comes down to distinguishing subplugins from other plugins which as a temporarly solution is just use a forward and locate it, but ultimately, I would like a struct to locate with different variable types (like bools, cells, strings, functions that match a functag, etc) and grab those values of the pubvar if it's found.
WildCard65 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 05:31.


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