XC
pedido

Evento Zombie

Por xCookie, 20 de jan. de 2014 em Scripts

ganhadores
resolvido
16
2.2k
xCookieX
21 de janeiro de 2014 às 09:15

queria saber como coloco para por pra 3 ganhadores e ganhar os 3 tipos de trofeu com dinheiro aleatorio !!

 

alguem me ajuda ai porrfavor vai levar rep++


alguem me ajuda????

KilluaK
21 de janeiro de 2014 às 13:58

Vc já tem um zombie event aí que tá funcionando certinho? Se tiver posta aqui o arquivo dele no creturescripts/scripts que eu mudo pra vc.

xCookieX
21 de janeiro de 2014 às 18:10

eu essa script no data/creaturescripts/script :

local config = {
	playerCount = 2001, -- Global storage for counting the players left/entered in the event
	
	goblet = 5805, -- id of the gold goblet you'll get when finishing the event.
	rewards = {2159}, -- You will get this +  a gold goblet with your name on.
	--		{moneyId, count, using? 1 for using moneyReward, 0 for not using.}
	moneyReward = {2159, 15, 1},
	
	-- Should be same as in the globalevent!
	-- The zombies will spawn randomly inside this area
	fromPosition = {x = 1137, y = 1020, z = 7}, -- top left cornor of the playground
	toPosition = {x = 1168, y = 1038, z = 7}, -- bottom right cornor of the playground
	}

function onStatsChange(cid, attacker, type, combat, value)
	if isPlayer(cid) and isMonster(attacker) then
		if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
			if getGlobalStorageValue(config.playerCount) >= 2 then
				doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") foi morto pelos zumbis!", MESSAGE_STATUS_CONSOLE_BLUE)
				local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
				doItemSetAttribute(corpse, "description", "Voce reconhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
				doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
				setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1)
			elseif getGlobalStorageValue(config.playerCount) == 1 then
				if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
					doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento 'Zumbi' em 1º lugar, Parabéns! e recebeu 1 troféu de ouro e 15 event coins.", 22)
					local goblet = doPlayerAddItem(cid, config.goblet, 1)
					doItemSetAttribute(goblet, "description", "Ganhador: (" .. getPlayerName(cid) .. ") por vencer em 1º lugar no evento 'Zumbi'.")
					local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
					doItemSetAttribute(corpse, "description", "Voce conhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
					doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
					for _,items in ipairs(config.rewards) do
						doPlayerAddItem(cid, items, 1)
					end
					if config.moneyReward[3] == 1 then
						doPlayerAddItem(cid, config.moneyReward[1], config.moneyReward[2])
					end
				end
						
				for x = config.fromPosition.x, config.toPosition.x do
					for y = config.fromPosition.y, config.toPosition.y do
						for z = config.fromPosition.z, config.toPosition.z do
							areapos = {x = x, y = y, z = z, stackpos = 253}
							getMonsters = getThingfromPos(areapos)
							if isMonster(getMonsters.uid) then
								doRemoveCreature(getMonsters.uid)
							end
						end
					end
				end
			end
			return false
		end
	end
return true
end

porfavor tentar por pra vim 3 ganhadores se consegue ja ta com rep+ garantido :)

KilluaK
22 de janeiro de 2014 às 19:12

Testa ai pra nois

 

 

 


local config = {
	playerCount = 2001, -- Global storage for counting the players left/entered in the event
	
	goblet = 5805, -- id of the gold goblet you'll get when finishing the event.
	rewards = {2159}, -- You will get this +  a gold goblet with your name on.
	--		{moneyId, count, using? 1 for using moneyReward, 0 for not using.}
	moneyReward = {2159, 15, 1},
	
	-- Should be same as in the globalevent!
	-- The zombies will spawn randomly inside this area
	fromPosition = {x = 1137, y = 1020, z = 7}, -- top left cornor of the playground
	toPosition = {x = 1168, y = 1038, z = 7}, -- bottom right cornor of the playground
	}

local trofeu3lugar = 123 -- id do trofeu pro terceiro ganhador
local trofeu2lugar = 111 -- id do trofeu pro segundo ganhador

function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isMonster(attacker) then
        if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
            if getGlobalStorageValue(config.playerCount) > 3 then
                doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") foi morto pelos zumbis!", MESSAGE_STATUS_CONSOLE_BLUE)
                local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                doItemSetAttribute(corpse, "description", "Voce reconhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1)
            elseif getGlobalStorageValue(config.playerCount) == 3 then
                if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
                    doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento 'Zumbi' em 3º lugar, Parabéns! e recebeu XXXXX.", 22)
                    local trof = doPlayerAddItem(cid, trofeu3lugar, 1)
                    doItemSetAttribute(trof, "description", "Ganhador: (" .. getPlayerName(cid) .. ") por vencer em 3º lugar no evento 'Zumbi'.")
                    local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                    doItemSetAttribute(corpse, "description", "Voce conhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                    doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                end
            elseif getGlobalStorageValue(config.playerCount) == 2 then
                if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
                    doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento 'Zumbi' em 2º lugar, Parabéns! e recebeu XXXXX.", 22)
                    local trofe = doPlayerAddItem(cid, trofeu2lugar, 1)
                    doItemSetAttribute(trofe, "description", "Ganhador: (" .. getPlayerName(cid) .. ") por vencer em 2º lugar no evento 'Zumbi'.")
                    local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                    doItemSetAttribute(corpse, "description", "Voce conhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                    doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                end
            elseif getGlobalStorageValue(config.playerCount) == 1 then
                if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
                    doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento 'Zumbi' em 1º lugar, Parabéns! e recebeu XXXXX.", 22)
                    local goblet = doPlayerAddItem(cid, config.goblet, 1)
                    doItemSetAttribute(goblet, "description", "Ganhador: (" .. getPlayerName(cid) .. ") por vencer em 1º lugar no evento 'Zumbi'.")
                    local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                    doItemSetAttribute(corpse, "description", "Voce conhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                    doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                    for _,items in ipairs(config.rewards) do
                        doPlayerAddItem(cid, items, 1)
                    end
                    if config.moneyReward[3] == 1 then
                        doPlayerAddItem(cid, config.moneyReward[1], config.moneyReward[2])
                    end
                end
						
                for x = config.fromPosition.x, config.toPosition.x do
                    for y = config.fromPosition.y, config.toPosition.y do
                        for z = config.fromPosition.z, config.toPosition.z do
                            areapos = {x = x, y = y, z = z, stackpos = 253}
                            getMonsters = getThingfromPos(areapos)
                            if isMonster(getMonsters.uid) then
                                doRemoveCreature(getMonsters.uid)
                            end
                        end
                    end
                end
            end
            return false
        end
    end
    return true
end

xCookieX
23 de janeiro de 2014 às 16:51

vou ver aqui se funcionar eu falo :)


aqui deu ganhou normal so que msg fico nos 3 lugar e nao ganharao premio tente arrumar ai mano

GuuhMasterG
23 de janeiro de 2014 às 17:26

Amoeba, o script funcionou tudo certo... mas ele ganha só ganha o troféu e também as 3 mensagem diz que o jogador ganho em 3º lugar.

Teria como fazer assim

 

1º lugar - 15 a 10 evento coin (2159) + Golden Trophy.

2º lugar - 10 a 6 evento coin (2159) + Silver Trophy

3º lugar - 6 a 1 evento coin (2159) + Bronze Trophy

 

OBS: tomei a liberade de postar nesse tópico porque o xCookie é meu amigo.

KilluaK
23 de janeiro de 2014 às 17:34

Tranquilo. Eu fiz esse aí pelo cel pq estou viajando. Daqui algas horas chego em casa faço certinho

 

Aqui. Não testei.

 

 

 


local config = {
	playerCount = 2001, -- Global storage for counting the players left/entered in the event
	
	goblet = 5805, -- id of the gold goblet you'll get when finishing the event.
	rewards = {2159}, -- You will get this +  a gold goblet with your name on.
	--		{moneyId, count, using? 1 for using moneyReward, 0 for not using.}
	moneyReward = {2159, 15, 1},
	
	-- Should be same as in the globalevent!
	-- The zombies will spawn randomly inside this area
	fromPosition = {x = 1137, y = 1020, z = 7}, -- top left cornor of the playground
	toPosition = {x = 1168, y = 1038, z = 7}, -- bottom right cornor of the playground
	}

local trofeu3lugar = 123
local trofeu2lugar = 123

function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isMonster(attacker) then
        if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
            if getGlobalStorageValue(config.playerCount) >= 4 then
                doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") foi morto pelos zumbis!", MESSAGE_STATUS_CONSOLE_BLUE)
                local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                doItemSetAttribute(corpse, "description", "Voce reconhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1)
            elseif getGlobalStorageValue(config.playerCount) == 3 then
                doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento zombie em terceiro lugar!", MESSAGE_STATUS_CONSOLE_BLUE)
                local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                doItemSetAttribute(corpse, "description", "Voce reconhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1)
                doPlayerAddItem(cid, 2159, math.random(1, 6))
                local trof = doPlayerAddItem(cid, trofeu3lugar, 1)
                doItemSetAttribute(trof, "description", "Ganhador: (" .. getPlayerName(cid) .. ") por vencer em 3º lugar no evento 'Zumbi'.")
            elseif getGlobalStorageValue(config.playerCount) == 2 then
                doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento zombie em segundo lugar!", MESSAGE_STATUS_CONSOLE_BLUE)
                local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                doItemSetAttribute(corpse, "description", "Voce reconhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1)
                doPlayerAddItem(cid, 2159, math.random(6, 10))
                local trofe = doPlayerAddItem(cid, trofeu2lugar, 1)
                doItemSetAttribute(trofe, "description", "Ganhador: (" .. getPlayerName(cid) .. ") por vencer em 2º lugar no evento 'Zumbi'.")
            elseif getGlobalStorageValue(config.playerCount) == 1 then
                if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
                    doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento 'Zumbi' em 1º lugar, Parabéns! e recebeu 1 troféu de ouro e 15 event coins.", 22)
                    local goblet = doPlayerAddItem(cid, config.goblet, 1)
                    doItemSetAttribute(goblet, "description", "Ganhador: (" .. getPlayerName(cid) .. ") por vencer em 1º lugar no evento 'Zumbi'.")
                    local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                    doItemSetAttribute(corpse, "description", "Voce conhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                    doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                    doPlayerAddItem(cid, 2159, math.radom(10, 15))
                    setGlobalStorageValue(config.playerCount, 0)
                    for _,items in ipairs(config.rewards) do
                        doPlayerAddItem(cid, items, 1)
                    end
                    if config.moneyReward[3] == 1 then
                        doPlayerAddItem(cid, config.moneyReward[1], config.moneyReward[2])
                    end
                end
						
                for x = config.fromPosition.x, config.toPosition.x do
                    for y = config.fromPosition.y, config.toPosition.y do
                        for z = config.fromPosition.z, config.toPosition.z do
                            areapos = {x = x, y = y, z = z, stackpos = 253}
                            getMonsters = getThingfromPos(areapos)
                            if isMonster(getMonsters.uid) then
                                doRemoveCreature(getMonsters.uid)
                            end
                        end
                    end
                end
            end
            return false
        end
    end
    return true
end

Editado Janeiro 23 por amoeba13

xCookieX
25 de janeiro de 2014 às 12:55

vou testar aqui qlq coisa eu digo se funcionou certinho :)


funfo certinho obrigado :) a na msg queria aparece assim doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento zombie em terceiro lugar! e ganhou 1 troféu de bronze + ? event coins.", MESSAGE_STATUS_CONSOLE_BLUE)

 

ali no ? queria mostrasse quantidade de event coins que ganhase entende? se puder me ajuda vc ajuda!

KilluaK
25 de janeiro de 2014 às 13:15

Assim :)

 

 

 


local config = {
	playerCount = 2001, -- Global storage for counting the players left/entered in the event
	
	goblet = 5805, -- id of the gold goblet you'll get when finishing the event.
	rewards = {2159}, -- You will get this +  a gold goblet with your name on.
	--		{moneyId, count, using? 1 for using moneyReward, 0 for not using.}
	moneyReward = {2159, 15, 1},
	
	-- Should be same as in the globalevent!
	-- The zombies will spawn randomly inside this area
	fromPosition = {x = 1137, y = 1020, z = 7}, -- top left cornor of the playground
	toPosition = {x = 1168, y = 1038, z = 7}, -- bottom right cornor of the playground
	}

local trofeu3lugar = 123
local trofeu2lugar = 123

function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isMonster(attacker) then
        if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
            if getGlobalStorageValue(config.playerCount) >= 4 then
                doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") foi morto pelos zumbis!", MESSAGE_STATUS_CONSOLE_BLUE)
                local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                doItemSetAttribute(corpse, "description", "Voce reconhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1)
            elseif getGlobalStorageValue(config.playerCount) == 3 then
                local ab = math.random(1, 6)
                doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento zombie em terceiro lugar e ganhous " .. ab .. " event coins!", MESSAGE_STATUS_CONSOLE_BLUE)
                local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                doItemSetAttribute(corpse, "description", "Voce reconhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1)
                doPlayerAddItem(cid, 2159, ab)
                local trof = doPlayerAddItem(cid, trofeu3lugar, 1)
                doItemSetAttribute(trof, "description", "Ganhador: (" .. getPlayerName(cid) .. ") por vencer em 3º lugar no evento 'Zumbi'.")
            elseif getGlobalStorageValue(config.playerCount) == 2 then
                local ab = math.random(6, 10)
                doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento zombie em segundo lugar e ganhou " .. ab .. " event coins!", MESSAGE_STATUS_CONSOLE_BLUE)
                local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                doItemSetAttribute(corpse, "description", "Voce reconhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1)
                doPlayerAddItem(cid, 2159, ab)
                local trofe = doPlayerAddItem(cid, trofeu2lugar, 1)
                doItemSetAttribute(trofe, "description", "Ganhador: (" .. getPlayerName(cid) .. ") por vencer em 2º lugar no evento 'Zumbi'.")
            elseif getGlobalStorageValue(config.playerCount) == 1 then
                local ab = math.random(10, 15)
                if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
                    doBroadcastMessage("O jogador (".. getPlayerName(cid) .. ") venceu o evento 'Zumbi' em 1º lugar, Parabéns! e recebeu 1 troféu de ouro e " .. ab .. " event coins.", 22)
                    local goblet = doPlayerAddItem(cid, config.goblet, 1)
                    doItemSetAttribute(goblet, "description", "Ganhador: (" .. getPlayerName(cid) .. ") por vencer em 1º lugar no evento 'Zumbi'.")
                    local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
                    doItemSetAttribute(corpse, "description", "Voce conhece " .. getCreatureName(cid) .. ". Ele foi morto por "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                    doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
                    doPlayerAddItem(cid, 2159, ab)
                    setGlobalStorageValue(config.playerCount, 0)
                    for _,items in ipairs(config.rewards) do
                        doPlayerAddItem(cid, items, 1)
                    end
                    if config.moneyReward[3] == 1 then
                        doPlayerAddItem(cid, config.moneyReward[1], config.moneyReward[2])
                    end
                end
						
                for x = config.fromPosition.x, config.toPosition.x do
                    for y = config.fromPosition.y, config.toPosition.y do
                        for z = config.fromPosition.z, config.toPosition.z do
                            areapos = {x = x, y = y, z = z, stackpos = 253}
                            getMonsters = getThingfromPos(areapos)
                            if isMonster(getMonsters.uid) then
                                doRemoveCreature(getMonsters.uid)
                            end
                        end
                    end
                end
            end
            return false
        end
    end
    return true
end

 

 

Editado Janeiro 25 por Killua

xCookieX
25 de janeiro de 2014 às 13:38

vou testar aqui ja falo !


funfo certinho quero saber tipo quando entra uma pessoa no evento aparece essa mensagem : 13:35 O jogador (Kinazu) entrou no evento 'Zumbi'! Atualmente 1 jogadores entraram! queria aparece uma mensagem assim em baixo dela : restando (TAls) jogadores para entrar! entende tipo uma contagem so isso meu zumbi fica 100%% vou te agradeçer muito se me ajuda mano ^^

KilluaK
25 de janeiro de 2014 às 14:19

Beleza manda pra mim o script que ta em data/movements/scripts

xCookieX
25 de janeiro de 2014 às 16:17

 

local config = {

playerCount = 2001, -- Global storage for counting the players in the event
maxPlayers = 3, -- Max players who can participate
}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if getGlobalStorageValue(config.playerCount) < config.maxPlayers then
setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1)
if getGlobalStorageValue(config.playerCount) == config.maxPlayers then
doBroadcastMessage("O evento 'Zumbi' foi lotado! E começerá em alguns instantes.", MESSAGE_STATUS_CONSOLE_BLUE)
else
doBroadcastMessage("O jogador (" .. getPlayerName(cid) .. ") entrou no evento 'Zumbi'! Atualmente " .. getGlobalStorageValue(config.playerCount) .. " jogadores entraram!", MESSAGE_STATUS_CONSOLE_BLUE)
end
else
addEvent(tpBack, 1000, cid, fromPosition)
doPlayerSendCancel(cid, "")
doBroadcastMessage("[EVENTO ZUMBI MENSAGEM] está cheio. Já existe " .. config.maxPlayers .. " jogadores participando.", MESSAGE_STATUS_CONSOLE_ORANGE)
return false
end
print(getStorage(config.playerCount) .. " Players in the zombie event.")
return true
end
function tpBack(cid, fromPosition)
doTeleportThing(cid, fromPosition, true)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
end

 

tenta arruma ai pra mim pf msm , agradeço !!

zipter98Z
25 de janeiro de 2014 às 16:30

 

local config = {
    playerCount = 2001, -- Global storage for counting the players in the event
    maxPlayers = 3, -- Max players who can participate 
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if getGlobalStorageValue(config.playerCount) < config.maxPlayers then
        setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1)
        if getGlobalStorageValue(config.playerCount) == config.maxPlayers then
            doBroadcastMessage("O evento 'Zumbi' foi lotado! E começerá em alguns instantes.", MESSAGE_STATUS_CONSOLE_BLUE)
        else
            doBroadcastMessage("O jogador (" .. getPlayerName(cid) .. ") entrou no evento 'Zumbi'! Atualmente " .. getGlobalStorageValue(config.playerCount) .. " jogadores entraram!", MESSAGE_STATUS_CONSOLE_BLUE)
            doBroadcastMessage("Jogadores restantes para o evento começar: "..config.maxPlayers - getGlobalStorageValue(config.playerCount)..".", MESSAGE_STATUS_CONSOLE_BLUE)
        end
    else
        addEvent(tpBack, 1000, cid, fromPosition)
        doPlayerSendCancel(cid, "")
        doBroadcastMessage("[EVENTO ZUMBI MENSAGEM] está cheio. Já existe " .. config.maxPlayers .. " jogadores participando.", MESSAGE_STATUS_CONSOLE_ORANGE)
        return false
    end
    print(getStorage(config.playerCount) .. " Players in the zombie event.")
    return true
end
 
function tpBack(cid, fromPosition)
    doTeleportThing(cid, fromPosition, true)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
end

Editado Janeiro 25 por zipter98

xCookieX
25 de janeiro de 2014 às 17:09

Vlw tópico sanada Resolvido !!!!!!!!!! Obrigado mdr.gif

zipter98Z
25 de janeiro de 2014 às 17:24

Tópico movido para a seção de dúvidas e pedidos resolvidos.