Registra no creaturescripts.xml e no login.lua e testa essa sua script
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] [Encerrado] Ban ao morrer
Em 03/09/2017 at 20:26, Crypter disse:Registra no creaturescripts.xml e no login.lua e testa essa sua script
Tá registrado ![]()
info
Grupo: Campones
Registrado: 17/06/09
Posts: 75
Reputação: +13
Gênero: Masculino

accId? onde ta registrado isso?
tenta
getPlayerAccountId(cid)
Posta o script todo pq quem é "lenght"? ele que ta multiplicando mais qual o valor dele?
local accId = getAccountIdByName(getPlayerName(cid))local lenght = 24local comment = ""function onDeath(cid)if not isCreature(cid) then return true enddoAddBanishment(accId, lenght * 3600, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)return trueend
5 horas atrás, klipstyle disse:accId? onde ta registrado isso?
tenta
getPlayerAccountId(cid)
[05/09/2017 16:49:44]/creaturescripts/scripts/delet.lua:2: attempt to call global 'doAddBanishment' (a nil value)
[05/09/2017 16:49:44] stack traceback:
[05/09/2017 16:49:44] creaturescripts/scripts/delet.lua:2: in function <creaturescripts/scripts/delet.lua:1>
line 2=
doAddBanishment(getPlayerAccountId(cid), 10 * 3600, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)
5 horas atrás, klipstyle disse:accId? onde ta registrado isso?
tenta
getPlayerAccountId(cid)Posta o script todo pq quem é "lenght"? ele que ta multiplicando mais qual o valor dele?
local accId = getAccountIdByName(getPlayerName(cid))local lenght = 24local comment = ""function onDeath(cid)if not isCreature(cid) then return true enddoAddBanishment(accId, lenght * 3600, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)return trueend
Desculpa desapontar mas este é o scripts completo kk, lenght é o tempo nao tinha perssebido que tinha pegado a função pronta de um talkaction entao o comando pelo talkaction seria : /ban tal player, lenght vou testar o script aqui vlw!
5 horas atrás, klipstyle disse:accId? onde ta registrado isso?
tenta
getPlayerAccountId(cid)Posta o script todo pq quem é "lenght"? ele que ta multiplicando mais qual o valor dele?
local accId = getAccountIdByName(getPlayerName(cid))local lenght = 24local comment = ""function onDeath(cid)if not isCreature(cid) then return true enddoAddBanishment(accId, lenght * 3600, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)return trueend
Desculpa desapontar mas este é o scripts completo kk, lenght é o tempo nao tinha perssebido que tinha pegado a função pronta de um talkaction entao o comando pelo talkaction seria : /ban tal player, lenght vou testar o script aqui vlw!
Mesmo erro, com a msm tag : doAddBanishment e talz
[05/09/2017 16:49:44]/creaturescripts/scripts/delet.lua:2: attempt to call global 'doAddBanishment' (a nil value)
[05/09/2017 16:49:44] stack traceback:
[05/09/2017 16:49:44] creaturescripts/scripts/delet.lua:2: in function <creaturescripts/scripts/delet.lua:1>
Detalhe: Não esta nas lines 2 ou 1 pois este é o antigo.
Editado Setembro 5 por Holloway
info
Grupo: Administrador
Registrado: 26/02/07
Posts: 254
Reputação: +205
Gênero: Masculino
Char no Tibia: Frenvius

info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino







info
Grupo: Campones
Registrado: 05/04/17
Posts: 4
Reputação: +2
Gênero: Masculino
Bom, venho aqui no xtibia em busca de que alguem me ajude em um "script" que fiz ta ai na seguinte:
function onDeath(cid, banishment)
doAddBanishment(getPlayerAccountId(cid), lenght * 3600, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)
end
Já registrei no login e creature, também mudei a função accid para getplayerdaccountid que me aconselharam.
Editado Setembro 5 por Holloway