• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

items no lose

Na Amigo

The crazy girl
Joined
Jun 5, 2017
Messages
254
Solutions
3
Reaction score
17
Location
Egypt
i want make to this vocations items no lose if they didn't wear an aol like marlboro ots
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27
-------------------
and this unique vocatation -> 25 all items down at once! like this photo
xmJdfG.png
if he didn't wear an aol and here is little vedio to explain more
 
Solution
X
I did not test, but I think this should work:
LUA:
if getPlayerVocation(cid) == 25 then
    for i = CONST_SLOT_FIRST, CONST_SLOT_LAST do
        local uid = getPlayerSlotItem(cid, i).uid
        if(uid > 0) then
            doRemoveItem(uid, 1)
        end
    end
end
A good solution, if you want to destroy the items.
I don't think this is what OP is wanting though.

I would suggest this solution, as I explained earlier.

-- edit
Lua - TFS 0.3.7 - Move item into container.. how?
This is the reason why you can't move the players items into the body itself.
Unless someone makes a break-through with copying all of the item attributes perfectly.. then this script could be changed to work without the red skull hack.
--...
Umm a hacky way to accomplish the removal of all items when die..
You could set the character with a red skull and a storage onPrepareDeath

They would drop the items, then when login you remove the red skull.

Are you still uaing tfs 0.3.7?
 
Umm a hacky way to accomplish the removal of all items when die..
You could set the character with a red skull and a storage onPrepareDeath

They would drop the items, then when login you remove the red skull.

Are you still uaing tfs 0.3.7?
yeah i'm using the 0.3.7 tfs i have reached this but this for only voc 1 and 2 and 3 and 4 and 5 i want make it from 1 to 27 without 25
this at login.lua
Code:
if getPlayerVocation(cid) ~= 25 and not getPlayerBlessing(cid, 6) then
    for i = 1, 6 do
        doPlayerAddBlessing(cid, i)
    end
end
 
I did not test, but I think this should work:
LUA:
if getPlayerVocation(cid) == 25 then
    for i = CONST_SLOT_FIRST, CONST_SLOT_LAST do
        local uid = getPlayerSlotItem(cid, i).uid
        if(uid > 0) then
            doRemoveItem(uid, 1)
        end
    end
end
 
I did not test, but I think this should work:
LUA:
if getPlayerVocation(cid) == 25 then
    for i = CONST_SLOT_FIRST, CONST_SLOT_LAST do
        local uid = getPlayerSlotItem(cid, i).uid
        if(uid > 0) then
            doRemoveItem(uid, 1)
        end
    end
end
A good solution, if you want to destroy the items.
I don't think this is what OP is wanting though.

I would suggest this solution, as I explained earlier.

-- edit
Lua - TFS 0.3.7 - Move item into container.. how?
This is the reason why you can't move the players items into the body itself.
Unless someone makes a break-through with copying all of the item attributes perfectly.. then this script could be changed to work without the red skull hack.
-- edit

I'm not exactly sure how yellow/orange skulls are implemented/assigned though.
This solution may not be ideal as orange/yellow skulls may become non-existent for vocation 25. I'm not sure.

Untested.

creaturescripts.xml
XML:
<event type="preparedeath" name="hope_it_works1" event="script" value="hope_it_works1.lua"/>
<event type="login" name="hope_it_works2" event="script" value="hope_it_works2.lua"/>
login.lua
LUA:
registerCreatureEvent(cid, "hope_it_works1")
registerCreatureEvent(cid, "hope_it_works2")
hope_it_works1.lua
LUA:
local storage = 45001
function onPrepareDeath(cid)
    local vocation = getPlayerVocation(cid)
    if vocation == 25 then
        if not isInArray({SKULL_RED, SKULL_BLACK}, getCreatureSkullType(cid)) then
            doCreatureSetSkullType(cid, SKULL_RED)
            setPlayerStorageValue(cid, storage, 1)
        end
        return true
    end
    if isInArray({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27}, vocation) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
        doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
    end
    return true
end
hope_it_works2.lua
LUA:
local storage = 45001
function onLogin(cid)
    if getPlayerStorageValue(cid, storage) == 1 then
        doCreatureSetSkullType(cid, SKULL_NONE)
        setPlayerStorageValue(cid, storage, 0)
    end
    return true
end
 
Last edited by a moderator:
Solution
Back
Top