Raised This Month: $12 Target: $400
 3% 

[Request] Global Static Constant Declaration


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dustinandband
Senior Member
Join Date: May 2015
Old 03-13-2018 , 04:10   [Request] Global Static Constant Declaration
Reply With Quote #1

https://github.com/TGMaster/Scriptin...lerpmonitor.sp

Lines 31 - 52

I'm curious what the purpose of using the "static" type gives for these global constants, handles, and booleans?

The Sourcemod documentation on static variables was too short and the only other thread I was able to find on the subject of 'static types' was in the AMX Mod Snippets thread, also from 2006, so I'm not sure if it's relevant to sourcemod.
dustinandband is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 03-13-2018 , 05:24   Re: [Request] Global Static Constant Declaration
Reply With Quote #2

This isn't a snippet or a tutorial so you're asking in the wrong section.
Regardless, static when in global namespace means that it can't be used by other files that include that file although it seems pretty useless in that context. AFAIK its generally used for include files (.inc) so as not to pollute global namespace.

Also the const is pretty useless for global variables from what I understand, only usable in function params.
hmmmmm is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 05-02-2018 , 22:21   Re: [Request] Global Static Constant Declaration
Reply With Quote #3

The static context is the same for SourceMod as it is AMXMod and that thread is more or less up to date as nothing has changed. "static" in a global scope in a plugin would more or less be useless and its the exact same thing as declaring it in the global scope, only declaring it gives it a default value. And what hmmmmm said.
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
Reply


Thread Tools
Display Modes

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 01:13.


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