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

[ H3LP ] Check if Trie Key Exists


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 05-30-2018 , 04:00   [ H3LP ] Check if Trie Key Exists
Reply With Quote #1

Hello. I've been looking on the Sourcemod Scripting API Reference but I can't find a way to check if a key of a trie exists. For AMXX there's already a command to check, TrieKeyExists, but there's nothing like that for SourceMod. Thanks !
DarthMan is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 05-30-2018 , 04:40   Re: [ H3LP ] Check if Trie Key Exists
Reply With Quote #2

I don't think theres any StringMap functions that are exclusively for checking if a value exists. However, GetValue (or any other StringMap Get* function) returns a bool that tells you whether that key exists or not. You have to be careful since it also returns false when you call GetValue on a string/array type though.

Last edited by hmmmmm; 05-30-2018 at 04:41.
hmmmmm is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 05-30-2018 , 05:59   Re: [ H3LP ] Check if Trie Key Exists
Reply With Quote #3

Quote:
Originally Posted by hmmmmm View Post
I don't think theres any StringMap functions that are exclusively for checking if a value exists. However, GetValue (or any other StringMap Get* function) returns a bool that tells you whether that key exists or not. You have to be careful since it also returns false when you call GetValue on a string/array type though.
Thanks !
DarthMan 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 22:14.


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