Ir para conteúdo
  • Cadastre-se

(Resolvido)Problema em script de Evento


Posts Recomendados

  • Moderador

Olá... estou tentando instalar um evento no meu servidor porém está com um errinho...

 

image.thumb.png.b588a93a0391a38ad30f2a9f628b9654.png

 

IOE.lua

Spoiler

function onStepIn(cid, item, fromPos, toPos)
local random_item = IOE_REWARDS[math.random(1, #IOE_REWARDS)]
local templo = getPlayerTown(cid)
local hora = os.date("%X")
local data = os.date("%x")
    if isPlayer(cid) then
        if item.uid == 5550 then 
            doSendMagicEffect(fromPos, CONST_ME_TELEPORT)
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
            doBroadcastMessage("[ISLAND OF ELEMENTALS] The player ["..getCreatureName(cid).."] joined!")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Welcome, wait for the opening of the event. Call your friends to a minimum of players required for them to open. Remembering if you get older will lose items and skills.')
        end
        if item.uid == 5551 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 1);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5552 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 2);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5553 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 3);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5554 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 4);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5555 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 5);")
            doTeleportThing(cid, getTownTemplePosition(templo))
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you have completed the event!')
        end
        if item.uid == 5556 then 
            doTeleportThing(cid, getTownTemplePosition(templo))
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] You left the event.!')
        end
    end
return true
end

 

 

Já em outro evento, tenho esse erro:

 

image.thumb.png.d402c206a7c9e8a12a53247d2940dd59.png

 

Spoiler

function onSay(cid, words, param, channel)
local k = string.explode(param, ",")
if(k[1] ~= nil) then
        if(string.upper(k[1]) == 'INFO') then
            local score = {}
            local output =  "You have " .. getPlayerStorageValue(cid, SBW_SCORE) .. " points.\nYou have "..getPlayerStorageValue(cid, SBW_AMMO).."x munitions.\n------------------\nThe biggest killer:\n"
            for _, pid in ipairs(getPlayersOnline()) do
                if getPlayerStorageValue(pid, SBW_INEVENT) then
                    table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)})
                end
            end
            local lx = table.getn(score)
            if(lx > 3) then lx = 3 end
                table.sort(score, function(a, b) return a[2] > b[2] end)
                for k = 1,lx do
                    output = output .. k..". "..score[k][1] .." [".. score[k][2] .."].\n"
                end
                doPlayerPopupFYI(cid, output)
            end
if (string.upper(k[1]) == 'ATIRAR') then
    if(getPlayerStorageValue(cid, SBW_INEVENT) == 1) and not getTileInfo(getThingPos(cid)).protection then
        if getPlayerStorageValue(cid, SBW_EXAUSTHED) <= 1 then
            if(getPlayerStorageValue(cid, SBW_AMMO) > 0) then
                if SBW_STATUS == 'on' then
                    if(SBW_AMMOINFI == false) then
                        doPlayerSetStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO)-1)
                    end
                    doPlayerSetStorageValue(cid, SBW_EXAUSTHED, 2)
                    lineAnimation(getPlayerLookDirection(cid),getCreaturePosition(cid),12,cid,1,0,1,0,0,0,1,0)
                    addEvent(doPlayerSetStorageValue, SBW_SHOOTEXAUSTHED, cid, SBW_EXAUSTHED, 1)
                    if (getPlayerStorageValue(cid, SBW_AMMO) ~= 1) then
                        doPlayerSendTextMessage(cid, 27, "Remain "..getPlayerStorageValue(cid, SBW_AMMO).."x snowball.")
                    else
                        doPlayerSendTextMessage(cid, 27, "Using your last snowball, recharge.")
                    end
                end
            else
                doPlayerSendCancel(cid, "You are without snowballs, recharge in the center of the field or kill an enemy.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)     
            end
        else
            doPlayerPopupFYI(cid, "Calm down you should wait to shoot again.") 
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            return false
        end
    else
        doPlayerPopupFYI(cid, "You need to be indoors or out of the protection zone..") 
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    end
end
end
return true
end
 
 
                function lineAnimation(lookDir,playerPos,effect,cid,fvar,fpos,ffound,fposV,fcheck,fvcid,floopCounter,fvpid, name)
                local var = fvar
                local pos = fpos
                local found = ffound
                local posV = fposV
                local check = fcheck
                local vcid = fvcid
                local loopCounter = floopCounter
                local vpid = fvpid
                local storage = SBW_EXAUSTHED
                        if var < 2 then
                                vcid = cid
                        end
                        pos = playerPos
                        if not isInWallArray(convert(lookDir,pos)) then--isInWallArray({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z}) then --isInArray(t.onShoot.misc.walls_id, getThingfromPos({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z, stackpos=0}).itemid) then
                                doSendDistanceShoot(pos, convert(lookDir,pos),effect)
                                pos = convert(lookDir,pos)
                                var=var+1
                                posV = convertV(lookDir,playerPos)
                                for _, pid in ipairs(getPlayersOnline()) do
                                        if (getCreaturePosition(pid).x == pos.x and getCreaturePosition(pid).y == pos.y and getCreaturePosition(pid).z == pos.z) then
                                                --if loopCounter > 2 then
                                                vpid = pid
                                                --end
                                                if (vpid ~= vcid) then
                                                        if var > 2 then
                                                                if (getCreaturePosition(pid).x == posV.x and getCreaturePosition(pid).y == posV.y and getCreaturePosition(pid).z == posV.z) then
                                                                        killPlayer(pid,pos,getCreatureName(vcid))
                                                                        if (lookDir == 0) or (lookDir == 2) then
                                                                                var = 6
                                                                        else
                                                                                var = 8
                                                                        end
                                                                end
                                                        end
                                                        killPlayer(pid,pos,vcid)
                                                        if (lookDir == 0) or (lookDir == 2) then
                                                                var = 6
                                                        else
                                                                var = 8
                                                        end
                                                end
                                        end
                                        loopCounter = loopCounter +1
                                end    
                                if (lookDir == 0) or (lookDir == 2) then
                                        if var ~= 6 then
                                                addEvent(lineAnimation, SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid)
                                        else
                                                var = 1
                                        end
                                else
                                        if var ~= 8 then
                                                addEvent(lineAnimation,  SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid)
                                        else
                                                var = 1
                                        end
                                end
                        else
                                doSendMagicEffect(convert(lookDir,pos),2)
                                var = 1
                        end
                end
 
                local ret = {}
                function convert(lookDir,pos)
                local positions = {
                        [0] = {x = pos.x, y = pos.y-1, z = pos.z},
                        [1] = {x = pos.x+1, y = pos.y, z = pos.z},
                        [2] = {x = pos.x, y = pos.y+1, z = pos.z},
                        [3] = {x = pos.x-1, y = pos.y, z = pos.z}
                        }
                        ret = positions[lookDir]
                return ret
                end
 
 
                local ret = {}
                function convertV(lookDir,pos)
                local positions = {
                        [0] = {x = pos.x, y = pos.y+1, z = pos.z},
                        [1] = {x = pos.x-1, y = pos.y, z = pos.z},
                        [2] = {x = pos.x, y = pos.y-1, z = pos.z},
                        [3] = {x = pos.x+1, y = pos.y, z = pos.z}
                        }
                        ret = positions[lookDir]
                return ret
                end
                
                function isInWallArray(pos)
                        for k = 0, table.getn(SBW_WALLSID) do
                                if getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k] then --this doesn't even make sense but tried other ways and it gave errors, so meh 2lazy2search
                                    return true    
                                end
                        end
                        return false
                end
                               
                function killPlayer(cid, pos, killer)
                    local t_l = SBW_AREA[1]
                    local b_r = SBW_AREA[2]
                    local posti = {}
                    local isPossibleToTeleportPlayer = false
                    while (isPossibleToTeleportPlayer == FALSE) do
                        posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7)
                        if isInWallArray(posti) == FALSE then
                            isPossibleToTeleportPlayer = TRUE
                        end
                    end
                    doTeleportThing(cid, posti)
                    doSendMagicEffect(pos,2)
                    doSendMagicEffect(posti,6)
                    doSendAnimatedText(pos, ""..getCreatureName(killer).." ", 55)
                    doPlayerSendTextMessage(cid, 27, "You died to "..getCreatureName(killer)..".")
                    doPlayerSetStorageValue(killer, SBW_SCORE, getPlayerStorageValue(killer, SBW_SCORE)+SBW_POINTSKILL)                
                    doPlayerSendTextMessage(killer, 27, "You've killed "..getCreatureName(cid)..".")
                    if SBW_LOSTSCORE then
                        doPlayerSetStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE)-1)
                    end
                    if SBW_RESETAMMO then
                        doPlayerSetStorageValue(cid, SBW_AMMO, SBW_MINAMMO)
                    end
                end

 

@Vodkart

Editado por movie (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Moderador
  • Moderador
15 minutos atrás, victor4312 disse:

function onStepIn(cid, item, fromPos, toPos)
local random_item = IOE_REWARDS[math.random(1, #IOE_REWARDS)]
local templo = getPlayerTown(cid)
local hora = os.date("%X")
local data = os.date("%x")
    if isPlayer(cid) then
        if item.uid == 5550 then 
            doSendMagicEffect(fromPos, CONST_ME_TELEPORT)
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
            doBroadcastMessage("[ISLAND OF ELEMENTALS] The player ["..getCreatureName(cid).."] joined!")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Welcome, wait for the opening of the event. Call your friends to a minimum of players required for them to open. Remembering if you get older will lose items and skills.')
        end
        if item.uid == 5551 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 1);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5552 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 2);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5553 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 3);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5554 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 4);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5555 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 5);")
            doTeleportThing(cid, getTownTemplePosition(templo))
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you have completed the event!')
        end
        if item.uid == 5556 then 
            doTeleportThing(cid, getTownTemplePosition(templo))
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] You left the event.!')
        end
    end
return true
end

function onSay(cid, words, param, channel)
local k = string.explode(param, ",")
if(k[1] ~= nil) then
		if(string.upper(k[1]) == 'INFO') then
            local score = {}
            local output =  "You have " .. getPlayerStorageValue(cid, SBW_SCORE) .. " points.\nYou have "..getPlayerStorageValue(cid, SBW_AMMO).."x munitions.\n------------------\nThe biggest killer:\n"
            for _, pid in ipairs(getPlayersOnline()) do
                if getPlayerStorageValue(pid, SBW_INEVENT) then
                    table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)})
                end
            end
            local lx = table.getn(score)
            if(lx > 3) then lx = 3 end
                table.sort(score, function(a, b) return a[2] > b[2] end)
                for k = 1,lx do
                    output = output .. k..". "..score[k][1] .." [".. score[k][2] .."].\n"
                end
                doPlayerPopupFYI(cid, output)
            end
if (string.upper(k[1]) == 'ATIRAR') then
    if(getPlayerStorageValue(cid, SBW_INEVENT) == 1) and not getTileInfo(getThingPos(cid)).protection then
        if getPlayerStorageValue(cid, SBW_EXAUSTHED) <= 1 then
            if(getPlayerStorageValue(cid, SBW_AMMO) > 0) then
                if SBW_STATUS == 'on' then
                    if(SBW_AMMOINFI == false) then
                        doPlayerSetStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO)-1)
                    end
                    doPlayerSetStorageValue(cid, SBW_EXAUSTHED, 2)
                    lineAnimation(getPlayerLookDirection(cid),getCreaturePosition(cid),12,cid,1,0,1,0,0,0,1,0)
                    addEvent(doPlayerSetStorageValue, SBW_SHOOTEXAUSTHED, cid, SBW_EXAUSTHED, 1)
                    if (getPlayerStorageValue(cid, SBW_AMMO) ~= 1) then
                        doPlayerSendTextMessage(cid, 27, "Remain "..getPlayerStorageValue(cid, SBW_AMMO).."x snowball.")
                    else
                        doPlayerSendTextMessage(cid, 27, "Using your last snowball, recharge.")
                    end
                end
            else
                doPlayerSendCancel(cid, "You are without snowballs, recharge in the center of the field or kill an enemy.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)     
            end
        else
            doPlayerPopupFYI(cid, "Calm down you should wait to shoot again.") 
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            return false
        end
    else
        doPlayerPopupFYI(cid, "You need to be indoors or out of the protection zone..") 
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    end
end
end
return true
end
 
 
                function lineAnimation(lookDir,playerPos,effect,cid,fvar,fpos,ffound,fposV,fcheck,fvcid,floopCounter,fvpid, name)
                local var = fvar
                local pos = fpos
                local found = ffound
                local posV = fposV
                local check = fcheck
                local vcid = fvcid
                local loopCounter = floopCounter
                local vpid = fvpid
                local storage = SBW_EXAUSTHED
                        if var < 2 then
                                vcid = cid
                        end
                        pos = playerPos
                        if not isInWallArray(convert(lookDir,pos)) then--isInWallArray({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z}) then --isInArray(t.onShoot.misc.walls_id, getThingfromPos({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z, stackpos=0}).itemid) then
                                doSendDistanceShoot(pos, convert(lookDir,pos),effect)
                                pos = convert(lookDir,pos)
                                var=var+1
                                posV = convertV(lookDir,playerPos)
                                for _, pid in ipairs(getPlayersOnline()) do
                                        if (getCreaturePosition(pid).x == pos.x and getCreaturePosition(pid).y == pos.y and getCreaturePosition(pid).z == pos.z) then
                                                --if loopCounter > 2 then
                                                vpid = pid
                                                --end
                                                if (vpid ~= vcid) then
                                                        if var > 2 then
                                                                if (getCreaturePosition(pid).x == posV.x and getCreaturePosition(pid).y == posV.y and getCreaturePosition(pid).z == posV.z) then
                                                                        killPlayer(pid,pos,getCreatureName(vcid))
                                                                        if (lookDir == 0) or (lookDir == 2) then
                                                                                var = 6
                                                                        else
                                                                                var = 8
                                                                        end
                                                                end
                                                        end
                                                        killPlayer(pid,pos,vcid)
                                                        if (lookDir == 0) or (lookDir == 2) then
                                                                var = 6
                                                        else
                                                                var = 8
                                                        end
                                                end
                                        end
                                        loopCounter = loopCounter +1
                                end    
                                if (lookDir == 0) or (lookDir == 2) then
                                        if var ~= 6 then
                                                addEvent(lineAnimation, SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid)
                                        else
                                                var = 1
                                        end
                                else
                                        if var ~= 8 then
                                                addEvent(lineAnimation,  SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid)
                                        else
                                                var = 1
                                        end
                                end
                        else
                                doSendMagicEffect(convert(lookDir,pos),2)
                                var = 1
                        end
                end
 
                local ret = {}
                function convert(lookDir,pos)
                local positions = {
                        [0] = {x = pos.x, y = pos.y-1, z = pos.z},
                        [1] = {x = pos.x+1, y = pos.y, z = pos.z},
                        [2] = {x = pos.x, y = pos.y+1, z = pos.z},
                        [3] = {x = pos.x-1, y = pos.y, z = pos.z}
                        }
                        ret = positions[lookDir]
                return ret
                end
 
 
                local ret = {}
                function convertV(lookDir,pos)
                local positions = {
                        [0] = {x = pos.x, y = pos.y+1, z = pos.z},
                        [1] = {x = pos.x-1, y = pos.y, z = pos.z},
                        [2] = {x = pos.x, y = pos.y-1, z = pos.z},
                        [3] = {x = pos.x+1, y = pos.y, z = pos.z}
                        }
                        ret = positions[lookDir]
                return ret
                end
                
                function isInWallArray(pos)
                        for k = 0, table.getn(SBW_WALLSID) do
                                if getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k] then --this doesn't even make sense but tried other ways and it gave errors, so meh 2lazy2search
                                    return true    
                                end
                        end
                        return false
                end
                               
                function killPlayer(cid, pos, killer)
                    local t_l = SBW_AREA[1]
                    local b_r = SBW_AREA[2]
                    local posti = {}
                    local isPossibleToTeleportPlayer = false
                    while (isPossibleToTeleportPlayer == FALSE) do
                        posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7)
                        if isInWallArray(posti) == FALSE then
                            isPossibleToTeleportPlayer = TRUE
                        end
                    end
                    doTeleportThing(cid, posti)
                    doSendMagicEffect(pos,2)
                    doSendMagicEffect(posti,6)
                    doSendAnimatedText(pos, ""..getCreatureName(killer).." ", 55)
                    doPlayerSendTextMessage(cid, 27, "You died to "..getCreatureName(killer)..".")
                    doPlayerSetStorageValue(killer, SBW_SCORE, getPlayerStorageValue(killer, SBW_SCORE)+SBW_POINTSKILL)                
                    doPlayerSendTextMessage(killer, 27, "You've killed "..getCreatureName(cid)..".")
                    if SBW_LOSTSCORE then
                        doPlayerSetStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE)-1)
                    end
                    if SBW_RESETAMMO then
                        doPlayerSetStorageValue(cid, SBW_AMMO, SBW_MINAMMO)
                    end
                end

está na ordem, tenta.

 

image.thumb.png.489feedd7027861c4b2a881f411e436f.png

Link para o post
Compartilhar em outros sites
  • Moderador
  • Moderador
1 minuto atrás, victor4312 disse:
  Ocultar conteúdo

function onStepIn(cid, item, fromPos, toPos)
local random_item = IOE_REWARDS[math.random(1, #IOE_REWARDS)]
local templo = getPlayerTown(cid)
local hora = os.date("%X")
local data = os.date("%x")
    if isPlayer(cid) then
        if item.uid == 5550 then 
            doSendMagicEffect(fromPos, CONST_ME_TELEPORT)
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
            doBroadcastMessage("[ISLAND OF ELEMENTALS] The player ["..getCreatureName(cid).."] joined!")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Welcome, wait for the opening of the event. Call your friends to a minimum of players required for them to open. Remembering if you get older will lose items and skills.')
        end
        if item.uid == 5551 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 1);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5552 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 2);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5553 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 3);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5554 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 4);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5555 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 5);")
            doTeleportThing(cid, getTownTemplePosition(templo))
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you have completed the event!')
        end
        if item.uid == 5556 then 
            doTeleportThing(cid, getTownTemplePosition(templo))
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] You left the event.!')
        end
    end
return true
end

  Ocultar conteúdo

function onSay(cid, words, param, channel)
local k = string.explode(param, ",")
if(k[1] ~= nil) then
        if(string.upper(k[1]) == 'INFO') then
            local score = {}
            local output =  "You have " .. getPlayerStorageValue(cid, SBW_SCORE) .. " points.\nYou have "..getPlayerStorageValue(cid, SBW_AMMO).."x munitions.\n------------------\nThe biggest killer:\n"
            for _, pid in ipairs(getPlayersOnline()) do
                if getPlayerStorageValue(pid, SBW_INEVENT) then
                    table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)})
                end
            end
            local lx = table.getn(score)
            if(lx > 3) then lx = 3 end
                table.sort(score, function(a, b) return a[2] > b[2] end)
                for k = 1,lx do
                    output = output ..k..". "..score[k] [1] .." [".. score[k] [2] .."].\n"
                end
                doPlayerPopupFYI(cid, output)
            end
if (string.upper(k[1]) == 'ATIRAR') then
    if(getPlayerStorageValue(cid, SBW_INEVENT) == 1) and not getTileInfo(getThingPos(cid)).protection then
        if getPlayerStorageValue(cid, SBW_EXAUSTHED) <= 1 then
            if(getPlayerStorageValue(cid, SBW_AMMO) > 0) then
                if SBW_STATUS == 'on' then
                    if(SBW_AMMOINFI == false) then
                        doPlayerSetStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO)-1)
                    end
                    doPlayerSetStorageValue(cid, SBW_EXAUSTHED, 2)
                lineAnimation(getPlayerLookDirection(cid),getCreaturePosition(cid),12,cid,1,0,1,0,0,0,1,0)
                    addEvent(doPlayerSetStorageValue, SBW_SHOOTEXAUSTHED, cid, SBW_EXAUSTHED, 1)
                    if (getPlayerStorageValue(cid, SBW_AMMO) ~= 1) then
                        doPlayerSendTextMessage(cid, 27, "Remain "..getPlayerStorageValue(cid, SBW_AMMO).."x snowball.")
                    else
                        doPlayerSendTextMessage(cid, 27, "Using your last snowball, recharge.")
                    end
                end
            else
                doPlayerSendCancel(cid, "You are without snowballs, recharge in the center of the field or kill an enemy.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)     
            end
        else
            doPlayerPopupFYI(cid, "Calm down you should wait to shoot again.") 
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            return false
        end
    else
        doPlayerPopupFYI(cid, "You need to be indoors or out of the protection zone..") 
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    end
end
end
return true
end
 
 
                function lineAnimation(lookDir,playerPos,effect,cid,fvar,fpos,ffound,fposV,fcheck,fvcid,floopCounter,fvpid, name)
                local var = fvar
                local pos = fpos
                local found = ffound
                local posV = fposV
                local check = fcheck
                local vcid = fvcid
                local loopCounter = floopCounter
                local vpid = fvpid
                local storage = SBW_EXAUSTHED
                        if var < 2 then
                                vcid = cid
                        end
                        pos = playerPos
                        if not isInWallArray(convert(lookDir,pos)) then--isInWallArray({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z}) then --isInArray(t.onShoot.misc.walls_id, getThingfromPos({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z, stackpos=0}).itemid) then
                                doSendDistanceShoot(pos, convert(lookDir,pos),effect)
                                pos = convert(lookDir,pos)
                                var=var+1
                                posV = convertV(lookDir,playerPos)
                                for _, pid in ipairs(getPlayersOnline()) do
                                        if (getCreaturePosition(pid).x == pos.x and getCreaturePosition(pid).y == pos.y and getCreaturePosition(pid).z == pos.z) then
                                                --if loopCounter > 2 then
                                                vpid = pid
                                                --end
                                                if (vpid ~= vcid) then
                                                        if var > 2 then
                                                                if (getCreaturePosition(pid).x == posV.x and getCreaturePosition(pid).y == posV.y and getCreaturePosition(pid).z == posV.z) then
                                                                        killPlayer(pid,pos,getCreatureName(vcid))
                                                                        if (lookDir == 0) or (lookDir == 2) then
                                                                                var = 6
                                                                        else
                                                                                var = 8
                                                                        end
                                                                end
                                                        end
                                                        killPlayer(pid,pos,vcid)
                                                        if (lookDir == 0) or (lookDir == 2) then
                                                                var = 6
                                                        else
                                                                var = 8
                                                        end
                                                end
                                        end
                                        loopCounter = loopCounter +1
                                end    
                                if (lookDir == 0) or (lookDir == 2) then
                                        if var ~= 6 then
                                                addEvent(lineAnimation, SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid)
                                        else
                                                var = 1
                                        end
                                else
                                        if var ~= 8 then
                                                addEvent(lineAnimation,  SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid)
                                        else
                                                var = 1
                                        end
                                end
                        else
                                doSendMagicEffect(convert(lookDir,pos),2)
                                var = 1
                        end
                end
 
                local ret = {}
                function convert(lookDir,pos)
                local positions = {
                        [0] = {x = pos.x, y = pos.y-1, z = pos.z},
                        [1] = {x = pos.x+1, y = pos.y, z = pos.z},
                        [2] = {x = pos.x, y = pos.y+1, z = pos.z},
                        [3] = {x = pos.x-1, y = pos.y, z = pos.z}
                        }
                        ret = positions[lookDir]
                return ret
                end
 
 
                local ret = {}
                function convertV(lookDir,pos)
                local positions = {
                        [0] = {x = pos.x, y = pos.y+1, z = pos.z},
                        [1] = {x = pos.x-1, y = pos.y, z = pos.z},
                        [2] = {x = pos.x, y = pos.y-1, z = pos.z},
                        [3] = {x = pos.x+1, y = pos.y, z = pos.z}
                        }
                        ret = positions[lookDir]
                return ret
                end
                
                function isInWallArray(pos)
                        for k = 0, table.getn(SBW_WALLSID) do
                                if getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k] then --this doesn't even make sense but tried other ways and it gave errors, so meh 2lazy2search
                                    return true    
                                end
                        end
                        return false
                end
                               
                function killPlayer(cid, pos, killer)
                    local t_l = SBW_AREA[1]
                    local b_r = SBW_AREA[2]
                    local posti = {}
                    local isPossibleToTeleportPlayer = false
                    while (isPossibleToTeleportPlayer == FALSE) do
                        posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7)
                        if isInWallArray(posti) == FALSE then
                            isPossibleToTeleportPlayer = TRUE
                        end
                    end
                    doTeleportThing(cid, posti)
                    doSendMagicEffect(pos,2)
                    doSendMagicEffect(posti,6)
                    doSendAnimatedText(pos, ""..getCreatureName(killer).." ", 55)
                    doPlayerSendTextMessage(cid, 27, "You died to "..getCreatureName(killer)..".")
                    doPlayerSetStorageValue(killer, SBW_SCORE, getPlayerStorageValue(killer, SBW_SCORE)+SBW_POINTSKILL)                
                    doPlayerSendTextMessage(killer, 27, "You've killed "..getCreatureName(cid)..".")
                    if SBW_LOSTSCORE then
                        doPlayerSetStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE)-1)
                    end
                    if SBW_RESETAMMO then
                        doPlayerSetStorageValue(cid, SBW_AMMO, SBW_MINAMMO)
                    end
                end

@movie 

 

Tá foda kkkkk

 

image.thumb.png.13bb1c823617e672ab37a643c8c04b74.png

Link para o post
Compartilhar em outros sites
  • Moderador
2 minutos atrás, victor4312 disse:

@movie da onde vc copiou isso?

 

tenta,

  Mostrar conteúdo oculto

function onStepIn(cid, item, fromPos, toPos)
local random_item = IOE_REWARDS[math.random(1, #IOE_REWARDS)]
local templo = getPlayerTown(cid)
local hora = os.date("%X")
local data = os.date("%x")
    if isPlayer(cid) then
        if item.uid == 5550 then 
            doSendMagicEffect(fromPos, CONST_ME_TELEPORT)
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
            doBroadcastMessage("[ISLAND OF ELEMENTALS] The player ["..getCreatureName(cid).."] joined!")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Welcome, wait for the opening of the event. Call your friends to a minimum of players required for them to open. Remembering if you get older will lose items and skills.')
        end
        if item.uid == 5551 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 1);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5552 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 2);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5553 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 3);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5554 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 4);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you advanced one level!')
        end
        if item.uid == 5555 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 5);")
            doTeleportThing(cid, getTownTemplePosition(templo))
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Congratulations, you have completed the event!')
        end
        if item.uid == 5556 then 
            doTeleportThing(cid, getTownTemplePosition(templo))
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] You left the event.!')
        end
    end
return true
end

 

  Ocultar conteúdo

function onSay(cid, words, param, channel)
local k = string.explode(param, ",")
if(k[1] ~= nil) then
        if(string.upper(k[1]) == 'INFO') then
            local score = {}
            local output =  "You have " .. getPlayerStorageValue(cid, SBW_SCORE) .. " points.\nYou have "..getPlayerStorageValue(cid, SBW_AMMO).."x munitions.\n------------------\nThe biggest killer:\n"
            for _, pid in ipairs(getPlayersOnline()) do
                if getPlayerStorageValue(pid, SBW_INEVENT) then
                    table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)})
                end
            end
            local lx = table.getn(score)
            if(lx > 3) then lx = 3 end
                table.sort(score, function(a, b) return a[2] > b[2] end)
                for k = 1,lx do
                    output = output ..k..". "..score[k] [1] .." [".. score[k] [2] .."].\n"
                end
                doPlayerPopupFYI(cid, output)
            end
if (string.upper(k[1]) == 'ATIRAR') then
    if(getPlayerStorageValue(cid, SBW_INEVENT) == 1) and not getTileInfo(getThingPos(cid)).protection then
        if getPlayerStorageValue(cid, SBW_EXAUSTHED) <= 1 then
            if(getPlayerStorageValue(cid, SBW_AMMO) > 0) then
                if SBW_STATUS == 'on' then
                    if(SBW_AMMOINFI == false) then
                        doPlayerSetStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO)-1)
                    end
                    doPlayerSetStorageValue(cid, SBW_EXAUSTHED, 2)
                lineAnimation(getPlayerLookDirection(cid),getCreaturePosition(cid),12,cid,1,0,1,0,0,0,1,0)
                    addEvent(doPlayerSetStorageValue, SBW_SHOOTEXAUSTHED, cid, SBW_EXAUSTHED, 1)
                    if (getPlayerStorageValue(cid, SBW_AMMO) ~= 1) then
                    doPlayerSendTextMessage(cid, 27, "Remain "..getPlayerStorageValue(cid, SBW_AMMO).."x snowball.")
                    else
                        doPlayerSendTextMessage(cid, 27, "Using your last snowball, recharge.")
                    end
                end
            else
                doPlayerSendCancel(cid, "You are without snowballs, recharge in the center of the field or kill an enemy.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)     
            end
        else
            doPlayerPopupFYI(cid, "Calm down you should wait to shoot again.") 
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            return false
        end
    else
        doPlayerPopupFYI(cid, "You need to be indoors or out of the protection zone..") 
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    end
end
end
return true
end
 
 
                function lineAnimation(lookDir,playerPos,effect,cid,fvar,fpos,ffound,fposV,fcheck,fvcid,floopCounter,fvpid, name)
                local var = fvar
                local pos = fpos
                local found = ffound
                local posV = fposV
                local check = fcheck
                local vcid = fvcid
                local loopCounter = floopCounter
                local vpid = fvpid
                local storage = SBW_EXAUSTHED
                        if var < 2 then
                                vcid = cid
                        end
                        pos = playerPos
                        if not isInWallArray(convert(lookDir,pos)) then--isInWallArray({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z}) then --isInArray(t.onShoot.misc.walls_id, getThingfromPos({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z, stackpos=0}).itemid) then
                                doSendDistanceShoot(pos, convert(lookDir,pos),effect)
                                pos = convert(lookDir,pos)
                                var=var+1
                                posV = convertV(lookDir,playerPos)
                                for _, pid in ipairs(getPlayersOnline()) do
                                        if (getCreaturePosition(pid).x == pos.x and getCreaturePosition(pid).y == pos.y and getCreaturePosition(pid).z == pos.z) then
                                                --if loopCounter > 2 then
                                                vpid = pid
                                                --end
                                                if (vpid ~= vcid) then
                                                        if var > 2 then
                                                                if (getCreaturePosition(pid).x == posV.x and getCreaturePosition(pid).y == posV.y and getCreaturePosition(pid).z == posV.z) then
                                                                        killPlayer(pid,pos,getCreatureName(vcid))
                                                                        if (lookDir == 0) or (lookDir == 2) then
                                                                                var = 6
                                                                        else
                                                                                var = 8
                                                                        end
                                                                end
                                                        end
                                                        killPlayer(pid,pos,vcid)
                                                        if (lookDir == 0) or (lookDir == 2) then
                                                                var = 6
                                                        else
                                                                var = 8
                                                        end
                                                end
                                        end
                                        loopCounter = loopCounter +1
                                end    
                                if (lookDir == 0) or (lookDir == 2) then
                                        if var ~= 6 then
                                                addEvent(lineAnimation, SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid)
                                        else
                                                var = 1
                                        end
                                else
                                        if var ~= 8 then
                                                addEvent(lineAnimation,  SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid)
                                        else
                                                var = 1
                                        end
                                end
                        else
                                doSendMagicEffect(convert(lookDir,pos),2)
                                var = 1
                        end
                end
 
                local ret = {}
                function convert(lookDir,pos)
                local positions = {
                        [0] = {x = pos.x, y = pos.y-1, z = pos.z},
                        [1] = {x = pos.x+1, y = pos.y, z = pos.z},
                        [2] = {x = pos.x, y = pos.y+1, z = pos.z},
                        [3] = {x = pos.x-1, y = pos.y, z = pos.z}
                        }
                        ret = positions[lookDir]
                return ret
                end
 
 
                local ret = {}
                function convertV(lookDir,pos)
                local positions = {
                        [0] = {x = pos.x, y = pos.y+1, z = pos.z},
                        [1] = {x = pos.x-1, y = pos.y, z = pos.z},
                        [2] = {x = pos.x, y = pos.y-1, z = pos.z},
                        [3] = {x = pos.x+1, y = pos.y, z = pos.z}
                        }
                        ret = positions[lookDir]
                return ret
                end
                
                function isInWallArray(pos)
                        for k = 0, table.getn(SBW_WALLSID) do
                                if getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k] then --this doesn't even make sense but tried other ways and it gave errors, so meh 2lazy2search
                                    return true    
                                end
                        end
                        return false
                end
                               
                function killPlayer(cid, pos, killer)
                    local t_l = SBW_AREA[1]
                    local b_r = SBW_AREA[2]
                    local posti = {}
                    local isPossibleToTeleportPlayer = false
                    while (isPossibleToTeleportPlayer == FALSE) do
                        posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7)
                        if isInWallArray(posti) == FALSE then
                            isPossibleToTeleportPlayer = TRUE
                        end
                    end
                    doTeleportThing(cid, posti)
                    doSendMagicEffect(pos,2)
                    doSendMagicEffect(posti,6)
                    doSendAnimatedText(pos, ""..getCreatureName(killer).." ", 55)
                    doPlayerSendTextMessage(cid, 27, "You died to "..getCreatureName(killer)..".")
                    doPlayerSetStorageValue(killer, SBW_SCORE, getPlayerStorageValue(killer, SBW_SCORE)+SBW_POINTSKILL)                
                    doPlayerSendTextMessage(killer, 27, "You've killed "..getCreatureName(cid)..".")
                    if SBW_LOSTSCORE then
                        doPlayerSetStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE)-1)
                    end
                    if SBW_RESETAMMO then
                        doPlayerSetStorageValue(cid, SBW_AMMO, SBW_MINAMMO)
                    end
                end

 

 

image.thumb.png.be73013ef455a781d6b66f1944e723e1.png

Peguei daqui:

 

 

Link para o post
Compartilhar em outros sites
  • Moderador
Agora, victor4312 disse:

@movie

 

ioe

  Ocultar conteúdo

function onStepIn(cid, item, fromPos, toPos)
local random_item = IOE_REWARDS[math.random(1, #IOE_REWARDS)]
local templo = getPlayerTown(cid)
local hora = os.date("%X")
local data = os.date("%x")
    if isPlayer(cid) then
        if item.uid == 5550 then 
            doSendMagicEffect(fromPos, CONST_ME_TELEPORT)
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
            doBroadcastMessage("[ISLANF OF ELEMENTALS] O jogador ["..getCreatureName(cid).."] ingressou!")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Bem vindo, aguarde ate a abertura do evento. Chame seus amigos pois ha um minimo de jogadores necessario para que abra. Lembrando se voce morrer ira perder items e skills.')
        end
        if item.uid == 5551 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 1);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Parabens voce avancou um nivel!')
        end
        if item.uid == 5552 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 2);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Parabens voce avancou um nivel!')
        end
        if item.uid == 5553 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 3);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Parabens voce avancou um nivel!')
        end
        if item.uid == 5554 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 4);")
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Parabens voce avancou um nivel!')
        end
        if item.uid == 5555 then 
            doPlayerAddItem(cid, random_item, 1)
            db.query("INSERT INTO `ioe`  VALUES ('', ".. db.escapeString(getPlayerName(cid)) ..  ",".. db.escapeString(data) ..", ".. db.escapeString(hora) ..", ".. random_item ..", 5);")
            doTeleportThing(cid, getTownTemplePosition(templo))
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Parabens voce completou o evento!')
        end
        if item.uid == 5556 then 
            doTeleportThing(cid, getTownTemplePosition(templo))
            doPlayerSendTextMessage(cid,25, '[ISLAND OF ELEMENTALS] Voce saiu do evento!')
        end
    end
return true
end

 

 

Uai kkk o do ioe funcionou, não sei o que eu fiz quando alterei a linguagem...

Link para o post
Compartilhar em outros sites
  • Moderador
1 minuto atrás, victor4312 disse:

@movie

snow

  Ocultar conteúdo

function onSay(cid, words, param, channel)
local k = string.explode(param, ",")
if(k[1] ~= nil) then
        if(string.upper(k[1]) == 'INFO') then
            local score = {}
            local output =  "Voce tem " .. getPlayerStorageValue(cid, SBW_SCORE) .. " pontos.\nVoce tem "..getPlayerStorageValue(cid, SBW_AMMO).."x municoes.\n------------------\nO maior matador:\n"
            for _, pid in ipairs(getPlayersOnline()) do
                if getPlayerStorageValue(pid, SBW_INEVENT) then
                    table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)})
                end
            end
            local lx = table.getn(score)
            if(lx > 3) then lx = 3 end
                table.sort(score, function(a, b) return a[2] > b[2] end)
                for k = 1,lx do
                    output = output .. k..". "..score[k][1] .." [".. score[k][2] .."].\n"
                end
                doPlayerPopupFYI(cid, output)
            end
if (string.upper(k[1]) == 'ATIRAR') then
    if(getPlayerStorageValue(cid, SBW_INEVENT) == 1) and not getTileInfo(getThingPos(cid)).protection then
        if getPlayerStorageValue(cid, SBW_EXAUSTHED) <= 1 then
            if(getPlayerStorageValue(cid, SBW_AMMO) > 0) then
                if SBW_STATUS == 'on' then
                    if(SBW_AMMOINFI == false) then
                        doPlayerSetStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO)-1)
                    end
                    doPlayerSetStorageValue(cid, SBW_EXAUSTHED, 2)
                    lineAnimation(getPlayerLookDirection(cid),getCreaturePosition(cid),12,cid,1,0,1,0,0,0,1,0)
                    addEvent(doPlayerSetStorageValue, SBW_SHOOTEXAUSTHED, cid, SBW_EXAUSTHED, 1)
                    if (getPlayerStorageValue(cid, SBW_AMMO) ~= 1) then
                        doPlayerSendTextMessage(cid, 27, "Restam "..getPlayerStorageValue(cid, SBW_AMMO).."x bolas de neve.")
                    else
                        doPlayerSendTextMessage(cid, 27, "Usando sua ultima bola de neve, recarregue.")
                    end
                end
            else
                doPlayerSendCancel(cid, "Voce esta sem bolas de neve, recarregue no centro do campo ou mate um inimigo.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)     
            end
        else
            doPlayerPopupFYI(cid, "Acalme-se voce deve esperar para atirar novamente.") 
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            return false
        end
    else
        doPlayerPopupFYI(cid, "Voce precisa estar dentro evento ou fora da pz.") 
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    end
end
end
return true
end
 
 
                function lineAnimation(lookDir,playerPos,effect,cid,fvar,fpos,ffound,fposV,fcheck,fvcid,floopCounter,fvpid, name)
                local var = fvar
                local pos = fpos
                local found = ffound
                local posV = fposV
                local check = fcheck
                local vcid = fvcid
                local loopCounter = floopCounter
                local vpid = fvpid
                local storage = SBW_EXAUSTHED
                        if var < 2 then
                                vcid = cid
                        end
                        pos = playerPos
                        if not isInWallArray(convert(lookDir,pos)) then--isInWallArray({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z}) then --isInArray(t.onShoot.misc.walls_id, getThingfromPos({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z, stackpos=0}).itemid) then
                                doSendDistanceShoot(pos, convert(lookDir,pos),effect)
                                pos = convert(lookDir,pos)
                                var=var+1
                                posV = convertV(lookDir,playerPos)
                                for _, pid in ipairs(getPlayersOnline()) do
                                        if (getCreaturePosition(pid).x == pos.x and getCreaturePosition(pid).y == pos.y and getCreaturePosition(pid).z == pos.z) then
                                                --if loopCounter > 2 then
                                                vpid = pid
                                                --end
                                                if (vpid ~= vcid) then
                                                        if var > 2 then
                                                                if (getCreaturePosition(pid).x == posV.x and getCreaturePosition(pid).y == posV.y and getCreaturePosition(pid).z == posV.z) then
                                                                        killPlayer(pid,pos,getCreatureName(vcid))
                                                                        if (lookDir == 0) or (lookDir == 2) then
                                                                                var = 6
                                                                        else
                                                                                var = 8
                                                                        end
                                                                end
                                                        end
                                                        killPlayer(pid,pos,vcid)
                                                        if (lookDir == 0) or (lookDir == 2) then
                                                                var = 6
                                                        else
                                                                var = 8
                                                        end
                                                end
                                        end
                                        loopCounter = loopCounter +1
                                end    
                                if (lookDir == 0) or (lookDir == 2) then
                                        if var ~= 6 then
                                                addEvent(lineAnimation, SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid)
                                        else
                                                var = 1
                                        end
                                else
                                        if var ~= 8 then
                                                addEvent(lineAnimation,  SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid)
                                        else
                                                var = 1
                                        end
                                end
                        else
                                doSendMagicEffect(convert(lookDir,pos),2)
                                var = 1
                        end
                end
 
                local ret = {}
                function convert(lookDir,pos)
                local positions = {
                        [0] = {x = pos.x, y = pos.y-1, z = pos.z},
                        [1] = {x = pos.x+1, y = pos.y, z = pos.z},
                        [2] = {x = pos.x, y = pos.y+1, z = pos.z},
                        [3] = {x = pos.x-1, y = pos.y, z = pos.z}
                        }
                        ret = positions[lookDir]
                return ret
                end
 
 
                local ret = {}
                function convertV(lookDir,pos)
                local positions = {
                        [0] = {x = pos.x, y = pos.y+1, z = pos.z},
                        [1] = {x = pos.x-1, y = pos.y, z = pos.z},
                        [2] = {x = pos.x, y = pos.y-1, z = pos.z},
                        [3] = {x = pos.x+1, y = pos.y, z = pos.z}
                        }
                        ret = positions[lookDir]
                return ret
                end
                
                function isInWallArray(pos)
                        for k = 0, table.getn(SBW_WALLSID) do
                                if getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k] then --this doesn't even make sense but tried other ways and it gave errors, so meh 2lazy2search
                                    return true    
                                end
                        end
                        return false
                end
                               
                function killPlayer(cid, pos, killer)
                    local t_l = SBW_AREA[1]
                    local b_r = SBW_AREA[2]
                    local posti = {}
                    local isPossibleToTeleportPlayer = false
                    while (isPossibleToTeleportPlayer == FALSE) do
                        posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7)
                        if isInWallArray(posti) == FALSE then
                            isPossibleToTeleportPlayer = TRUE
                        end
                    end
                    doTeleportThing(cid, posti)
                    doSendMagicEffect(pos,2)
                    doSendMagicEffect(posti,6)
                    doSendAnimatedText(pos, ""..getCreatureName(killer).." ", 55)
                    doPlayerSendTextMessage(cid, 27, "Voce morreu para "..getCreatureName(killer)..".")
                    doPlayerSetStorageValue(killer, SBW_SCORE, getPlayerStorageValue(killer, SBW_SCORE)+SBW_POINTSKILL)                
                    doPlayerSendTextMessage(killer, 27, "You've killed "..getCreatureName(cid)..".")
                    if SBW_LOSTSCORE then
                        doPlayerSetStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE)-1)
                    end
                    if SBW_RESETAMMO then
                        doPlayerSetStorageValue(cid, SBW_AMMO, SBW_MINAMMO)
                    end
                end

 

 

Cara kkkkkk to rindo de vergonha mesmo kkk, vou tentar depois traduzir essas frases.. mesmo assim, agradeço.

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo