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

Lua frag remover

fragster

New Member
Joined
Nov 18, 2012
Messages
39
Reaction score
1
hello i have this script

Code:
local config =
{
    item = 9999,  -- WPISZ ID ITEMA KTÓRY MA USUWAĆ FRAGI PRAWYM KLIKNIĘCIEM 
    level = 1,
    count = 0
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= config.level then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags has been removed.")
        doRemoveItem(item.uid)
        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)  
    else
        doPlayerSendCancel(cid, "You dot have enough level")
    end
    return TRUE
end

what edit that this item can use ONLY in PZ ! help please

rep++
 
Lua:
local config =
{
    item = 9969,  -- WPISZ ID ITEMA KTÓRY MA USUWAC FRAGI PRAWYM KLIKNIECIEM 
    level = 1,
    count = 0
}
function onUse(cid, item, frompos, item2, topos)
	if getTilePzInfo(getCreaturePosition(cid)) == TRUE then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can not remove your frags in protection zone.")
		return FALSE
	end -- edited by naaano201
if getPlayerLevel(cid) >= config.level then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags has been removed.")
        doRemoveItem(item.uid)
        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)  
    else
        doPlayerSendCancel(cid, "You dot have enough level")
    end
    return TRUE
end
 
try
Lua:
local config =
{
    item = 9999,
    level = 1,
    count = 0
}
function onUse(cid, item, frompos, item2, topos)
if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
if getPlayerLevel(cid) >= config.level then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags has been removed.")
        doRemoveItem(item.uid)
        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)  
    else
        doPlayerSendCancel(cid, "You have PZ lock")
        else
	doPlayerSendCancel(cid,"You dot have enough level")
    end
    return TRUE
end
 
man this warning in console "/actions/scripts/other/skullremove.lua:16: 'end' expected (to c lose 'if' at line 9) near 'else'"

and remover dont working :(
 
hmm try added and .... then
Lua:
local config =
{
    item = 9999,
    level = 1,
    count = 0
}
function onUse(cid, item, frompos, item2, topos)
if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE and if getPlayerLevel(cid) >= config.level then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags has been removed.")
        doRemoveItem(item.uid)
        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)  
    else
        doPlayerSendCancel(cid, "You have PZ lock")
        else
	doPlayerSendCancel(cid,"You dot have enough level")
    end
    return TRUE
end
 
tfs 0.4 (8.6 client)

- - - Updated - - -

@up


[12:8:25.167] [Warning - Event::loadScript] Cannot load script (data/actions/scr ipts/other/skullremove.lua)
[12:8:25.167] data/actions/scripts/other/skullremove.lua:8: unexpected symbol ne ar 'if'

- - - Updated - - -

Code:
local config =
{
    item = 9969,

    count = 0
}
function onUse(cid, item, frompos, item2, topos)
if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE  then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags has been removed.")
        doRemoveItem(item.uid)
        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)  
    else
        doPlayerSendCancel(cid, "You have PZ lock")

    end
    return TRUE
end

this is working code 100%.
why using if of level=1 then everyone starting on 1 lvl.. thanks for inspiration all rep ++
 
Back
Top