Tem como mudar o tanto de grana que o player ganha quando mata outro player em um ot server de War ??
Se tiver como por favor alguem me explica.
DOU REP +++ PRA QUEM ME ENSINARR
Agradeço desde já.
Desculpe se estiver no local errado
Tem como mudar o tanto de grana que o player ganha quando mata outro player em um ot server de War ??
Se tiver como por favor alguem me explica.
DOU REP +++ PRA QUEM ME ENSINARR
Agradeço desde já.
Desculpe se estiver no local errado
Posta o script que faz essa funçao...para ver se eu posso ajuda-lo!
e se eu te fala que eu nem sei qual é o script...=/ =/
Entre na pasta data/creaturescripts/scripts, e crie um arquivo chamado cash.lua, cole este código dentro:
function onKill(cid, target, lastHit) local cash = 100000 if isPlayer(cid) and isPlayer(target) then if getPlayerIp(target) ~= getPlayerIp(cid) then setPlayerStorageValue(cid, 45550, (getPlayerStorageValue(cid, 45550)+cash)) end end return TRUE end
ele vai dar 100k ao player quematar
2ªa: Agora em creaturescripts/creaturescripts.xml bote a tag:
<event type="kill" name="Kill_Cash" event="script" value="cash.lua"/>
2ªb:Agora em creaturescripts/scripts , localize login.lua (antes do ultimo return true) e cole isto dentro:
registerCreatureEvent(cid, "Kill_Cash")
Se ajudei Rep++
local cash = 100000
Resumindo: Após fazer isso, modifique essa tag colocando o quanto de dinheiro quer que o cara ganhe. Lembre-se de que não pode colocar nem 'gp' nem 'k' nem 'kk' no script.
Gabriel Couto, 23 anos. Acadêmico de Medicina.
Ex-Diretor Geral do XTibia.
www.tibiatv.com.br
Vlw AnyurCT eu havia esquecido de explicar!
Meu server é de war...temque colocar isso ae ou ja vem com um script ?
Se vc olhar nas pasta onde eu disse para colocar vc vai ve se tem ou nao!...
vou fazer um igual o seu tuto ali em cima...vai ser mais facil...Vlw ae..Vou testar agr
No script acima ele so tem a funçao de add level ao player que matar..!
mais se vc tem duvida...coloca o script acima..que passei..alterando onde o AnyurCt disse pra quantidade de cash que vc quer que o player ganhei ao matar outro!
e para dar save no server de 20 em 20 minutos ? oque tenho que mudar no script ?
local config = {
broadcast = {30},
shallow = "no",
delay = 120,
events = 30
}
config.shallow = getBooleanFromString(config.shallow)
local function executeSave(seconds)
if(isInArray(config.broadcast, seconds)) then
local text = ""
if(not config.shallow) then
text = "Full s"
else
text = "S"
end
text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!"
doBroadcastMessage(text)
end
if(seconds > 0) then
addEvent(executeSave, config.events * 1000, seconds - config.events)
else
doSaveServer(config.shallow)
end
end
function onThink(interval, lastExecution, thinkInterval)
if(table.maxn(config.broadcast) == 0) then
doSaveServer(config.shallow)
else
executeSave(config.delay)
end
return true
end
<globalevent name="save" interval="7260" event="script" value="save.lua"/>
Nao deu certo akele script que vc passo la em cima do CASH...=/
Troque essa parte do script do mulizeu:
function onKill(cid, target, lastHit) local cash = 100000 if isPlayer(cid) and isPlayer(target) then if getPlayerIp(target) ~= getPlayerIp(cid) then setPlayerStorageValue(cid, 45550, (getPlayerStorageValue(cid, 45550)+cash)) end end return TRUE end
por essa:
function onKill(cid, target, lastHit) dinheiro = 2160 --Moeda Azul (Crystal Coin) = 2160,Moeda Roxa/Rosa (Platinum Coin) = 2152, Moeda Amarela (Gold Coin) = 2148 quantidade = 10 --Quantidade da Moeda citada acima... if isPlayer(cid) and isPlayer(target) then if getPlayerIp(target) ~= getPlayerIp(cid) then setPlayerStorageValue(cid, 45550, (getPlayerStorageValue(cid, 45550)doPlayerAddItem(cid,dinheiro,quantidade)) end end return TRUE end
Caso n funfe poste tentarei arrumalo...
Desculpe pela demora...eu esta sem Net...
Nao deu certo nao em...
Teste assim!..tinha pequenos erros no do nosso colega assim Diisk e eu consertei
--Edited By Mulizeu-- local dinheiro = 2160 --Moeda Azul (Crystal Coin) = 2160,Moeda Roxa/Rosa (Platinum Coin) = 2152, Moeda Amarela (Gold Coin) = 2148 local quantidade = 10 --Quantidade da Moeda citada acima... function onKill(cid, target, lastHit) if isPlayer(cid) and isPlayer(target) then if getPlayerIp(target) ~= getPlayerIp(cid) then setPlayerStorageValue(cid, 45550, (getPlayerStorageValue(cid, 45550))) doPlayerAddItem(cid,dinheiro,quantidade) end end return TRUE end