Raised This Month: $ Target: $400
 0% 

Solved [H3LP] Check portion of mapname


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-15-2017 , 20:07   Re: [H3LP] Check portion of mapname
Reply With Quote #1

PHP Code:
if(equal(szCurMapszMapstrlen(szMap))) 
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
LegacyCode
Member
Join Date: Apr 2017
Old 04-16-2017 , 01:26   Re: [H3LP] Check portion of mapname
Reply With Quote #2

Quote:
Originally Posted by OciXCrom View Post
PHP Code:
if(equal(szCurMapszMapstrlen(szMap))) 
He said szMap (from the .ini file) is smaller than szCurMap, e.g. only a portion or "prefix" of the maps he wants to target.

This code checks if szCurMap contains szMap at position 0, so the beginning of szCurMap (contain & containi both return the position of where the string was found in the source string):

PHP Code:
if ( containszCurMapszMap ) == 
If szCurMap is ab2_2_1 and szMap is ab2_2, it should return 0 and therefore work as expected.

I hope I understood your problem, if not feel free to share more detailed info.

- LegacyCode

Last edited by LegacyCode; 04-16-2017 at 01:27.
LegacyCode is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-16-2017 , 05:46   Re: [H3LP] Check portion of mapname
Reply With Quote #3

Quote:
Originally Posted by LegacyCode View Post
He said szMap (from the .ini file) is smaller than szCurMap, e.g. only a portion or "prefix" of the maps he wants to target.

This code checks if szCurMap contains szMap at position 0, so the beginning of szCurMap (contain & containi both return the position of where the string was found in the source string):

PHP Code:
if ( containszCurMapszMap ) == 
If szCurMap is ab2_2_1 and szMap is ab2_2, it should return 0 and therefore work as expected.

I hope I understood your problem, if not feel free to share more detailed info.

- LegacyCode
Actually OciXCrom's code does the same thing. Take a look at what the third param does and what he passed as an argument to it.
klippy is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-16-2017 , 07:31   Re: [H3LP] Check portion of mapname
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
PHP Code:
if(equal(szCurMapszMapstrlen(szMap))) 
Thanks !
DarthMan 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 17:53.


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