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
differencing races?
Author Message
XuN
Sphere Developer
*****

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



Post: #11
RE: differencing races?
06-10-2014 04:13 PM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #12
RE: differencing races?
Thank you both! Smile
06-11-2014 07:24 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #13
RE: differencing races?
Okey, for some reason i have this issue, might be nothing, but....

if equal race condition is set as for SRC as [] it works fine tried it human vs human; but when i set it to NOT equal like in the example below it doesnt work... ive tried a human vs elf, didnt work, gargoyle vs human didnt work.
PHP Code:
ON=@Hit
If (<WEAPON> && <WEAPON.TYPE> != T_WEAPON_BOW)
   if (<EVAL <
argo.TWOHANDS>> == 0)
      if (<
race> != <src.race>)
     
local.skillneeded=<<argo.skill>>
         if (<
local.skillneeded> >= 60.0)
          
SERV.B HELLO
     
endif
       endif
   endif
endif

[function 
race]
if (<
obody>==c_man || <obody>==c_woman)
return 
1
elseif (<obody>==c_elf_male || <obody>==c_elf_female)
return 
2
elseif (<obody>==c_gargoyle_male || <obody>==c_gargoyle_female)
return 
3
else
return -
1
endif 
(This post was last modified: 06-11-2014 09:15 AM by kn4tseb.)
06-11-2014 09:13 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #14
RE: differencing races?
PHP Code:
If (<ARGO.WEAPON> && <ARGO.WEAPON.TYPE> != T_WEAPON_BOW)
 IF (!<
ARGO.TWOHANDS>)
  IF(<
RACE> != <SRC.RACE>)
   IF(<<
ARGO.SKILL>> >= 60.0)
    
SERV.B HELLO
   
ENDIF
  ENDIF
 ENDIF
ENDIF 

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
(This post was last modified: 06-11-2014 09:50 AM by Extreme.)
06-11-2014 09:49 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #15
RE: differencing races?
thanks for the tip at twohands check ^^ saves some lines Big Grin

but race vs diff race check isnt working Sad
06-11-2014 10:58 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #16
RE: differencing races?
Who is <UID> and who is <SRC> ?

Put a SERV.B <NAME> <SRC.NAME> to check!

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
06-11-2014 12:06 PM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #17
RE: differencing races?
@hit
src= player being hit
and [] player making the hit... ill try what you say but i dont think its about that because when IF(<RACE> == <SRC.RACE>) is set, it works


EDITED: just checked

<SRC.NAME> = Player being hit
<NAME> = Player making the action
(This post was last modified: 06-11-2014 12:37 PM by kn4tseb.)
06-11-2014 12:33 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #18
RE: differencing races?
Well, it should work then.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
06-11-2014 12:46 PM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #19
RE: differencing races?
Should i try that under the function?

ok i re-checked everything, and this is what i got: when races check are equal, inside the function only at the ELSE side of the function it did work, the other ones didnt.. only the ELSE part

SRC is still the char being hit inside the function
and uid is still me
PHP Code:
[function race]
if (<
obody>==c_man || <obody>==c_woman)
//Serv.B <NAME> <SRC.NAME>
return 1
elseif (<obody>==c_elf_male || <obody>==c_elf_female)
//Serv.B <NAME> <SRC.NAME>
return 2
elseif (<obody>==c_gargoyle_male || <obody>==c_gargoyle_female)
//Serv.B <NAME> <SRC.NAME>
return 3
else
say hello hello hello hello
return -1
endif 

only works at "ELSE"
(This post was last modified: 06-11-2014 01:24 PM by kn4tseb.)
06-11-2014 01:12 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #20
RE: differencing races?
Okay, one tip: when comparing things, if you have more than one condition, you should use () on each condition.

Here you go:
PHP Code:
[FUNCTION RACE]
IF (<
OBODY> == C_MAN) || (<OBODY> == C_WOMAN)
 RETURN 
1
ELIF 
(<OBODY> == C_ELF_MALE) || (<OBODY> == C_ELF_FEMALE)
 RETURN 
2
ELIF 
(<OBODY> == C_GARGOYLE_MALE) || (<OBODY> == C_GARGOYLE_FEMALE)
 RETURN 
3
ELSE
 RETURN -
1
ENDIF 

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
06-11-2014 01:43 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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