• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Tutorial Zmiana talkaction na globalevent !

Verdis

Ciekawy świata.
Joined
May 28, 2012
Messages
394
Reaction score
9
Location
Poland
Witam,
proszę o przerobienie tego scryptu (z talkactions na globalevents)
PHP:
function onSay(cid, words, param, channel) 
    if(getStorage(ZE_STATUS) ~= 2) then 
        local players_on_arena_count = #getZombiesEventPlayers() 
        if(param == 'force') then 
            if(players_on_arena_count > 0) then 
                setZombiesEventPlayersLimit(players_on_arena_count  ) 
                addZombiesEventBlockEnterPosition() 
                doSetStorage(ZE_STATUS, 2) 
                doBroadcastMessage("Zombie Arena Event started.") 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event started.") 
            else 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot start Zombies event. There is no players on arena.") 
            end 
        else 
            if(param ~= '' and tonumber(param) > 0) then 
                setZombiesEventPlayersLimit(tonumber(param)) 
            end 
            removeZombiesEventBlockEnterPosition() 
            doSetStorage(ZE_STATUS, 1) 
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Event started.") 
            doPlayerBroadcastMessage(cid, "Zombie Arena Event teleport is opened. We are waiting for " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " players to start.") 
        end 
    else 
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event is already running.") 
    end 
    return true 
end
Dzięki :)
 
Moze najpierw idz do tematu tego skryptu i tam popros?

@Offtopic
Ja juz tylko czekam az dzieciaki beda wbijac i prosic o gotowego serva z online 100+.
 
Stworzyć globalevent, który wywołuje tą funkcje
LUA:
doCreatureExecuteTalkAction(cid, "!twoja-komenda", true)
 
Creature not found ;/

a to dziwne no nie? globalevent z cid'em heh, ciekawe jak to miało działać? o ile wiem nie ma czegoś takiego jak cid w globalevencie...

zrób zamiast
Stworzyć globalevent, który wywołuje tą funkcje
LUA:
doCreatureExecuteTalkAction(cid, "!twoja-komenda", true)

np.
ziomek = getCreatureByName("Twoja Stara") --<-- to moze byc monster/npc/gracz (ustaw acces np. na 0 czy coś, bo monster ani npc chyba nie ma opcji wpisania acces'a. A i do skryptu z talkactionem daj, żeby if isPlayer(cid) then return false end
doCreatureExecuteTalkAction(ziomek, "!twoja-komenda", true)

- - - Updated - - -

a właśnie, snake kiedy ta komenda została wprowadzona?

- - - Updated - - -

srry to znaczy funkcja*
 
Tak, ale nie wiem kiedy została dokładnie wprowadzona - w ostatniej rewizji jest. Wartość logiczna (true) odpowiada za pominięcie sprawdzania dostępu (access).
 
Próbuję wszystkiego i to nie wychodzi...
Mój talkaction:
PHP:
function onSay(cid, words, param, channel)  
    if(getStorage(ZE_STATUS) ~= 2) then  
        local players_on_arena_count = #getZombiesEventPlayers()  
        if(param == 'force') then  
            if(players_on_arena_count > 0) then  
                setZombiesEventPlayersLimit(players_on_arena_count  )  
                addZombiesEventBlockEnterPosition()  
                doSetStorage(ZE_STATUS, 2)  
                doBroadcastMessage("Zombie Arena Event started.")  
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event started.")  
            else  
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot start Zombies event. There is no players on arena.")  
            end  
        else  
            if(param ~= '' and tonumber(param) > 0) then  
                setZombiesEventPlayersLimit(tonumber(param))  
            end  
            removeZombiesEventBlockEnterPosition()  
            doSetStorage(ZE_STATUS, 1)  
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Event started.")  
            doPlayerBroadcastMessage(cid, "Zombie Arena Event teleport is opened. We are waiting for " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " players to start.")  
        end  
    else  
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event is already running.")  
    end  
    return true  
end

Wyświetla się Couldn't execute event: zombieevent, lub event on timer not found

- - - Updated - - -

Mam scrypt na globalevent:

PHP:
local autoStartInterval = 60 -- time between arenas in minutes, default 60 = 1 hour
 
function onThink(interval, lastExecution, thinkInterval)
	if(getStorage(ZE_STATUS) ~= 2) then
		if(getStorage(45267)+autoStartInterval*60 <= os.time() and getStorage(45268) ~= 1) then
			doSetStorage(45268, 1)
			removeZombiesEventBlockEnterPosition()
			doSetStorage(ZE_STATUS, 1)
			doBroadcastMessage("Zombie Arena Event teleport will be opened for 2 minutes. We are waiting for " .. getZombiesEventPlayersLimit() - #getZombiesEventPlayers() .. " players to start.")
		elseif(getStorage(45267)+autoStartInterval*60+120 <= os.time() and getStorage(45268) == 1) then
			addZombiesEventBlockEnterPosition()
			doSetStorage(45268, 0)
			doSetStorage(ZE_STATUS, 2)
			doSetStorage(45267, os.time())
			doBroadcastMessage("Zombie Arena Event started.")
		end
	end
	return true
end

Nie podoba mi się to, że teleport zamyka się po okeślonym czasie, powinien się zamknąć gdy wejdzie odpowiednia ilość graczy.. ;/
Proszę przeróbcie to jakoś :)


Link do tematu z tym scryptyem: http://otland.net/f82/zombie-event-new-version-bug-free-updated-128664/
 
Last edited:
to może spytaj w threadzie skąd wziąłeś ten skrypt O.o skąd mamy znać resztę
 
Back
Top