MY
dúvida

Remove

Por Mycry, 26 de nov. de 2013 em Scripts

remove
resolvido
script
4
938
MycryM
26 de novembro de 2013 às 16:47

[Resolvido]Olá,tenho um script de remove frags mas quando uso ele ,ele não some da backpack.

Como faz para ele sumir apos usar?

 

 

 

 

function onUse(cid, topos, item, item2, frompos)
local nonremskulls = {red = SKULL_RED, white = SKULL_WHITE, black = SKULL_BLACK}
if getPlayerStorageValue(cid,1800) == 10 then
doCreatureSay(cid, "You can not remove your frags and their skulls.", TALKTYPE_ORANGE_1)
else if getPlayerLevel(cid) >= 10 then
doCreatureSay(cid, "Your Frags were successfully 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) .. ")")
doCreatureSetSkullType(cid,0)
doSendMagicEffect(fromPosition, 37)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1800,20)
return TRUE
else
doCreatureSay(cid, "Only people level 10 can use this item.", TALKTYPE_ORANGE_1)
end
end
end

Editado Novembro 26 por Mycry

RikutachimotoR
26 de novembro de 2013 às 16:49

doRemoveItem(item.uid)

 

Era para estar removendo eu acho, ponha o ID do item entre os parenteses.

zipter98Z
26 de novembro de 2013 às 16:53

Tenta assim:

 

function onUse(cid, item, fromPosition, item2, toPosition)
 
local nonremskulls = {red = SKULL_RED, white = SKULL_WHITE, black = SKULL_BLACK}
 
if getPlayerStorageValue(cid,1800) == 10 then
doCreatureSay(cid, "You can not remove your frags and their skulls.", TALKTYPE_ORANGE_1)
 
else if getPlayerLevel(cid) >= 10 then
doCreatureSay(cid, "Your Frags were successfully 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) .. ")")
doCreatureSetSkullType(cid,0)
doSendMagicEffect(fromPosition, 37)
doRemoveItem(item.uid, 1)
setPlayerStorageValue(cid,1800,20)
return TRUE
else
doCreatureSay(cid, "Only people level 10 can use this item.", TALKTYPE_ORANGE_1)
end
end
end

Editado Novembro 26 por zipter98

OmegaO
26 de novembro de 2013 às 23:07

Tópico movido para a seção de dúvidas e pedidos resolvidos.