• 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!

Lua Remove frags

Fiodor

Lua & Maps
Joined
Mar 14, 2009
Messages
400
Reaction score
10
Location
Poland
Is in TFS some function, witch removes frags? I found skull remover in internet, but it doesn;t work, because it doesn't remove frags [skull disappears and after relog is again].
function onUse(cid, item, frompos, item2, topos)
local zabieraLadunki = "tak" -- Czy zabiera ladunki runy
local usuwaRedSkulla = "tak" -- Czy usuwa red skulla
if((getPlayerSkullType(cid) ~= SKULL_RED or usuwaRedSkulla == "tak") or getPlayerSkullType(cid) ~= SKULL_GREEN) then
doCreatureSetSkullType(cid, SKULL_NONE)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You don't have any skull now.")
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MAGIC_RED)
doPlayerSetRedSkullTicks(cid, 0)
else
doPlayerSendCancel(cid,"You can't remove red or green skull.")
end
if(zabieraLadunki == "tak") then
if(item.type > 1) then
doChangeTypeItem(item.uid, item.type-1)
else
doRemoveItem(item.uid,1)
end
end
end
bad function

TFS Crying Damson 0.3.5
 
how i add all??.. im not scripter and is hard to me know where, how and what do to active it ._.

please help?

Make a new file in "data\actions\scripts\other" called this
skullremover.lua
and put this code in the Lua file:
Code:
function onUse(cid, item, frompos, item2, topos)
       
        local nonremskulls =    -- These are the skulls it cant remove. If player has any of these, the rune wont work.
{
        white = SKULL_WHITE
}

        if isInArray(nonremskulls, getPlayerSkullType(cid)) then
                doPlayerSendCancel(cid,"You can't remove this type of skull.")
                doSendMagicEffect(getPlayerPosition(cid),2)
        else
                db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
                doCreatureSetSkullType(cid,0)
                doPlayerSendTextMessage(cid,27,"Your frags & your skull have been removed, thanks for donating!")
                doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MAGIC_RED)
				doSendAnimatedText(getPlayerPosition(cid), "Removed!", 180)
                doRemoveItem(item.uid, 1)
        return TRUE
        end
end

go into "data>actions" and open "actions.xml"
add this line somewhere
Code:
	<action itemid="XXXX" event="script" value="others/skullremover.lua"/>
Change the itemid to the item you want to use, and you're done <_<
 
Back
Top