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-nmm8 (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-nmm8 (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-nmm8 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm8 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function not Checking?!
Author Message
Chukwuemeka
Apprentice
*

Posts: 12
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2016
Reputation: 0



Post: #1
Function not Checking?!
Hey folks,
I'm editing a level system script and I'm getting a problem.

Code:
[FUNCTION f_levelup]
f_show_xp_title
IF (<TAG0.EXP> >= <TAG0.LEVELUP>)
   SYSMESSAGE @030 You gain a level!
    TAG0.EXP=0
    TAG0.LEVELUP += 1000
    TAG0.MYLEVEL += 1

When I use it with a player, it checks the TAG and works great.

Code:
ON=@DEATHCORPSE
REF1 = <ARGO.MORE2>

IF (<REF1.ISPLAYER>) && (<i.ISNPC>)
    LOCAL.EXP_GAIN=<EVAL ((<i.STR> + <i.DEX>)/5)>
    REF1.TAG0.EXP += <dLOCAL.EXP_GAIN>
    SAY @030 You gain <eval <dLOCAL.EXP_GAIN>> experience.
    REF1.f_levelup
    RETURN 0
ENDIF

Now, I want to make summons and pets give the player EXP. It says I got the right EXP, but I always level up.

Code:
IF (<REF1.FLAGS> & statf_pet) && (<REF1.ISNPC>) && (<i.ISNPC>)
LOCAL.EXP_GAIN=<EVAL ((<i.STR> + <i.DEX>)/5)>
TRY UID.<REF1.MEMORYFINDTYPE.memory_ipet.LINK>.tag0.exp += <EVAL <LOCAL.EXP_GAIN>>
    SAY @030 You gain <eval <dLOCAL.EXP_GAIN>> experience.
    TRY UID.<REF1.MEMORYFINDTYPE.memory_ipet.LINK>.f_levelup
    RETURN 0
ENDIF

It seems to be missing this check (<TAG0.EXP> >= <TAG0.LEVELUP>).
Where am I going wrong?

Thank you!
11-11-2016 03:30 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Function not Checking?! - Chukwuemeka - 11-11-2016 03:30 AM
RE: Function not Checking?! - darksun84 - 11-11-2016, 09:31 PM
RE: Function not Checking?! - ShiryuX - 11-12-2016, 03:12 AM
RE: Function not Checking?! - Chukwuemeka - 11-13-2016, 09:27 PM

Forum Jump:


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