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
NPCs acting like their are in a guild...
Author Message
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #1
NPCs acting like their are in a guild...
since we cant have npcs in a guild, im trying to figure out a way to make it look like they are in your guild...


Code:
[EVENTS e_army_wei]
ON=@NPCSEENEWPLAYER
IF (<src.tag.army>=WEI)
TAG.NAME.HUE 03f
Say Hail Friend!
RETURN 0
ELSEIF (<src.tag.army>=WU) || (<src.tag.army>=SHU) || (<src.tag.army>=YS) || (<src.tag.army>=LB) || (<src.tag.army>=YT) || (<src.tag.army>=MH)
TAG.NAME.HUE 090
Say Attack the soldier of <src.tag.army>!
ATTACK
RETURN 0
ELSEIF (<src.iscriminal>=1) || (<src.kills>>3)
Say Beat it criminal!
ATTACK
RETURN 0
ENDIF


i cant get this to work...

is there a better way?
problem with this is, if the npcs sees a different player, the first player then sees the wrong color...

Dragons of Time 2000-2020
http://dragonsoftime.com
01-05-2015 02:25 PM
Find all posts by this user Like Post Quote this message in a reply
evening
Journeyman
*

Posts: 138
Likes Given: 0
Likes Received: 14 in 9 posts
Joined: Apr 2012
Reputation: 1

Finally Land

Post: #2
RE: NPCs acting like their are in a guild...
[EVENTS e_army_wei]
ON=@click
IF (<src.tag.army>=WEI)
MESSAGE @03F <NAME>
Say Hail Friend!
ELSEIF (<src.tag.army>=WU) || (<src.tag.army>=SHU) || (<src.tag.army>=YS) || (<src.tag.army>=LB) || (<src.tag.army>=YT) || (<src.tag.army>=MH)
MESSAGE @090 <NAME>
Say Attack the soldier of <src.tag.army>!
ATTACK
ELSEIF (<src.iscriminal>=1) || (<src.kills>>3)
Say Beat it criminal!
ATTACK
ENDIF
RETURN 1
01-05-2015 03:55 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

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



Post: #3
RE: NPCs acting like their are in a guild...
ELSEIF (<src.tag.army>=WU) || (<src.tag.army>=SHU) || (<src.tag.army>=YS) || (<src.tag.army>=LB) || (<src.tag.army>=YT) || (<src.tag.army>=MH)

One = means SET; ie STR=100, double == means comparison; ie if ( <str> == 100 ).

Anyway you can't compare strings, you have to use something like this: ELSEIF ( STRCMP("<src.tag.army>","WU")==0) || ...
01-05-2015 05:33 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #4
RE: NPCs acting like their are in a guild...
11:58:ERROR:(SPHERE_ARMY_WEI.scp,20)Undefined symbol 'WU'
11:58:ERROR:(SPHERE_ARMY_WEI.scp,20)Undefined symbol 'WEI'


hmmmm

Dragons of Time 2000-2020
http://dragonsoftime.com
01-06-2015 02:58 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #5
RE: NPCs acting like their are in a guild...
seems like im having trouble with a text tag... if i use numbers it works

Code:
[EVENTS e_army_wei]
ON=@NPCSEENEWPLAYER
//ON=@click
IF (<src.tag.army>=04000)
TAG.NAME.HUE 03f
Say Hail Friend!
RETURN 0
ELSEIF (<src.tag.army>=04001) || (<src.tag.army>=04002) || (<src.tag.army>=04003) || (<src.tag.army>=04004) || (<src.tag.army>=04005) || (<src.tag.army>=04006)
TAG.NAME.HUE 090
Say Attack the soldier of <SRC.MEMORYFINDTYPE.0400.NAME>!
ATTACK
RETURN 0
ELSEIF (<src.kills>>3) //(<src.iscriminal>=1) ||
Say Beat it criminal!
ATTACK
RETURN 0
ELSEIF (<SRC.MEMORYFINDTYPE.0400.LINK>>040004010)//every players guild
Say Attack the soldier of <SRC.MEMORYFINDTYPE.0400.NAME>!
ATTACK
RETURN 0
ENDIF
RETURN 1

Dragons of Time 2000-2020
http://dragonsoftime.com
01-06-2015 03:13 PM
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: #6
RE: NPCs acting like their are in a guild...
Anyway, as they told, you must use == for comparing
(This post was last modified: 01-06-2015 08:06 PM by darksun84.)
01-06-2015 08:06 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: #7
RE: NPCs acting like their are in a guild...
lol..

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.
01-07-2015 07:09 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #8
RE: NPCs acting like their are in a guild...
getting closer....

Code:
[EVENTS e_army_wei]
//ON=@NPCSEENEWPLAYER
ON=@click
IF (STRCMPI("<src.tag.army>","Wei")==0)
TAG.NAME.HUE 03f
Say Hail Friend!
RETURN 0
ELSE
IF (STRCMPI("<src.tag.army>","Wu")==0)  || (STRCMPI("<src.tag.army>","Shu")==0)  || (STRCMPI("<src.tag.army>","YS")==0)  || (STRCMPI("<src.tag.army>","LB")==0)  || (STRCMPI("<src.tag.army>","YT")==0)  || (STRCMPI("<src.tag.army>","MH")==0)  
TAG.NAME.HUE 090
Say Attack the soldier of <SRC.TAG.ARMY>!
ATTACK
RETURN 0
ELSE
IF (<src.kills>>3) || (<src.criminal>==1)//(<flags>&statf_criminal)LINE15
Say Beat it criminal!
ATTACK
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>>040004010)//every players guild
Say Attack the soldier of <SRC.MEMORYFINDTYPE.0400.NAME>!
ATTACK
RETURN 0
ELSE
IF (<src.tag.army>==0)//LINE25
RETURN 0
ENDIF
RETURN 1


20:47:ERROR:(SPHERE_ARMY_WEI.scp,15)Can't resolve <src.criminal>
20:47:ERROR:(SPHERE_ARMY_WEI.scp,15)Undefined symbol ''
20:47:ERROR:(SPHERE_ARMY_WEI.scp,25)Undefined symbol ''


whats wrong with line 15 and 25?

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 01-24-2015 11:52 AM by x77x.)
01-24-2015 11:51 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

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



Post: #9
RE: NPCs acting like their are in a guild...
ON=@click
serv.log SRC is <src.name> (<src.uid>)// place this line under @Click to see who is the SRC in the function, Items can't be criminals and I bet this is the problem (It is weird, I know...).

and line 25 ... <src.tag.army> returns '' (no value) if the tag doesn't exists, use <src.tag0.army> instead for tags that can not be present on the checking character/item/etc.
01-25-2015 01:26 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #10
RE: NPCs acting like their are in a guild...
found this in another script... seems to work

Code:
IF (<SRC.TARG.FLAGS>&statf_criminal) || (<SRC.TARG.KILLS> >= 3 ) || (<SRC.TARG.KARMA> <= -2000 )
Say Beat it criminal!
ATTACK
RETURN 0

Dragons of Time 2000-2020
http://dragonsoftime.com
01-25-2015 07:04 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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