Postado Julho 23, 2014 10 anos Em meu server, quando um player usa o item para ficar com a conta vip eles ficam com [VIP] atrás do nome, o problema é se eles usarem de novo o item eles irão ficar [VIP][VIP]. Ex: nome : Bruno Usando uma vez item vip : [VIP] Bruno Usando de novo : [VIP][VIP] Bruno Alguém consegue arrumar isso? Aqui está a script: vip.lua function onUse(cid, item, frompos, item2, topos) function nome() if getPlayerGroupId(cid) <= 2 then setPlayerGroupId(cid, 2) novo = getPlayerName(cid) id = getPlayerGUID(cid) doRemoveCreature(cid) end end if item.itemid == 10311 and vip.hasVip(cid) == TRUE then id = tonumber(15) or 1 vip.addVipByAccount(getPlayerAccount(cid) ,vip.getDays(id)) doPlayerSendTextMessage(cid,25,"Voce recebeu "..tonumber(id).." dias de vip.") db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";") doPlayerSendTextMessage(cid,25,"Você terá de logar para o seu nome mudar. / You have to logout for the name change") doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doSendAnimatedText(topos,'VIP!',180) elseif item.itemid == 10311 and vip.hasVip(cid) == FALSE then id = tonumber(15) or 1 vip.addVipByAccount(getPlayerAccount(cid) ,vip.getDays(id)) doPlayerSendTextMessage(cid,25,"Voce recebeu "..tonumber(id).." dias de vip.") doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doSendAnimatedText(topos,'VIP!',180) addEvent(nome, 1000) end if item.itemid == 10312 and vip.hasVip(cid) == TRUE then id = tonumber(30) or 1 vip.addVipByAccount(getPlayerAccount(cid) ,vip.getDays(id)) doPlayerSendTextMessage(cid,25,"Voce recebeu "..tonumber(id).." dias de vip.") doRemoveItem(item.uid, 1) db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";") doPlayerSendTextMessage(cid,25,"Voce tera de logar para o seu nome mudar. / You have to logout for the name change.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doSendAnimatedText(topos,'VIP!',180) doPlayerSendTextMessage(cid,21,"Você é agora um VIP / You are now a VIP") elseif item.itemid == 10312 and vip.hasVip(cid) == FALSE then id = tonumber(30) or 1 vip.addVipByAccount(getPlayerAccount(cid) ,vip.getDays(id)) doPlayerSendTextMessage(cid,25,"Voce recebeu "..tonumber(id).." dias de vip.") doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doSendAnimatedText(topos,'VIP!',180) addEvent(nome, 1000) end if item.itemid == 10314 and vip.hasVip(cid) == TRUE then id = tonumber(60) or 1 vip.addVipByAccount(getPlayerAccount(cid) ,vip.getDays(id)) doPlayerSendTextMessage(cid,25,"Voce recebeu "..tonumber(id).." dias de vip.") doRemoveItem(item.uid, 1) db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";") doPlayerSendTextMessage(cid,25,"Voce tera de logar para o seu nome mudar. / You have to logout for the name change") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doSendAnimatedText(topos,'VIP!',180) doPlayerSendTextMessage(cid,21,"Você é agora um VIP / You are now a VIP") elseif item.itemid == 10314 and vip.hasVip(cid) == FALSE then id = tonumber(30) or 1 vip.addVipByAccount(getPlayerAccount(cid) ,vip.getDays(id)) doPlayerSendTextMessage(cid,25,"Voce recebeu "..tonumber(id).." dias de vip.") doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doSendAnimatedText(topos,'VIP!',180) addEvent(nome, 1000) end if item.itemid == 10315 and vip.hasVip(cid) == TRUE then id = tonumber(90) or 1 vip.addVipByAccount(getPlayerAccount(cid) ,vip.getDays(id)) doPlayerSendTextMessage(cid,25,"Voce recebeu "..tonumber(id).." dias de vip.") doRemoveItem(item.uid, 1) db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";") doPlayerSendTextMessage(cid,25,"Voce tera de logar para o seu nome mudar. / You have to logout for the name change") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doSendAnimatedText(topos,'VIP!',180) doPlayerSendTextMessage(cid,21,"Você é agora um VIP / You are now a VIP") elseif item.itemid == 10315 and vip.hasVip(cid) == FALSE then id = tonumber(90) or 1 vip.addVipByAccount(getPlayerAccount(cid) ,vip.getDays(id)) doPlayerSendTextMessage(cid,25,"Voce recebeu "..tonumber(id).." dias de vip.") doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doSendAnimatedText(topos,'VIP!',180) addEvent(nome, 1000) end if item.itemid == 10309 and vip.hasVip(cid) == TRUE then id = tonumber(365) or 1 vip.addVipByAccount(getPlayerAccount(cid) ,vip.getDays(id)) doPlayerSendTextMessage(cid,25,"Voce recebeu "..tonumber(id).." dias de vip.") doRemoveItem(item.uid, 1) db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";") doPlayerSendTextMessage(cid,25,"Voce tera de logar para o seu nome mudar. / You have to logout for the name change") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doSendAnimatedText(topos,'VIP!',180) doPlayerSendTextMessage(cid,21,"Você é agora um VIP / You are now a VIP") elseif item.itemid == 10309 and vip.hasVip(cid) == FALSE then id = tonumber(365) or 1 vip.addVipByAccount(getPlayerAccount(cid) ,vip.getDays(id)) doPlayerSendTextMessage(cid,25,"Voce recebeu "..tonumber(id).." dias de vip.") doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doSendAnimatedText(topos,'VIP!',180) addEvent(nome, 1000) end end Editado Julho 23, 2014 10 anos por mikkas70 (veja o histórico de edições) TibiaServers.org | A sua nova lista de servidores de Tibia [url=https://tibiaservers.org/server/evolution-ot][img]https://tibiaservers.org/dynamic_banners/76-ankrahmun.png[/img][/url]
Postado Julho 29, 2014 10 anos Retira essas linhas de todos os itens: db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";") doPlayerSendTextMessage(cid,25,"Você terá de logar para o seu nome mudar. / You have to logout for the name change")
Postado Julho 29, 2014 10 anos Se ele retirar, os players que nunca usaram irão ficar sem o [VIP] no nome.
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.