Mais atenção, você postou na área errada, leia as regras.
Movido.
Por sourock, 07 de mai. de 2012 em Scripts
Mais atenção, você postou na área errada, leia as regras.
Movido.
info
Grupo: Campones
Registrado: 10/12/11
Posts: 40
Reputação: 0
Char no Tibia: Wofs Rain

TonyHanks me desculpe, não tive a intenção de postar na sessão errada, mil perdoes.
info
Grupo: Conde
Registrado: 30/06/11
Posts: 631
Reputação: +371
Char no Tibia: Warrior of Mort

tenho aqui prontinho que tu quer e até melhor olha só:
Vai em data/talkactions/scritps e duplica 3 arquivos, um renomeia para "addpremium", outro para "premiumcheck" e o ultimo "removepremium" todos sem as aspas.
Agora no arquivo "addpremium" cole isso:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
local t = string.explode(param, ",")
local player = getPlayerByNameWildcard(tostring(t[1]))
if(not isPlayer(player)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player nao existe.")
return true
end
local pos = getCreaturePosition(player)
local effect = 30
local days = tonumber(t[2])
doPlayerAddPremiumDays(player, days)
doSendMagicEffect(pos, effect)
return true
end
No arquivo "premiumcheck" cole isso:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
local player = getPlayerByNameWildcard(tostring(param))
if(not isPlayer(player)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player nao existe.")
return true
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param.." possui "..getPlayerPremiumDays(player).." dias de premium restantes.")
return true
end
E no arquivo "removepremium" cole isso:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
local t = string.explode(param, ",")
local player = getPlayerByNameWildcard(tostring(t[1]))
if(not isPlayer(player)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player nao existe.")
return true
end
local pos = getCreaturePosition(player)
local effect = 30
local days = tonumber(t[2])
doPlayerRemovePremiumDays(player, days)
doSendMagicEffect(pos, effect)
return true
end
E por último vai em data/talkactions/talkactions.xml e cole as tags:
<talkaction words="/addpacc" access="6" event="script" value="addpremium.lua"/> <talkaction words="/premiumcheck" access="6" event="script" value="premiumcheck.lua"/> <talkaction words="/removepremium" access="6" event="script" value="removepremium.lua"/>
info
Grupo: Artesão
Registrado: 07/04/12
Posts: 139
Reputação: +4

tenho aqui prontinho que tu quer e até melhor olha só:
Vai em data/talkactions/scritps e duplica 3 arquivos, um renomeia para "addpremium", outro para "premiumcheck" e o ultimo "removepremium" todos sem as aspas.
Agora no arquivo "addpremium" cole isso:
function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") local player = getPlayerByNameWildcard(tostring(t[1])) if(not isPlayer(player)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player nao existe.") return true end local pos = getCreaturePosition(player) local effect = 30 local days = tonumber(t[2]) doPlayerAddPremiumDays(player, days) doSendMagicEffect(pos, effect) return true end
No arquivo "premiumcheck" cole isso:
function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local player = getPlayerByNameWildcard(tostring(param)) if(not isPlayer(player)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player nao existe.") return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param.." possui "..getPlayerPremiumDays(player).." dias de premium restantes.") return true end
E no arquivo "removepremium" cole isso:
function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") local player = getPlayerByNameWildcard(tostring(t[1])) if(not isPlayer(player)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player nao existe.") return true end local pos = getCreaturePosition(player) local effect = 30 local days = tonumber(t[2]) doPlayerRemovePremiumDays(player, days) doSendMagicEffect(pos, effect) return true end
E por último vai em data/talkactions/talkactions.xml e cole as tags:
<talkaction words="/addpacc" access="6" event="script" value="addpremium.lua"/> <talkaction words="/premiumcheck" access="6" event="script" value="premiumcheck.lua"/> <talkaction words="/removepremium" access="6" event="script" value="removepremium.lua"/>
muito show =D, e como fazer pro player quando acabar premmy ser teleportado para templo?
info
Grupo: Conde
Registrado: 30/06/11
Posts: 631
Reputação: +371
Char no Tibia: Warrior of Mort

no teu arquivo login.lua, na pasta data/creaturescripts/scripts. antes do ultimo return true cole isso:
local pos_temple = {x=100, y=100, z=7} -- posição do templo
if isPremium(cid) and getPlayerStorageValue(cid, 43251) ~= 1 then
setPlayerStorageValue(cid, 43251, 1)
elseif not isPremium(cid) and getPlayerStorageValue(cid, 43251) == 1 then
setPlayerStorageValue(cid, 43251, -1)
doTeleportThing(cid, pos_temple)
end
info
Grupo: Campones
Registrado: 10/12/11
Posts: 40
Reputação: 0
Char no Tibia: Wofs Rain
PESSOAL É O SEGUINTE EU QUERO UMA TALKACTION QUE EU POSSO ADICIONAR PREMIUM AOS PLAYERS POR EXEMPLO ASSIM: /addpacc Abobrinha,100 E ADICIONARIA 100 DIAS DE PREMIUM A UM PLAYER, E NAO É VIP É PREMIUM NORMAL, MSM PREMIUM DO TIBIA GLOBAL, OBRIGADO DESDE JA, DOU REP+