Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sky = {
- level = 50, -- Level necessario que pode usar
- preco = 10000, -- Preco para salvar o waypoint
- tempo = 30, -- O tempo que você usa-la novamente
- storage = 5000, -- Não mecha
- battle = true, -- Se pode salvar com battle ou não
- skull = true,
- premmy = true
- }
- -- Funcões para salvar a posição
- function doMarkPos(cid, posx, posy, posz)
- setPlayerStorageValue(cid, 19000, posx)
- setPlayerStorageValue(cid, 19001, posy)
- setPlayerStorageValue(cid, 19002, posz)
- end
- function getMarkPos(cid)
- return {x=getPlayerStorageValue(cid, 19000), y=getPlayerStorageValue(cid, 19001), z=getPlayerStorageValue(cid, 19002)}
- end
- -- Termina
- --Comeco da talkaction
- function onSay(cid, words, param)
- if getPlayerLevel(cid) < sky.level then
- return doPlayerSendCancel(cid, "Para usar o comando voce precissa"..configs.minLvL.." para usar.")
- elseif not isPremium(cid) and sky.premmy then
- return doPlayerSendCancel(cid, "Apenas premmium account pode utilizar..")
- elseif (sky.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
- return doPlayerSendCancel(cid,"Voce nao pode estar battle para usar o comando")
- end
- local pos = getCreaturePosition(cid)
- if words == "!waypoint" then
- if exhaustion.get(cid, sky.storage) == FALSE then
- if getMarkPos(cid).x < 1 then
- if getPlayerMoney(cid) >= sky.preco then
- doPlayerRemoveMoney(cid, sky.preco)
- exhaustion.make(cid, sky.storage, sky.tempo)
- doMarkPos(cid, pos.x, pos.y, pos.z)
- doPlayerSendTextMessage(cid, 4, "Você salvou posicao no mapa.")
- else
- doPlayerSendCancel(cid, "Você já gravou posição.")
- end
- else
- doPlayerSendCancel(cid, "Voce nao tem dinheiro falta "..getPlayerMoney(cid) - sky.preco.." de dinheiro.")
- end
- elseif words == "!back" then
- if getMarkPos(cid).x > 0 then
- doTeleportThing(cid, getMarkPos(cid))
- doMarkPos(cid, 0, 0, 0)
- else
- doPlayerSendCancel(cid, "Você não gravou uma posição.")
- end
- end
- return TRUE
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment