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

[SNIPPET] GetEngineVersionCompat (use GetEngineVersion or GuessSDKVersion as needed)


Post New Thread Reply   
 
Thread Tools Display Modes
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 09-02-2013 , 13:12   Re: [SNIPPET] GetEngineVersionCompat (use GetEngineVersion or GuessSDKVersion as need
Reply With Quote #11

PHP Code:
decl String:gameFolder[8];
GetGameFolderName(gameFolderPLATFORM_MAX_PATH); 
KyleS is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-02-2013 , 13:17   Re: [SNIPPET] GetEngineVersionCompat (use GetEngineVersion or GuessSDKVersion as need
Reply With Quote #12

Quote:
Originally Posted by KyleS View Post
PHP Code:
decl String:gameFolder[8];
GetGameFolderName(gameFolderPLATFORM_MAX_PATH); 
Whoops. You'd almost think I changed the sizes while it was in development.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 09-03-2013 , 05:37   Re: [SNIPPET] GetEngineVersionCompat (use GetEngineVersion or GuessSDKVersion as need
Reply With Quote #13

Code:
if (StrEqual(gameFolder, "nd", false))
Should be:
Code:
if (StrEqual(gameFolder, "nucleardawn", false))
__________________
GoD-Tony is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 09-03-2013 , 08:57   Re: [SNIPPET] GetEngineVersionCompat (use GetEngineVersion or GuessSDKVersion as need
Reply With Quote #14

Quote:
Originally Posted by Powerlord View Post
Whoops. You'd almost think I changed the sizes while it was in development.
Not to be that guy, but this is why sizeof(variable) exists ;)
KyleS is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-03-2013 , 09:32   Re: [SNIPPET] GetEngineVersionCompat (use GetEngineVersion or GuessSDKVersion as need
Reply With Quote #15

Quote:
Originally Posted by GoD-Tony View Post
Code:
if (StrEqual(gameFolder, "nd", false))
Should be:
Code:
if (StrEqual(gameFolder, "nucleardawn", false))
Fixed now. Can you tell I don't actually have a Nuclear Dawn server?

Quote:
Originally Posted by KyleS View Post
Not to be that guy, but this is why sizeof(variable) exists ;)
I tend to use sizeof unless I'm dealing with a size constant... which it should have been in the first place. Apparently I replaced the sizeof with a constant and missed replacing the actual array size.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-03-2013 at 09:34.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-24-2016 , 21:27   Re: [SNIPPET] GetEngineVersionCompat (use GetEngineVersion or GuessSDKVersion as need
Reply With Quote #16

There's no point in using this snippet now as GetEngineVersion has been in SM since 1.5. If you're running a version older than that... why?

Edit: Anyway, you can cache the result of GetEngineVersion, usually by running it in OnPluginStart. It's not going to change once the server is running.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-24-2016 at 21:43.
Powerlord is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 09-25-2016 , 01:20   Re: [SNIPPET] GetEngineVersionCompat (use GetEngineVersion or GuessSDKVersion as need
Reply With Quote #17

Quote:
Originally Posted by Powerlord View Post
There's no point in using this snippet now as GetEngineVersion has been in SM since 1.5. If you're running a version older than that... why?

Edit: Anyway, you can cache the result of GetEngineVersion, usually by running it in OnPluginStart. It's not going to change once the server is running.
Whoops, I thought this was a newer snippet than it was. How the heck did I make that mista-oh wait marijuana, that's right.
404UserNotFound is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 09-25-2016 , 02:59   Re: [SNIPPET] GetEngineVersionCompat (use GetEngineVersion or GuessSDKVersion as need
Reply With Quote #18

in case SOURCE_SDK_EPISODE2VALVE: need to add
PHP Code:
else if (StrEqual(gameFolder"nmrih"false) || StrEqual(gameFolder"cure"false)) version Engine_SDK2013
for "No More Room in Hell" and "Codename CURE"
__________________
Grey83 is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 09-25-2016 , 03:29   Re: [SNIPPET] GetEngineVersionCompat (use GetEngineVersion or GuessSDKVersion as need
Reply With Quote #19

Quote:
Originally Posted by Grey83 View Post
in case SOURCE_SDK_EPISODE2VALVE: need to add
PHP Code:
else if (StrEqual(gameFolder"nmrih"false) || StrEqual(gameFolder"cure"false)) version Engine_SDK2013
for "No More Room in Hell" and "Codename CURE"
This is old, don't use this. How did you manage to miss the earlier posts stating this is old and not to use this?

Last edited by 404UserNotFound; 09-25-2016 at 03:30.
404UserNotFound is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 09-25-2016 , 03:39  
Reply With Quote #20

Quote:
Originally Posted by abrandnewday View Post
This is old, don't use this. How did you manage to miss the earlier posts stating this is old and not to use this?
I don't use it, as I have on the my own servers uses SM1.8
__________________

Last edited by Grey83; 09-25-2016 at 03:40.
Grey83 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 11:01.


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