The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Check <P>?
Author Message
mlyon83
Apprentice
*

Posts: 44
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2013
Reputation: 0



Post: #1
How to Check <P>?
elseif strmatch("<region.name>","Isabela")
if (<argn> == 45) || (<argn> == 52)
if !strmatch("<p>","3975,1087")
sysmessage @00 You can only cast Mark and Gate Travel on the town Altar for <REGION.NAME>.
return 1
endif
endif

endif

This doesn't seem to allow me to cast Mark at the position shown. Any idea what im doing wrong?
06-20-2013 05:17 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #2
RE: How to Check <P>?
<p> should be "x,y,z,map", right?
06-20-2013 05:30 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: How to Check <P>?
I remember that i read somewhere ( forum,chat or bugtracker) that string that contains commas can actually gives problem when used as argument in a string matching function.
Like that Sphere consider the characters after the commas as a "new" argument.

So if i am correct your function compares <p> with just 3975.

I'll do a test in some minutes

Lol at the end it worked fine for me :\

I don't know then :\
(This post was last modified: 06-20-2013 06:16 AM by darksun84.)
06-20-2013 06:07 AM
Find all posts by this user Like Post Quote this message in a reply
Shidhun
Journeyman
*

Posts: 59
Likes Given: 5
Likes Received: 3 in 3 posts
Joined: Jul 2012
Reputation: 1



Post: #4
RE: How to Check <P>?
Split the coordinates into <p.x>,<p.y> (evtentually also <p.z>)

if !((strmatch("<p.x>","3975") && (strmatch("<p.y>","1087"))
sysmessage @00 You can only cast Mark and Gate Travel on the town Altar for <REGION.NAME>.
return 1
endif

this should work as intented
06-20-2013 07:46 AM
Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #5
RE: How to Check <P>?
why would you use strmatch to compare numbers?
if (<p.x> == 3975) && (<p.y> == 1087) would be a much better choice.
And as Alaric said... if using <p>, then you need to consider the Z and Map cordinate or else you will never get a match... unless you do
if !strmatch("3975,1087*","<p>")
The * in here will alows for any wildcard characters.
Also, if using STRMATCH, you should alway have your pattern as the first argument, not the second.

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
(This post was last modified: 06-20-2013 10:10 AM by Ben.)
06-20-2013 10:09 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)