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
DispID
Author Message
Q23A
Apprentice
*

Posts: 30
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #1
DispID
Hello. Have can check items in mul?
Example if i create i_stairs_wood _2, than I can check it with this if (<dispid> == i_stairs_wood_2)
But have can I check the same item if it is not created item, but it is in .mul.
06-08-2012 07:19 PM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #2
RE: DispID
You can use serv.defname.

if (<src.defname> == <serv.defname.i_stairs_wood_2>)

This way, you don´t need to create any item, you directly seek in the object "server". i_stairs_wood_2 definition and all his properties who are below his [ITEMDEF xxxx]
DEFNAME=i_stairs_wood_2...
(This post was last modified: 06-09-2012 12:13 AM by Gil Amarth.)
06-09-2012 12:12 AM
Find all posts by this user Like Post Quote this message in a reply
Q23A
Apprentice
*

Posts: 30
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #3
RE: DispID
This is not what I need:

[function checkforitems]
foritems 0
if (<baseid> == i_box_box)
remove
return 1
elif (<dispid> == i_stairs_wood_2) - Stairs find only if I create it with .add I_stairs_wood_2,but I need that it check i_stairs_wood_2 what is already in .mul file. this is my tournament arena wall.
return 1
endif
endfor
06-09-2012 02:59 AM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #4
RE: DispID
you can use isneartype function:

[ITEMDEF 0720]
DEFNAME=i_STAIRS_WOOD
type=t_bla_bla
RESOURCES=50 I_BOARD
CATEGORY=Buildings - Stairs
SUBSECTION=Wooden Stairs (light)
DESCRIPTION=@
DUPELIST=0721,0722,0723,0724,0725,0726,0727,0728,0729,072a,072b,072c,072d,072e,0​72f,0730,0731,0732,0733,0734,0735

[typedef bla_bla]

[function checkforitems]
...
elif (<isneartype t_bla_bla>
return 1
endif
06-09-2012 04:02 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
jeem
Apprentice
*

Posts: 33
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Mar 2012
Reputation: 3



Post: #5
RE: DispID
And if you don't want to change the item's type, check the statics functions here: http://wiki.sphere.torfo.org/index.php/Map_Points
06-09-2012 07:02 AM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #6
RE: DispID
Maybe you can use:

elif (<dispid> == <serv.itemdef.i_stairs_wood_2.dispid>)


You can´t directly access to .mul files, somewhere in your scripts there is a ITEMDEF definition who tells Sphere which direction in .mul files has to look.
In this case:

[ITEMDEF xxxxx] // Where xxxxx is the hexadecimal number at .mul files
DEFNAME = i_stairs_wood_2

It´s where sphere knows where have to look. If you want to know a property without create a item, you have to use SERV.ITEMDEF.i_stairs_wood_2.whatever

There is no other way.
06-09-2012 06:55 PM
Find all posts by this user Like Post Quote this message in a reply
Q23A
Apprentice
*

Posts: 30
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #7
RE: DispID
Not working, but anyway thank you. I gonna try something else.
06-10-2012 01:35 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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