Postado Julho 15, 2014 10 anos As modificações são poucas, pois o Matheus ele editou o proprio sistema do Kydrai. Fazendo assim a Versão 2.0. Achei as modificações que você deve fazer pra não alterar muita coisa, sabe o arquivo vipaccgod.lua faça uma copia dele por segurança, ai abre ele e coloca isso dentro: -- Script SYtem vip 2.0 --function onSay(cid, words, param)if(words == "!buyvip") thenlocal price = 5000000if doPlayerRemoveMoney(cid, price) == TRUE thenlocal days = 30local daysvalue = days * 24 * 60 * 60local storageplayer = getPlayerStorageValue(cid, 13540)local timenow = os.time()if getPlayerStorageValue(cid, 13540) - os.time() <= 0 thentime = timenow + daysvalueelsetime = storageplayer + daysvalueendif string.find(tostring(getCreatureName(cid)),"[[Vip]]") thendoPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")setPlayerStorageValue(cid, 13540, time)local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60))doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")elsedoPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")setPlayerStorageValue(cid, 13540, time)local name = getCreatureName(cid)db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..name.."' WHERE `id` = "..getPlayerGUID(cid)..";")doRemoveCreature(cid)endelsedoPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de "..price.." gp's para colocar vip.")endelseif(words == "!vipdays") thenlocal timenow = os.time()local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60))doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. (quantity < 0 and 0 or quantity) .." dias de VIP no seu character.")elseif(words == "/checkvip") thenif getPlayerAccess(cid) == 5 thenif not param thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")endlocal player = getPlayerByName(param)if not isPlayer(player) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player "..player.." not found.")endlocal timenow = os.time()local quantity = math.floor((getPlayerStorageValue(player, 13540) - timenow)/(24 * 60 * 60))doPlayerPopupFYI(cid, "O jogador tem ".. (quantity < 0 and 0 or quantity) .." dias de VIP no character.")return TRUEendelseif(words == "/addvip") thenif getPlayerAccess(cid) == 5 thenlocal t = string.explode(param, ",")if not t[2] thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")endlocal player = getPlayerByName(t[1])local name = getCreatureName(player)local days = t[2]local pid = getPlayerByNameWildcard(t[1])if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")return TRUEendlocal daysvalue = days*3600*24local storageplayer = getPlayerStorageValue(player, 13540)local timenow = os.time()local time = storageplayer <= 0 and (timenow + daysvalue) or (storageplayer + daysvalue)if string.find(tostring(getCreatureName(pid)),"[[Vip]]") thendoPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados "..days.." dias de VIP no seu character.")setPlayerStorageValue(player, 13540, time)local quantity = math.floor((getPlayerStorageValue(player,13540) - timenow)/(3600*24))doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você tem "..quantity.." dias de VIP restantes.")elsesetPlayerStorageValue(player, 13540, time)db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..name.."' WHERE `id` = "..getPlayerGUID(player)..";")doRemoveCreature(player)endendelseif(words == "/delvip") thenif getPlayerAccess(cid) == 5 thenlocal dec = MESSAGE_INFO_DESCRif(param == "") then return TRUE,doPlayerSendTextMessage(cid,18,"Command param required.")endlocal C,t = {},string.explode(param, ",")C.pos = getPlayerPosition(cid)C.uid = getCreatureByName(t[1])C.time = ((tonumber(t[2]) == nil) and 1 or tonumber(t[2]))*3600*24 --Tempo da vip por dia.C.days = (tonumber(t[2]) == nil) and 1 or tonumber(t[2]) --Dias de vip.if(getPlayerStorageValue(C.uid,13540) < C.time)thendoPlayerSendTextMessage(cid,dec,'O jogador '..t[1]..' não possui '..C.days..' dias de vip.')elsedoPlayerSendTextMessage(cid,dec,'Você removeu '..C.days..' dias de vip do player '..t[1]..'.')setPlayerStorageValue(C.uid,13540,getPlayerStorageValue(C.uid,13540)-C.time)enddoSendMagicEffect(C.pos, math.random(28,30))endendreturn TRUEend Ai você pode remover o vipaccplayer.lua, mais antes faça uma copia por segurança. Editado Julho 15, 2014 10 anos por tetheuscunha (veja o histórico de edições) Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.
Postado Julho 16, 2014 10 anos Autor Não da mano! é super diferente.. esse v2.0 não utliza as libs, ou seja como vo colocar vip pelo site com um sistema vip que só existe por talkactions como esse q o matheus postou. Olha a lib, é aqui que o script roda. function installVip() if db.executeQuery("ALTER TABLE `accounts` ADD viptime INT(15) NOT NULL DEFAULT 0;") then print("[Vip System] Vip System instalado com sucesso!") return TRUE end print("[Vip System] Não foi possível instalar o Vip System!") return FALSE end -- By Account function doTeleportPlayersByAccount(acc, topos) if db.executeQuery("UPDATE `players` SET `posx` = "..topos.x..", `posy` = "..topos.y..", `posz` = "..topos.z.." WHERE `account_id` = "..acc..";") then return TRUE end return FALSE end function getVipTimeByAccount(acc) local vip = db.getResult("SELECT `viptime` FROM `accounts` WHERE `id` = "..acc..";") if vip:getID() == -1 then print("[Vip System] Account not found!") return FALSE end return vip:getDataInt("viptime") end function setVipTimeByAccount(acc, time) if db.executeQuery("UPDATE `accounts` SET `viptime` = "..time.." WHERE `id` = "..acc..";") then return TRUE end return FALSE end function getVipDaysByAccount(acc) local vipTime = getVipTimeByAccount(acc) local timeNow = os.time() local days = math.ceil((vipTime - timeNow)/(24.83 * 60 * 60)) return days <= 0 and 0 or days end function isVipAccount(acc) return getVipDaysByAccount(acc) > 0 and TRUE or FALSE end function addVipDaysByAccount(acc, days) if days > 0 then local daysValue = days * 24.83 * 60 * 60 local vipTime = getVipTimeByAccount(acc) local timeNow = os.time() local time = getVipDaysByAccount(acc) == 0 and (timeNow + daysValue) or (vipTime + daysValue) setVipTimeByAccount(acc, time) return TRUE end return FALSE end function doRemoveVipDaysByAccount(acc, days) if days > 0 then local daysValue = days * 24.83 * 60 * 60 local vipTime = getVipTimeByAccount(acc) local time = vipTime - daysValue setVipTimeByAccount(acc, (time <= 0 and 1 or time)) return TRUE end return FALSE end function getVipDateByAccount(acc) if isVipAccount(acc) then local vipTime = getVipTimeByAccount(acc) return os.date("%d/%m/%y %X", vipTime) end return FALSE end -- By Player function doTeleportPlayers(cid, topos) doTeleportPlayersByAccount(getPlayerAccountId(cid), topos) end function getVipTime(cid) return getVipTimeByAccount(getPlayerAccountId(cid)) end function setVipTime(cid, time) return setVipTimeByAccount(getPlayerAccountId(cid), time) end function getVipDays(cid) return getVipDaysByAccount(getPlayerAccountId(cid)) end function isVip(cid) return isVipAccount(getPlayerAccountId(cid)) end function addVipDays(cid, days) return addVipDaysByAccount(getPlayerAccountId(cid), days) end function doRemoveVipDays(cid, days) return doRemoveVipDaysByAccount(getPlayerAccountId(cid), days) end function getVipDate(cid) return getVipDateByAccount(getPlayerAccountId(cid)) end Eu não encontrei nenhum =/ Então alguem pode me passar um sistema vip de [VIP] e que explique como colocar no site tudo certinho? Pois sou 0 em web Editado Julho 16, 2014 10 anos por Disturbbed (veja o histórico de edições)
Postado Julho 17, 2014 10 anos Você teria que adicionar duas funções, a primeira executaria o query e adicionar o [VIP] no nome e a segunda seria uma onLogin que se os dias de vip tivessem acabado e conseguisse achar a string "[VIP]" no nome iria remover essa string e setar o novo nome sem a [VIP] Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Julho 17, 2014 10 anos Autor Sim sim, qual é essa string porfavor? eu sou leigo em script Editado Julho 17, 2014 10 anos por Disturbbed (veja o histórico de edições)
Postado Julho 17, 2014 10 anos uma função pra adicionar a [VIP] no nome: db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";") e uma pra remover: vai em data\creaturescripts\scripts\login.lua e adiciona isso antes do ultimo return true if not (getVipTime(cid)) then local name = getCreatureName(cid) if string.find(tostring(name):lower(),"[vip]") then local newname = string.sub(tostring(name), 7) -- conta o nome a partir do sétimo caractere. "[VIP] God Wolf" vai virar "God Wolf" end db.executeQuery("UPDATE `players` SET `name` = '".. newname .."' WHERE `id` = "..getPlayerGUID(cid)..";") end Editado Julho 17, 2014 10 anos por xWhiteWolf (veja o histórico de edições) Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
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.