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
How to remove key when redeed ship?
Author Message
WRWR
Journeyman
*

Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1



Post: #1
How to remove key when redeed ship?
How to remove key when redeed ship?
Code:
IF !(<src.gold> >= <eval <link.value>/10>) && !(<SRC.ISGM>)
src.sysmessage You don't have enough money.
ELSE
src.gold -= <eval <link.value>/10>
serv.newitem=i_deed_ship
new.more=<link.baseid>
new.name=<link.name> deed
new.bounce
link.remove
ENDIF
05-08-2012 02:53 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: #2
RE: How to remove key when redeed ship?
you can hold keys uids on a tag with ship under @create trigger of keys and remove them on dry dock like:

PHP Code:
[itemdef i_key_copper]
on=@create
timerf 1
,mark_ship

[function mark_ship]
ref1=<more1>
if !(<
ref1.type> = t_ship)
    return 
1
endif
for 
1 2
    
if (<ref1.tag0.key_<eval <local._for>>> = 0)
        
ref1.tag0.key_<eval <local._for>>=<uid>
        return 
1
    
endif
endfor    

[function 
deletekeys]
for 
1 2
    
if !(<tag0.key_<eval <local._for>>> = 0)
        
ref1=<tag0.key_<eval <local._for>>>
        if (<
ref1.type> = t_key)
            
ref1.remove
        
endif
    endif
endfor 
(This post was last modified: 05-08-2012 03:24 AM by Shaklaban.)
05-08-2012 03:22 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
WRWR
Journeyman
*

Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1



Post: #3
RE: How to remove key when redeed ship?
Keys is linked to REGION.UID and if i remove ship and save sphere my console says:
Code:
ERROR:'copper key' Bad Link to 040001de2
ERROR:UID=040001ddb, id=0100e 'copper key', Invalid code=2205 (Mislinked item)
how to fix it?
05-08-2012 03:26 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: How to remove key when redeed ship?
yeah they are linked and give an error on removal, it does not harm your server. but if you want to stop it you can look the example i gave you. i dont test it, its just an example. step by step its doing:

under @create trigger of copper key mark_ship function called with timerf 1. purpose of timerf is give sphere some time to assing key to ship.

mark_ship function stores uids of the keys on tag with ship.

on drydock, if you call deletekeys function on link reference (link.deletekeys), it will delete keys which uids stored on a tag with ship.

as i know there is no setting for this so you need to code it.
(This post was last modified: 05-08-2012 04:58 PM by Shaklaban.)
05-08-2012 04:57 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
WRWR
Journeyman
*

Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1



Post: #5
RE: How to remove key when redeed ship?
Thanks. its work and best way for me now
05-08-2012 09:47 PM
Find all posts by this user Like Post Quote this message in a reply
WRWR
Journeyman
*

Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1



Post: #6
RE: How to remove key when redeed ship?
key from bank is not removing 0_o
(This post was last modified: 05-09-2012 09:37 PM by WRWR.)
05-09-2012 09:36 PM
Find all posts by this user Like Post Quote this message in a reply
Gyros
Apprentice
*

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



Post: #7
RE: How to remove key when redeed ship?
Code:
[FUNCTION f_remove_keys]
forinstances i_key_copper
    if (<link>)
        if strmatch(*t_multi*,<link.type>)
            if (<link.more1> == <src>)
                link = -1
                remove
            endif
        endif
    endif
endfor

Code:
[FUNCTION shipkey_remove]
forinstances i_key_copper
    if (<more1>)
        if (<more1> == <args>)
            remove
        endif
    endif
endfor
(This post was last modified: 05-09-2012 09:51 PM by Gyros.)
05-09-2012 09:46 PM
Find all posts by this user Like Post Quote this message in a reply
WRWR
Journeyman
*

Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1



Post: #8
RE: How to remove key when redeed ship?
error in if (<more1> == <args>)
how to use your script?
for example if i redeed my ship via dialog button?
05-10-2012 12:21 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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