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

Solved Long type support in Sourcemod?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Skyy
AlliedModders Donor
Join Date: Jan 2010
Location: Toronto, Canada
Old 02-08-2024 , 08:05   Long type support in Sourcemod?
Reply With Quote #1

Simple question... Is it supported, and if not, has anyone managed to find an extension adding support for it? Currently storing large integers in a string, generated as unique ID's for persistent loot (think diablo) but looking for a better solution.

Last edited by Skyy; 02-08-2024 at 23:43.
Skyy is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-08-2024 , 22:23   Re: Long type support in Sourcemod?
Reply With Quote #2

...32bit program.
There is tricks, to use array size 2. Higher value and lower value.
SM formattime is able to use those.

*edit
64bit string to int... hmmm

https://sm.alliedmods.net/new-api/string/Int64ToString
https://sm.alliedmods.net/new-api/string/StringToInt64


https://github.com/alliedmodders/sourcemod/pull/1511




https://sm.alliedmods.net/new-api/keyvalues/KvGetUInt64

https://sm.alliedmods.net/new-api/keyvalues/KvSetUInt64
__________________
Do not Private Message @me

Last edited by Bacardi; 02-08-2024 at 23:27.
Bacardi is offline
Skyy
AlliedModders Donor
Join Date: Jan 2010
Location: Toronto, Canada
Old 02-08-2024 , 23:42   Re: Long type support in Sourcemod?
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
yeah, I know that it's a 32bit program, but was curious if anyone really had any tricks to work around it =)
I see https://sm.alliedmods.net/new-api/string/StringToInt64 seems to follow the array[2] putting half in the 0 and half in the 1. That's actually really cool.

I do believe that how little I'm calling the unique ID that it shouldn't be a problem keeping it as a string, but it's great to have this option as well!

Thanks for making me aware of these calls as well, though! I'm not sure why I didn't think to just split the number in half.
Skyy 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 15:11.


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