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-nmm7 (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-nmm7 (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-nmm7 (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
Adding/Removing TAGs
Author Message
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #4
RE: Adding/Removing TAGs
TAG's are like memory items, except they are not items.

They are character based (Unless you use account.tag) and you can set them to a value or a string and then call them using those same values or strings.

In your case, you can't be sure if a player has enough "numbers" in the TAG.statp, so you use TAG0.statp. If the player has no tag.statp, it will return 0, else it will return 1. If you used TAG.statp instead, it would return an error.

Althought it may work, what azmanomer said isn't totally correct, because if "IF <src.tag0.statp>" returns 1, it means you have that tag, so you only need to use SRC.TAG.STATP -=1 and not SRC.TAG0.STATP -=1 after it. See what I mean? As soon as you check that a player has a tag, you don't need to use tag0 anymore. It is only used so it doesn't return an error in case it doesn't exist.

If your tag.statp was a string and not a number, you couldn't use the IF (<SRC.TAG0.STATP>). You would have to use something like IF STRMATCH("<TAG.STATP>","")

Why? Lets see some examples:

Lets say you want to check if a player doesn't have a tag=string:

IF STRMATCH("<SRC.TAG.FACTION>","")
SRC.SYSMESSAGE Player has no faction.
ELSE
SRC.SYSMESSAGE Player has faction.
ENDIF

If you don't have any TAG.FACTION, then you will read the sysmessage "Player has no faction".

If you used "IF STRMATCH("<SRC.TAG0.FACTION>","")" instead, you would read "Player has faction." Why? Because 0 isnt "" (empty).

Using IF STRMATCH("<SRC.TAG.FACTION>","") is the same as using IF STRMATCH("<SRC.TAG0.FACTION>","0"). As I said, if you don't have the TAG.FACTION, this last function will return 0, which is = 0, so it's like if it returned 1.

Think I explained myself correctly xD
(This post was last modified: 08-25-2015 12:05 PM by pointhz.)
08-25-2015 12:01 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes pointhz's post
Post Reply 


Messages In This Thread
Adding/Removing TAGs - Osirirs - 08-25-2015, 02:16 AM
RE: Adding/Removing TAGs - azmanomer - 08-25-2015, 02:38 AM
RE: Adding/Removing TAGs - Osirirs - 08-25-2015, 09:22 AM
RE: Adding/Removing TAGs - pointhz - 08-25-2015 12:01 PM
RE: Adding/Removing TAGs - Osirirs - 08-28-2015, 07:39 AM

Forum Jump:


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