• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Frag Remover / Skull Remover

Leon Zawodowiec

Leon The Professional
Joined
Apr 5, 2010
Messages
36
Reaction score
4
Location
Poland
Name: Frag Remover / Skull Remover
Compatibility: TFS 0.3.6 PL [8.54]
Author: Leon Zawodowiec / Mag Egzorcysta
Description: Automatically and instantly removes Skull (Black or Red) with Frags from Data Base. Not working on a white skull.

Script:
Lua:
-- Scripted by Leon Zawodowiec --
function onUse(cid, item, frompos, item2, topos)
	local playerskull = getCreatureSkullType(cid)
	local skulls = {
					SKULL_NONE,
					SKULL_YELLOW,
					SKULL_GREEN,
					SKULL_WHITE
					}
 
	if isInArray(skulls, playerskull) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove that skull !")
		return 0
	else
		doCreatureSetSkullType(cid, skulls[1])
		doRemoveItem(item.uid, 1)
		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 Skull has been removed !")
	end
return true
end

In Actions.xml paste:
Code:
<action itemid="9969" event="script" value="skull.lua"/>
Of course dont forget remove loot of this item from mobs: "Hellspawn, Infernalist"
Or create own item ! ;)
Yours - Mag Egzorcysta / Leon Zawodowiec
 
Last edited:
Why don't you use "elseif"? xD

Code:
function onUse (cid, item, fromPosition, itemEx, toPosition)
  local skull = getCreatureSkullType(cid)
  if skull >= 4 then
    if doPlayerRemoveItem(cid, 9969, 1) then
    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!")
    doPlayerSetSkullEnd(cid, 0, getPlayerSkullType(cid))
      doRemoveItem(item.uid, 1)
   end
  end
 else
      doPlayerSendCancel (cid,"You can only remove red & black skull!")
  return true
end
 
Last edited:
it has a white skull bug, you get a white skull after you remove your red skull and log on/off.
 
it was made by Hermis or w/e his name first, then you guys just edited the msgs, anyways shortened abit:
Code:
local skulls = {SKULL_YELLOW = "yellow", SKULL_GREEN = "green", SKULL_WHITE = "white"}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local txt = "Your " .. (getCreatureSkullType(cid) == SKULL_NONE and "don't have any" or "can't") .. " " .. (getCreatureSkullType(cid) == skulls[1] and skulls[2] or "") .. " skull!"
	if getCreatureSkullType(cid) == skulls[1] then return doPlayerSendTextMessage(cid, 27, txt) end
	doCreatureSetSkullType(cid, SKULL_NONE)
	doPlayerSendTextMessage(cid, 27, (getCreatureSkullType(cid) == SKULL_RED and "Red" or "Black") .. " skull has been removed!")
	db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
	return true
end
 
Last edited:
and how do i do so the skull can only work 1 time? :eek:

Code:
local skulls,s = {SKULL_YELLOW = "yellow", SKULL_GREEN = "green", SKULL_WHITE = "white"},50000
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local txt = "Your " .. (getCreatureSkullType(cid) == SKULL_NONE and "don't have any" or "can't") .. " " .. (getCreatureSkullType(cid) == skulls[1] and skulls[2] or "") .. " skull!"
	if getCreatureSkullType(cid) == skulls[1] then return doPlayerSendTextMessage(cid, 27, txt) end
		if getPlayerStorageValue(cid,s) < 1 then
			doCreatureSetSkullType(cid, SKULL_NONE)
			doPlayerSendTextMessage(cid, 27, (getCreatureSkullType(cid) == SKULL_RED and "Red" or "Black") .. " skull has been removed!")
			db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
		else
			doPlayerSendCancel(cid,'You can only use this once.')
		end
	return true
end
 
it was made by Hermis or w/e his name first, then you guys just edited the msgs

Don't think so. I made it when I was learning LUA Languange. This script is very very old and I know that can be shorten. In future maybe I will rescript it.

#Edit

Didn't tested it yet. Its 4:37 AM =.=
Lua:
	-- Scripted by Leon Zawodowiec --
function onUse(cid, item, frompos, item2, topos)
	local playerskull = getCreatureSkullType(cid)
	local skulls = {
					SKULL_NONE,
					SKULL_YELLOW,
					SKULL_GREEN,
					SKULL_WHITE
					}
					
	if isInArray(skulls, playerskull) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove that skull !")
		return 0
	else
		doCreatureSetSkullType(cid, skulls[1])
		doRemoveItem(item.uid, 1)
		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 Skull has been removed !")
	end
return true
end
 
Last edited:
Why is the actual script in quote tags :L
and this script is pretty old and posted alot of places
Edit: I guess thanks?
 
How do i only can be used only in protected zone?

Lua:
-- Scripted by Leon Zawodowiec --
function onUse(cid, item, frompos, item2, topos)
	local playerskull = getCreatureSkullType(cid)
	local skulls = {
					SKULL_NONE,
					SKULL_YELLOW,
					SKULL_GREEN,
					SKULL_WHITE
					}
	if (getTilePzInfo(frompos) == TRUE) then
		if isInArray(skulls, playerskull) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove that skull !")
			return 0
		else
			doCreatureSetSkullType(cid, skulls[1])
			doRemoveItem(item.uid, 1)
			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 Skull has been removed !")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can use it only in PZ !")
	end
return true
end

@UP
Fixed script & tags in first post
 
Thanks! But....

PHP:
-- Scripted by Leon Zawodowiec --
function onUse(cid, item, frompos, item2, topos)
	local playerskull = getCreatureSkullType(cid)
	local skulls = {
					SKULL_NONE,
					SKULL_YELLOW,
					SKULL_GREEN,
					SKULL_WHITE
					}
	if (getTilePzInfo(frompos) == TRUE) then
		if isInArray(skulls, playerskull) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove that skull !")
			return 0
		else
			doCreatureSetSkullType(cid, skulls[1])
			doRemoveItem(item.uid, 1)
			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 Skull has been removed !")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can use it only in PZ !")
	end
return true
end

if (getTilePzInfo(pos) == TRUE) then
Work for me.
 
Hello Guys,
I want make frag remover just remove rs and save frags at guild frags i can ? cuz when player use it his guild lose frags ;//
if anyoe can help me will be Great and Thanks
 
Back
Top