SphereCommunity
Delete item based in uid - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Delete item based in uid (/Thread-Delete-item-based-in-uid)



Delete item based in uid - pushim - 03-25-2015 01:47 PM

if i wish delete a item, but using the UID, how do this?


RE: Delete item based in uid - azmanomer - 03-25-2015 05:21 PM

uid.<blabla>.remove

blabla is the uid of item


RE: Delete item based in uid - pushim - 03-25-2015 08:23 PM

Perfect thx Smile


RE: Delete item based in uid - JohnVeritas - 03-27-2015 08:44 AM

Item uid remover;

Code:
[FUNCTION iur]
FORITEMS 6144 //once again it checks the entire map
    IF (<uid> == <ARGS>) //if this arguement is met
        REMOVE //remove it
    ENDIF //end the IF arguement
ENDFOR //end the FOR loop

If you knew the uid that you want to remove just type .iur <uid> this function will be delete typed uid automaticly (only items). If you want to remove chars with this script just change foritems to forchars.


RE: Delete item based in uid - an0n!m0use - 03-27-2015 06:12 PM

Code:
[FUNCTION removeitem]
FORINSTANCES <ARGS>
REMOVE
SERV.LOG <ARGS>, <AMOUNT> has been REMOVED.
ENDFOR
    
[FUNCTION removeitem_2] // without DEFNAME
FORITEM <SERV.ITEMS>
IF <BaseID>==<ARGS>
    REMOVE
ENDIF
ENDFOR



RE: Delete item based in uid - Coruja - 03-29-2015 05:06 PM

you can use FOR* loop if you need to delete many items based on same DISPID / BASEID / NAME / whatever

but to delete just 1 item you doesn't need loop through all items/chars, just use directly UID.<uid_here>.REMOVE