Postado Julho 11, 2014 11 anos Para TFS 1.0 tenho somente remove red e black skull Talkactions/scripts crie frags.lua function onSay(cid, words, param) local player = Player(cid) if isInArray({4, 5}, player:getSkull()) then Item(item.uid):remove(1) player:setSkull(0) player:setSkullTime(0) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your skull has been removed!") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can only remove red or black skulls!") player:getPosition():sendMagicEffect(CONST_ME_POFF) end return true end Talkactions.xml <talkaction words="!removefrags" script="frags.lua"/> Não sei qual o comando em TFS 1.0 para resetar frags...
Postado Julho 11, 2014 11 anos Apenas modifiquei o script que o dolver postou, não testei ... local config = { red_skull = {3, 50000}, -- {frags, money} black_skull = {5, 60000}, -- {frags, money} skull = 40000 -- money } function onSay(cid, words, param, channel) local pid, player = getPlayerGUID(cid), isPlayer(cid) -- REMOVE RED SKULL if getPlayerSkullType(cid) == config.red_skull[1] then if player:removeMoney(config.red_skull[2]) then player:setSkull(0) player:setSkullTime(0) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You will be logged off in 5 seconds.') player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) doRemoveCondition(cid, CONDITION_INFIGHT) db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid .."") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ")") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You don\'t have '.. config.red_skull[2] ..' golds.') player:getPosition():sendMagicEffect(CONST_ME_POFF) end -- REMOVE BLACK SKULL elseif getPlayerSkullType(cid) >= config.frags_redskull[1] then if player:removeMoney(config.frags_redskull[2]) then player:setSkull(0) player:setSkullTime(0) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You will be logged off in 5 seconds.') player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) doRemoveCondition(cid, CONDITION_INFIGHT) doRemoveCreature(cid) -- creature:remove() db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid .."") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ")") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You don\'t have '.. config.frags_redskull[2] ..' golds.') player:getPosition():sendMagicEffect(CONST_ME_POFF) end -- REMOVE SKULL elseif getPlayerSkullType(cid) <= 3 then if player:removeMoney(config.skull) then player:setSkull(0) player:setSkullTime(0) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You will be logged off in 5 seconds.') player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) doRemoveCondition(cid, CONDITION_INFIGHT) doRemoveCreature(cid) -- creature:remove() db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid .."") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ")") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You don\'t have '.. config.skull ..' golds.') player:getPosition():sendMagicEffect(CONST_ME_POFF) end end return true end Abraços. STYLLER OT 2022
Postado Julho 17, 2014 10 anos Autor Erro! Apenas modifiquei o script que o dolver postou, não testei ... local config = { red_skull = {3, 50000}, -- {frags, money} black_skull = {5, 60000}, -- {frags, money} skull = 40000 -- money } function onSay(cid, words, param, channel) local pid, player = getPlayerGUID(cid), isPlayer(cid) -- REMOVE RED SKULL if getPlayerSkullType(cid) == config.red_skull[1] then if player:removeMoney(config.red_skull[2]) then player:setSkull(0) player:setSkullTime(0) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You will be logged off in 5 seconds.') player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) doRemoveCondition(cid, CONDITION_INFIGHT) db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid .."") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ")") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You don\'t have '.. config.red_skull[2] ..' golds.') player:getPosition():sendMagicEffect(CONST_ME_POFF) end -- REMOVE BLACK SKULL elseif getPlayerSkullType(cid) >= config.frags_redskull[1] then if player:removeMoney(config.frags_redskull[2]) then player:setSkull(0) player:setSkullTime(0) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You will be logged off in 5 seconds.') player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) doRemoveCondition(cid, CONDITION_INFIGHT) doRemoveCreature(cid) -- creature:remove() db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid .."") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ")") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You don\'t have '.. config.frags_redskull[2] ..' golds.') player:getPosition():sendMagicEffect(CONST_ME_POFF) end -- REMOVE SKULL elseif getPlayerSkullType(cid) <= 3 then if player:removeMoney(config.skull) then player:setSkull(0) player:setSkullTime(0) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You will be logged off in 5 seconds.') player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) doRemoveCondition(cid, CONDITION_INFIGHT) doRemoveCreature(cid) -- creature:remove() db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid .."") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ")") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You don\'t have '.. config.skull ..' golds.') player:getPosition():sendMagicEffect(CONST_ME_POFF) end end return true end Abraços. Editado Julho 17, 2014 10 anos por Trypox (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.