Teddy
SweStream.se
Can some make a actionscript
if u click on(USE) the item all frags/and skull will be removed
ofc i will give rep for this
if u click on(USE) the item all frags/and skull will be removed
ofc i will give rep for this
<action itemid="9020" script="remove.lua"/>
function removeFrags(cid)
local FragTime = getConfigInfo('timeToDecreaseFrags')
local myFragTime = getPlayerRedSkullTicks(cid)
local Remo = (myFragTime - FragTime)
if Remo < 0 then
Remo = 0
end
doPlayerSetRedSkullTicks(cid, Remo)
end
function onUse(cid, item, frompos, item2, topos)
if getCreatureSkullType(cid) > 2 then
doCreatureSetSkullType(cid, SKULL_NONE)
end
if getPlayerFrags(cid) ~= 0 then
removeFrags(cid)
end
end
how do i add a text "Your Frags/skull has been removed" ?
[08/11/2009 14:36:25] Lua Script Error: [Action Interface]
[08/11/2009 14:36:25] data/actions/scripts/remove.lua:onUse
[08/11/2009 14:36:25] data/actions/scripts/remove.lua:17: attempt to call global 'getPlayerFrags' (a nil value)
[08/11/2009 14:36:25] stack traceback:
[08/11/2009 14:36:25] data/actions/scripts/remove.lua:17: in function <data/actions/scripts/remove.lua:11>
function removeFrags(cid)
local FragTime = getConfigInfo('timeToDecreaseFrags')
local myFragTime = getPlayerRedSkullTicks(cid)
local Remo = (myFragTime - FragTime)
if Remo < 0 then
Remo = 0
end
doPlayerSetRedSkullTicks(cid, Remo)
end
function onUse(cid, item, frompos, item2, topos)
if getCreatureSkullType(cid) > 2 then
doPlayerSendCancel(cid, "Your Frags/skull has been removed")
doCreatureSetSkullType(cid, SKULL_NONE)
end
if getPlayerFrags(cid) ~= 0 then
doPlayerSendCancel(cid, "Your Frags/skull has been removed")
removeFrags(cid)
end
end
local config =
{
item = 9020,
level = 10,
count = 1
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= config.level then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your "..getPlayerRedSkullTicks(cid).." frags has been removed.")
doRemoveItem(item.uid)
doPlayerSetRedSkullTicks(cid, 0)
else
doPlayerSendCancel(cid, "You dot have enough level")
end
return TRUE
end
does this one work then?PHP:local config = { item = 9020, level = 10, count = 1 } function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) >= config.level then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your "..getPlayerRedSkullTicks(cid).." frags has been removed.") doRemoveItem(item.uid) doPlayerSetRedSkullTicks(cid, 0) else doPlayerSendCancel(cid, "You dot have enough level") end return TRUE end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local skull = getCreatureSkullType(cid)
local skulls = {SKULL_RED, SKULL_BLACK}
if (isInArray(skulls, skull) == true) then
doPlayerSendCancel(cid, "bye skull")
doCreatureSetSkullType(cid, SKULL_NONE)
doPlayerSetSkullEnd(cid, 0, skull)
doRemoveItem(item.uid, 1)
end
return true
end
function onUse(cid, item, frompos, item2, topos)
doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSetSkullEnd(cid, 0, SKULL_RED)
doCreatureSetSkullType(cid, SKULL_NONE)
doRemoveItem(item.uid, 1)
return true
end
<action itemid="XXXX" script="fragscleaner.lua"/>
Try this:
Lua:function onUse(cid, item, frompos, item2, topos) doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1) db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")") doPlayerSetSkullEnd(cid, 0, SKULL_RED) doCreatureSetSkullType(cid, SKULL_NONE) doRemoveItem(item.uid, 1) return true end
PHP:<action itemid="XXXX" script="fragscleaner.lua"/>
Credits to: GSMaster
Try this:
Lua:function onUse(cid, item, frompos, item2, topos) doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1) db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")") doPlayerSetSkullEnd(cid, 0, SKULL_RED) doCreatureSetSkullType(cid, SKULL_NONE) doRemoveItem(item.uid, 1) return true end
PHP:<action itemid="XXXX" script="fragscleaner.lua"/>
Credits to: GSMaster
Try this:
Lua:function onUse(cid, item, frompos, item2, topos) doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1) db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")") doPlayerSetSkullEnd(cid, 0, SKULL_RED) doCreatureSetSkullType(cid, SKULL_NONE) doRemoveItem(item.uid, 1) return true end
PHP:<action itemid="XXXX" script="fragscleaner.lua"/>