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
Need help in general Scripting
Author Message
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #45
RE: Need help in general Scripting
Use what criminal wrote, it is all that you need.


However i'm going to explain you some things you had wrong on your code in case you can make use of it on the future:
IF (<VAR0.f_spell_is_aggressive> = 1) //WRONG: One = means 'set', in this case you are setting that VAR to 1 everytime so you are forcing Sphere to automatically pass this check always.
IF (<VAR0.f_spell_is_aggressive> == 1) // Double = means compare, this is what you must use when comparing values.

NOTE: Functions can return values, there is no need to store anything on VARs to check them later:

Code:
[FUNCTION f_test]
if (<serv.spell.<argn1>.flags>&spellflag_harm)
return 1
endif
return 0

ON=@SpellEffect
if (<f_test <argn1>> == 1) // So you don't need to set a VAR and check for it later, you can do it all at once.
SRC.SYSMESSAGE You cannot harm players in this dungeon.
return 1
endif
(This post was last modified: 05-04-2016 04:30 PM by XuN.)
05-04-2016 04:29 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Need help in general Scripting - Fronz - 04-21-2016, 10:24 AM
RE: Need help in general Scripting - Fronz - 04-23-2016, 12:03 AM
RE: Need help in general Scripting - Fronz - 04-23-2016, 11:41 PM
RE: Need help in general Scripting - Fronz - 04-24-2016, 03:21 AM
RE: Need help in general Scripting - Fronz - 04-24-2016, 09:25 AM
RE: Need help in general Scripting - Fronz - 04-25-2016, 02:10 AM
Need help in general Scripting - roberpot - 04-25-2016, 03:26 PM
Need help in general Scripting - roberpot - 04-26-2016, 12:00 AM
Need help in general Scripting - roberpot - 04-26-2016, 02:57 AM
Need help in general Scripting - roberpot - 04-26-2016, 02:57 PM
Need help in general Scripting - roberpot - 04-26-2016, 10:31 PM
Need help in general Scripting - roberpot - 04-26-2016, 11:23 PM
Need help in general Scripting - roberpot - 04-26-2016, 11:29 PM
Need help in general Scripting - roberpot - 04-27-2016, 02:50 AM
RE: Need help in general Scripting - Fronz - 04-27-2016, 04:32 AM
Need help in general Scripting - roberpot - 04-27-2016, 04:59 AM
Need help in general Scripting - roberpot - 04-27-2016, 08:37 AM
RE: Need help in general Scripting - Fronz - 04-27-2016, 12:58 PM
RE: Need help in general Scripting - XuN - 04-27-2016, 04:07 PM
RE: Need help in general Scripting - Fronz - 04-28-2016, 06:32 AM
RE: Need help in general Scripting - Fronz - 05-01-2016, 11:46 AM
RE: Need help in general Scripting - Fronz - 05-02-2016, 12:53 AM
RE: Need help in general Scripting - XuN - 05-02-2016, 06:48 PM
RE: Need help in general Scripting - Fronz - 05-03-2016, 12:10 AM
RE: Need help in general Scripting - XuN - 05-03-2016, 01:09 AM
RE: Need help in general Scripting - Fronz - 05-03-2016, 01:40 AM
RE: Need help in general Scripting - Fronz - 05-04-2016, 10:04 AM
RE: Need help in general Scripting - XuN - 05-04-2016 04:29 PM
RE: Need help in general Scripting - Fronz - 05-10-2016, 01:05 PM
RE: Need help in general Scripting - Fronz - 05-16-2016, 10:25 AM
RE: Need help in general Scripting - Fronz - 05-17-2016, 02:34 AM
RE: Need help in general Scripting - Fronz - 05-28-2016, 09:27 PM

Forum Jump:


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