functiononSay(cid, words, param)--[Configurações de Condição]__
config = { --[[verdadeiro / Falso]]
needPa = false, -- Precisa de Premium Account? [true / false]
needPz = false, -- Precisa estar em Protection Zone? [true / false]
battle = false, -- Precisa estar sem Batlle para Resetar? [true / false]
withe = false, -- Players PK Withe pode Resetar? [true / false]
red = false, -- Players PK Red pode Resetar? [true / false]
tp = false, -- Teleportar para o Templo após o reset? [true / false]
look = true, -- Mostrar Resets no Look do Player? [true / false]
addLimite = true, -- Abilitar Limite de Resets? [true / false]
setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]
storage = 54676, -- Storage [valor]--[Configurações do Reset]__
resetStatus = {
player = getPlayerGUID(cid), -- Não Mude.
lvl = 717217, -- Level Necessário para Resetar. [valor]
lvlreset = 1, -- Level que retornará após o Reset. [valor]
limite = 100, -- Máximo de resets que um player pode chegar. [valor]
newClasse = 0, -- Id da Nova Vocação após o Reset. [valor]
tempo = 0},}--[Funções]__functionReseting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)returnTRUE
endfunctionnoAll(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)returnTRUE
endfunctionnoTeleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)returnTRUE
endfunctionnoLook(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)returnTRUE
endfunctionnoClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)returnTRUE
endfunctionsetClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)returnTRUE
endfunctionlook(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)returnTRUE
endfunctionteleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)returnTRUE
endfunctiongetResets(cid)localresets = getPlayerStorageValue(cid, config.storage)-- If the storage value is less than 0 or invalid, set resets to 0iftype(resets) ~= "number"orresets < 0then
resets = 0endreturnresets
endlocalresets = getResets(cid)localneedLvl ="Você precisa de "..config.resetStatus.lvl-getPlayerLevel(cid).." level's para resetar."localmsg ="~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos."--[Condiçoes]__localstorageKey = 13545localstorageKey = 13587ifgetCreatureStorage(cid, storageKey) < os.time() then
doPlayerPopupFYI(cid, "Somente Player [VIP] Account.")returntrueelseif(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"Voce Precisa estar em Protection Zone Para Resetar.")returnTRUE
elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then
doPlayerSendTextMessage(cid, 22, "Voce ja atingiu o Limite de Resets.")returnTRUE
elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"Voce ta PK White, por isso não pode resetar.")returnTRUE
elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"Voce ta PK Red, por isso não pode resetar.")returnTRUE
elseif(config.needPa == true) andnotisPremium(cid) then
doPlayerSendTextMessage(cid,22,"Voce Precisa ser Premium Account para Resetar.")returnTRUE
elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"Voce Precisa estar sem Battle para Resetar.")returnTRUE
elseifgetPlayerLevel(cid) >= config.resetStatus.lvland (config.tp == true) and (config.look == true) and (config.setClasse == true) then
addEvent(Reseting, config.resetStatus.tempo* 1000, cid)elseifgetPlayerLevel(cid) >= config.resetStatus.lvland (config.tp == false) and (config.look == false) and (config.setClasse == false) then
addEvent(noAll, config.resetStatus.tempo* 1000, cid)elseifgetPlayerLevel(cid) >= config.resetStatus.lvland (config.tp == false) and (config.look == true) and (config.setClasse == true) then
addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)elseifgetPlayerLevel(cid) >= config.resetStatus.lvland (config.tp == true) and (config.look == false) and (config.setClasse == true) then
addEvent(noLook, config.resetStatus.tempo* 1000, cid)elseifgetPlayerLevel(cid) >= config.resetStatus.lvland (config.tp == true) and (config.look == true) and (config.setClasse == false) then
addEvent(noClasse, config.resetStatus.tempo* 1000, cid)elseifgetPlayerLevel(cid) >= config.resetStatus.lvland (config.tp == false) and (config.look == false) and (config.setClasse == true) then
addEvent(setClasse, config.resetStatus.tempo* 1000, cid)elseifgetPlayerLevel(cid) >= config.resetStatus.lvland (config.tp == false) and (config.look == true) and (config.setClasse == false) then
addEvent(look, config.resetStatus.tempo* 1000, cid)elseifgetPlayerLevel(cid) >= config.resetStatus.lvland (config.tp == true) and (config.look == false) and (config.setClasse == false) then
addEvent(teleporting, config.resetStatus.tempo* 1000, cid)elseifdoPlayerSendCancel(cid, needLvl) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)returnTRUE
endreturnTRUE
end--[By: Linnux]__
COMO COLOCO CONDIÇÃO DE VIP INFINITE NO CODIGO ACIMA
functiononSay(cid, words, param) ifwords == "!buyacc"then-- Check if the player already has permanent VIP accessifgetPlayerStorageValue(cid, 13587) == 2^31 - 1then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have permanent VIP access !vipacc.")returntrueend-- Check if the player already has temporary VIPifgetPlayerStorageValue(cid, 13587) - os.time() > 0then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have VIP. Please wait for your time to expire.")returntrueendlocalitemid = 6527localcount = 100ifdoPlayerRemoveItem(cid, itemid, count) then-- Set permanent VIP accesslocalpermanentAccess = 2^31 - 1
setPlayerStorageValue(cid, 13587, permanentAccess)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received permanent VIP access on your character.")else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need [" .. count .. " " .. getItemNameById(itemid) .. "] to get VIP.")endelseifwords == "!vipacc"thenlocaltimenow = os.time()localquantity = math.floor((getPlayerStorageValue(cid, 13587) - timenow) / (24 * 60 * 60))ifquantity > 0then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have permanent VIP access.")else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have permanent VIP access.")endelseifwords == "/checkvip"thenifgetPlayerAccess(cid) == 5thenifnotparamthen
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid parameter specified.")elselocalplayer = getPlayerByName(param)ifnotisPlayer(player) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")elselocaltimenow = os.time()localquantity = math.floor((getPlayerStorageValue(player, 13587) - timenow) / (24 * 60 * 60))ifquantity > 0then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player " .. param .. " has " .. quantity .. " days of VIP.")else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player " .. param .. " does not have any VIP days.")endendendelse
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have access to this command.")endelseifwords == "/addvip"thenifgetPlayerAccess(cid) == 5thenlocalt = string.explode(param, ",")ifnott[2] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid parameter specified.")elselocalplayerName = t[1]localplayer = getPlayerByName(playerName)localdays = tonumber(t[2])ifnotplayerthen
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn't exist or is offline.")returntrueendlocaldaysvalue = days * 3600 * 24localstorageplayer = getPlayerStorageValue(player, 13587)localtimenow = os.time()localtime = storageplayer <= 0and (timenow + daysvalue) or (storageplayer + daysvalue)
setPlayerStorageValue(player, 13587, time)localquantity = math.floor((getPlayerStorageValue(player, 13587) - timenow) / (3600 * 24))
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "You have " .. quantity .. " days of VIP remaining.")endelse
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have access to this command.")endelseifwords == "/delvip"thenifgetPlayerAccess(cid) == 5thenlocaldec = MESSAGE_INFO_DESCR
ifparam == ""thenreturntrue, doPlayerSendTextMessage(cid, 18, "Command parameter required.")endlocalt = string.explode(param, ",")localC = {}
C.pos = getPlayerPosition(cid)
C.uid = getCreatureByName(t[1])
C.time = ((tonumber(t[2]) == nil) and1ortonumber(t[2])) * 3600 * 24-- VIP time per day.
C.days = (tonumber(t[2]) == nil) and1ortonumber(t[2]) -- VIP days.ifgetPlayerStorageValue(C.uid, 13587) < C.timethen
doPlayerSendTextMessage(cid, dec, 'The player ' .. t[1] .. ' does not have ' .. C.days .. ' days of VIP.')else
doPlayerSendTextMessage(cid, dec, 'You have removed ' .. C.days .. ' days of VIP from player ' .. t[1] .. '.')
setPlayerStorageValue(C.uid, 13587, getPlayerStorageValue(C.uid, 13587) - C.time)end
doSendMagicEffect(C.pos, math.random(28, 30))else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have access to this command.")endendreturntrueend
functiononSay(cid, words, param)ifwords == "!buyvip"then-- Check if the player already has permanent VIPifgetPlayerStorageValue(cid, 13587) == 2^31 - 1then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have permanent VIP and cannot buy temporary VIP !vipacc.")returntrueend-- Check if the player has already used the commandifgetPlayerStorageValue(cid, 13587) == 1then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already used this command and cannot use it again.")returntrueendlocalitemid = 2159localcount = 50000ifdoPlayerRemoveItem(cid, itemid, count) thenlocaldays = 372localdaysvalue = days * 24 * 60 * 60localstorageplayer = getPlayerStorageValue(cid, 13545)localtimenow = os.time()localtime
ifstorageplayer - timenow <= 0then
time = timenow + daysvalue
else
time = storageplayer + daysvalue
end-- Update VIP status without modifying the name
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Added " .. days .. " days of VIP to your character.")
setPlayerStorageValue(cid, 13545, time)localquantity = math.floor((getPlayerStorageValue(cid, 13545) - timenow) / (24 * 60 * 60))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have " .. (quantity < 0and0orquantity) .. " days of VIP remaining.")-- Mark that the player used the command
setPlayerStorageValue(cid, 13587, 1)else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need [" .. count .. " " .. getItemNameById(itemid) .. "] to add VIP.")endelseifwords == "!vipdays"thenlocaltimenow = os.time()localvipEndTime = getPlayerStorageValue(cid, 13545)localvipDays = 0ifvipEndTime > 0then-- Calculate the remaining VIP days
vipDays = math.ceil((vipEndTime - timenow) / (24 * 60 * 60))endifvipDays > 0then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have " .. vipDays .. " days of VIP on your character.")else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have VIP days.")endelseifwords == "/checkvip"thenifgetPlayerAccess(cid) == 5thenifnotparamorparam == ""then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid parameter.")elselocalplayer = getPlayerByName(param)ifnotisPlayer(player) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")elselocaltimenow = os.time()localquantity = math.floor((getPlayerStorageValue(player, 13545) - timenow) / (24 * 60 * 60))ifquantity > 0then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player " .. param .. " has " .. quantity .. " days of VIP.")else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player " .. param .. " does not have VIP days.")endendendelse
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have access to this command.")endelseifwords == "/addvip"thenifgetPlayerAccess(cid) == 5thenlocalt = string.explode(param, ",")ifnott[2] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid parameter.")elselocalplayerName = t[1]localplayer = getPlayerByName(playerName)ifnotisPlayer(player) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. playerName .. " not found.")elselocaldays = tonumber(t[2])localdaysvalue = days * 24 * 60 * 60localstorageplayer = getPlayerStorageValue(player, 13545)localtimenow = os.time()localtime = storageplayer <= 0and (timenow + daysvalue) or (storageplayer + daysvalue)-- Update VIP status without modifying the name
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Added " .. days .. " days of VIP to your character.")
setPlayerStorageValue(player, 13545, time)localquantity = math.floor((getPlayerStorageValue(player, 13545) - timenow) / (24 * 60 * 60))
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "You have " .. quantity .. " days of VIP remaining.")endendelse
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have access to this command.")endelseifwords == "/delvip"thenifgetPlayerAccess(cid) == 5thenlocaldec = MESSAGE_INFO_DESCR
ifparam == ""thenreturnTRUE, doPlayerSendTextMessage(cid, 18, "Command parameter is required.")endlocalt = string.explode(param, ",")localplayer = getPlayerByName(t[1])ifnotisPlayer(player) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")elselocaldays = tonumber(t[2])localtimeToRemove = days * 24 * 60 * 60localcurrentTime = getPlayerStorageValue(player, 13545)ifcurrentTime < timeToRemovethen
doPlayerSendTextMessage(cid, dec, "Player " .. t[1] .. " does not have " .. days .. " days of VIP.")else
doPlayerSendTextMessage(cid, dec, "Removed " .. days .. " days of VIP from player " .. t[1] .. ".")
setPlayerStorageValue(player, 13545, currentTime - timeToRemove)endendelse
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have access to this command.")endendreturntrueend
Pergunta
Muvuka 1
COMO COLOCO CONDIÇÃO DE VIP INFINITE NO CODIGO ACIMA
Link para o comentário
Compartilhar em outros sites
0 respostass a esta questão
Posts Recomendados