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

Help with this SCRIPT!

Zarabustor

Human Being
Joined
Sep 10, 2009
Messages
186
Reaction score
0
Location
Cancun, Mexico
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)
doSendMagicEffect(getPlayerPosition(cid),66)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have removed 2 frags.")
doRemoveItem(item.uid, 1)
doPlayerSetSkullEnd(cid, 0, getPlayerSkullType(cid))

return TRUE
end
end

I want the item remove only 2 frags, ONLY FRAGS! please help me :)

please help :D
 
Last edited by a moderator:
Code:
local nonremskulls = {SKULL_WHITE}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray(nonremskulls, getPlayerSkullType(cid)) then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		return doPlayerSendCancel(cid, "You can't remove this type of skull.")
	else
		db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ") LIMIT 2;")
		doPlayerSetSkullEnd(cid, 0, getPlayerSkullType(cid))
		doCreatureSetSkullType(cid, SKULL_NONE)
		doSendMagicEffect(getThingPos(cid), CONST_ME_BATS)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have removed 2 frags.")
		return doRemoveItem(item.uid, 1)
	end
end
 
ACTUALLY i found and error

[01/04/2010 15:04:19] OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "LIMIT": syntax error (UPDATE "killers" SET "unjustified" = 0 WHERE "id" IN (SELECT "kill_id" FROM "player_killers" WHERE "player_id" = 57) LIMIT 2;)
 
Back
Top