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

Can Some Make This ActionsScript? [REP++]

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
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 :)
 
hi, just woke up
heya teddy. which item do you want to do this?
hm all? 100%frags? red/white/black skull?
 
You Can buy the ItemID from a shop (NPC INGAME) so if you right click on it all skull will be removed and all Frags..

ITEMID : 9020


EDIT:
i use 0.3.5p1
 
ok, that's easy to do await..
edit: test this one

actions.xml
Lua:
<action itemid="9020" script="remove.lua"/>

remove.lua
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
 
Last edited:
how do i add a text "Your Frags/skull has been removed" ?

doPlayerSendCancel(cid, "Your Frags/skull has been removed")

add it inside ..if.. and before ..end.. because if player ain't got skull/frag he won't want that useless message
 
Code:
[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>
Error .. and the frags dont go away..
14:36 You currently have 3 frags today, 3 this week and 3 this month.
14:36 Last frag at 08 November 2009 14:29:49 on level 299 (Smekarn).
14:36 Your black skull will expire at 08 December 2009 14:29:49

EDIT:
The item dont go away ..
 
Code:
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
 
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
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
does this one work then?

no ..
 
Code:
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

This? ;d
 
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"/>

:p
 
Last edited:
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"/>

:p

Can't you give credits? :huh:
http://otland.net/f132/usable-item-makes-you-lose-all-your-frags-53884/
 
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"/>

:p

Rep to all of u guys!
 
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"/>

:p

Finded bugg.. After u use the item you cant get skull you most relogg?..
 
Back
Top