Trying to convert this script to 1.x but I don't know how to call it since 1.x doesn't support this function
can someone rewrite it or gives some hint info how to call it in 1.x?
Thanks in advance!
P.S The idea is that I need spectife vocations drop their loot with red skull when they die and the other vocations save their items from lossing.
Edit:-
when the character dies there's nothing happen no error in console or anything.
Code:
doPlayerSetLossPercent
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,}, vocation) then
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
end
return true
end
Lua:
local storage = 45001
function onPrepareDeath(cid)
local player = Player(cid)
if not player then
return false
end
local vocation = player:getVocation():getId()
if vocation == 25 then
if not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
player:setSkull(SKULL_RED)
player:setStorageValue(storage, 1)
end
return true
end
if isInArray({1, 3, 4}, vocation) then
return true
end
end
P.S The idea is that I need spectife vocations drop their loot with red skull when they die and the other vocations save their items from lossing.
Edit:-
when the character dies there's nothing happen no error in console or anything.
Last edited: