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

Problem with Frag remover MODS

domelxp

Member
Joined
Mar 1, 2010
Messages
243
Reaction score
5
hello all
i use tfs 0.4 dev and i have problem with frag remover
when i use this red scull disappear but after relog appears (back red scull)
how i can fixed ?

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag Remover" version="1.1" author="Hermes" contact="otland.net" enabled="yes">
<action itemid="9969" event="script"><![CDATA[
local noRemove = {SKULL_WHITE, SKULL_YELLOW}
local playerSkull = getPlayerSkullType(cid)
if isInArray(noRemove, playerSkull) then
doPlayerSendCancel(cid, "You can't remove this type of skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
elseif playerSkull == SKULL_NONE then
doPlayerSendCancel(cid, "You don't have skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
else
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSendTextMessage(cid, 27, "Your frags & your skull have been removed!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doSendAnimatedText(getPlayerPosition(cid), "POFF!", 180)
doCreatureSetSkullType(cid,0)
doPlayerSetSkullEnd(cid, 0, playerSkull)
doRemoveItem(item.uid, 1)
end
return true
]]></action>
</mod>





thx all
Domelxp
 
try this maby this would work and if any error apears psot it here

Code:
local noRemove = {SKULL_WHITE, SKULL_YELLOW}
local playerSkull = getPlayerSkullType(cid)
if isInArray(noRemove, playerSkull) then
doPlayerSendCancel(cid, "You can't remove this type of skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
elseif playerSkull == SKULL_NONE then
doPlayerSendCancel(cid, "You don't have skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
else
db.executeQuery("UPDATE `players` SET `skull = 0`, `skulltime = 0` WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")
doPlayerSendTextMessage(cid, 27, "Your frags & your skull have been removed!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doSendAnimatedText(getPlayerPosition(cid), "POFF!", 180)
doCreatureSetSkullType(cid,0)
doPlayerSetSkullEnd(cid, 0, playerSkull)
doRemoveItem(item.uid, 1)
end
return true
end
 
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag Remover" version="1.1" author="Hermes" contact="otland.net" enabled="yes">
<action itemid="9969" event="bufffer"><![CDATA[
	local noRemove = {SKULL_WHITE, SKULL_YELLOW}
	local playerSkull, pos = getPlayerSkullType(cid), getThingPos(cid)
	if isInArray(noRemove, playerSkull) then
		doPlayerSendCancel(cid, 'You can\'t remove this type of skull.')
		doSendMagicEffect(pos, CONST_ME_POFF)
	elseif playerSkull == SKULL_NONE then
		doPlayerSendCancel(cid, 'You don\'t have a skull.')
		doSendMagicEffect(pos, CONST_ME_POFF)
	else
		db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your frags & your skull have been removed!")
		doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
		doSendAnimatedText(pos, 'POFF!', COLOR_RED)
		doPlayerSetSkullEnd(cid, 0, playerSkull)
		doCreatureSetSkullType(cid, 0)
		doRemoveItem(item.uid, 1)
	end
	_result = true
]]></action>
</mod>
 
@Cykotitan

why dont the script has end at the end it stops at result = true
schuld there be a end after that? or am i day dreaming


and @domelxp

its not the same i changed the sql line check it up
 
@Cykotitan

why dont the script has end at the end it stops at result = true
schuld there be a end after that? or am i day dreaming

Because it doesn't have function onUse(...)
and @domelxp

its not the same i changed the sql line check it up

It won't do anything because it only updates data in database, and not on server. :p
 
Back
Top