Ir para conteúdo
  • 0

Ajuda Com Script


Adriez

Pergunta

fala galera gostaria q fosse removido do script o tile (VIP) q os players ganha somente isso, pq isso buga da pra criar msm nick do cara depois

 

local lever = {
[7045] = {30,30,{2160}}
}
function onUse(cid,item,fromPosition,itemEx,toPosition)
if getPoints(cid) < lever[item.actionid][1] then
return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.")
end
removePoints(cid,lever[item.actionid][1])
local add = (lever[item.actionid][2]*86400)
setPlayerStorageValue(cid, 85258, getPlayerStorageValue(cid, 85258) - os.time() <= 0 and (os.time() + add) or (getPlayerStorageValue(cid, 85258) + add))
local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
for _, items in pairs(lever[item.actionid][3]) do
doPlayerAddItem(cid,items,1)
end
if not getCreatureName(cid):find('(VIP)') then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
db.executeQuery("UPDATE `players` SET `name` = '(VIP) "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")
addEvent(doRemoveCreature, 3*1000, cid)
end
return true
end
Link para o comentário
Compartilhar em outros sites

10 respostass a esta questão

Posts Recomendados

  • 0


local lever = {

[7045] = {30,30,{2160}}

}

 

function onUse(cid,item,fromPosition,itemEx,toPosition)

if getPoints(cid) < lever[item.actionid][1] then

return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.")

end

removePoints(cid,lever[item.actionid][1])

local add = (lever[item.actionid][2]*86400)

setPlayerStorageValue(cid, 85258, getPlayerStorageValue(cid, 85258) - os.time() <= 0 and (os.time() + add) or (getPlayerStorageValue(cid, 85258) + add))

local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60))

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")

for _, items in pairs(lever[item.actionid][3]) do

doPlayerAddItem(cid,items,1)

end

return true

end

 

Link para o comentário
Compartilhar em outros sites

  • 0

 

local lever = {

[7045] = {30,30,{2160}}

}

function onUse(cid,item,fromPosition,itemEx,toPosition)
if getPoints(cid) < lever[item.actionid][1] then
return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.")
end
removePoints(cid,lever[item.actionid][1])
local add = (lever[item.actionid][2]*86400)
setPlayerStorageValue(cid, 85258, getPlayerStorageValue(cid, 85258) - os.time() <= 0 and (os.time() + add) or (getPlayerStorageValue(cid, 85258) + add))
local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
for _, items in pairs(lever[item.actionid][3]) do
doPlayerAddItem(cid,items,1)
end
--[[if not getCreatureName(cid):find('(VIP)') then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
db.executeQuery("UPDATE `players` SET `name` = '(VIP) "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")
addEvent(doRemoveCreature, 3*1000, cid)
end]]--
return true
end

 

Link para o comentário
Compartilhar em outros sites

  • 0

boa noite, funciono agora com oq faz pra quando o vip sair o cara ser teleportado pro templo ???

local lever = {
	[7045] = {30,30,{2160}}
}

function onUse(cid,item,fromPosition,itemEx,toPosition)
	if getPoints(cid) < lever[item.actionid][1] then
		return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.")
	end
	removePoints(cid,lever[item.actionid][1])
	local add = (lever[item.actionid][2]*86400)
	setPlayerStorageValue(cid, 85258, getPlayerStorageValue(cid, 85258) - os.time() <= 0 and (os.time() + add) or (getPlayerStorageValue(cid, 85258) + add))
	local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60))  
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") 
	for _, items in pairs(lever[item.actionid][3]) do
		doPlayerAddItem(cid,items,1)
	end 
	return true
end

 

Editado por Adriez
Link para o comentário
Compartilhar em outros sites

  • 0


local lever = {

 

[7045] = {30,30,{2160}}

 

}

 

function onUse(cid,item,fromPosition,itemEx,toPosition)

if getPoints(cid) < lever[item.actionid][1] then

return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.")

end

removePoints(cid,lever[item.actionid][1])

local add = (lever[item.actionid][2]*86400)

setPlayerStorageValue(cid, 85258, getPlayerStorageValue(cid, 85258) - os.time() <= 0 and (os.time() + add) or (getPlayerStorageValue(cid, 85258) + add))

local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60))

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")

for _, items in pairs(lever[item.actionid][3]) do

doPlayerAddItem(cid,items,1)

end

if not getCreatureName(cid):find('(VIP)') then

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

--db.executeQuery("UPDATE `players` SET `name` = '(VIP) "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")

--addEvent(doRemoveCreature, 3*1000, cid)

end

return true

end

 

Link para o comentário
Compartilhar em outros sites

  • 0

em creaturescripts/scripts cria um arquivo verificaVip.lua e coloque isso dentro :

function onLogin(cid)
	if (getPlayerStorageValue(cid, 85258) - os.time()) <= 0  then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Acabou seus dias de vips, você foi enviado para o templo!")
	end
	return true
end

e em creaturescripts.XML adicione isso :

<event type="login" name="verificaVip" event="script" value="verificaVip.lua"/>
Editado por Kawoszin
Link para o comentário
Compartilhar em outros sites

  • 0

muito obrigado, foda vai ser testar esse meu vip por pontos não sei aonde fica o comando de remover dias dele e nem ver quanto dias os palyers tem pq meu ot tem dois tipo de vip, se tiver como tu criar um ai pra quem pegar a vip daquele sistema de vip q te passei ia ser muito bom,ai eu editava assim !diasdonate e um comando pra mim retirar elas pra ve ta funfando o teleporte automatico, muito obrigado

 

 

em creaturescripts/scripts cria um arquivo verificaVip.lua e coloque isso dentro :

function onLogin(cid)
	if (getPlayerStorageValue(cid, 85258) - os.time()) <= 0  then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Acabou seus dias de vips, você foi enviado para o templo!")
	end
	return true
end

e em creaturescripts.XML adicione isso :

<event type="login" name="verificaVip" event="verificaVip.lua"/>

 

Link para o comentário
Compartilhar em outros sites

  • 0

^^

 

diasdonate.lua :

function onSay(cid, words, param)
    if (getPlayerStorageValue(cid, 85258) - os.time()) > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você possui " .. math.floor((getPlayerStorageValue(cid, 85258) - os.time()) / (60*60*24)) .. " dia(s) de VIP!")
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não possui VIP!")
    end
    return true
end

tag.XML :

<talkaction log="yes" words="!diasdonate " event="script" value="diasdonate.lua"/>
Editado por Kawoszin
Link para o comentário
Compartilhar em outros sites

  • 0

aparece 0 dias de vip e teria um pra mim retirar os dias desse donate vip ai pra ve se seu script de mandar ele por templo ta funcionando ??

 

 

^^

 

diasdonate.lua :

function onSay(cid, words, param)
    if (getPlayerStorageValue(cid, 85258) - os.time()) > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você possui " .. math.floor((getPlayerStorageValue(cid, 85258) - os.time()) / (60*60*24)) .. " dia(s) de VIP!")
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não possui VIP!")
    end
    return true
end

tag.XML :

<talkaction log="yes" words="!diasdonate " event="script" value="diasdonate.lua"/>

 

Editado por Adriez
Link para o comentário
Compartilhar em outros sites

  • 0

removevip.lua:

function onSay(cid, words, param)
    setPlayerStorageValue(cid, 85258, 0)
    return true
end

talkactions.XML:

<talkaction log="yes" words="!removevip" event="script" value="removevip.lua"/>
Link para o comentário
Compartilhar em outros sites

  • 0

o script dias donate não mostra a quantidade de dias e o removevip noa funciono


ta teleportando pro templo todo os players vip e não vip

 

 

em creaturescripts/scripts cria um arquivo verificaVip.lua e coloque isso dentro :

function onLogin(cid)
	if (getPlayerStorageValue(cid, 85258) - os.time()) <= 0  then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Acabou seus dias de vips, você foi enviado para o templo!")
	end
	return true
end

e em creaturescripts.XML adicione isso :

<event type="login" name="verificaVip" event="script" value="verificaVip.lua"/>

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...