• 01-04.05.2026 - DOUBLE EXP / SKILL EVENT!

Save +informacja

tollaks

Advanced User
Zarejestrowany
Dołączył
Lipiec 29, 2009
Posty
231
Liczba reakcji
9
Wiek
32
Witam.
Poszukuje skryptu kt?ry robi save co 15min, a 30 sec przed save pisze:za 30secund restart.
Oto m?j save.lua:
local savingEvent = 0
local savingDelay = 0
function onSay(cid, words, param)
if getPlayerAccess(cid) ~= 0 then
if param == "" then
broadcastMessage(cid, "Server save.", 11)
saveData()
elseif isNumber(param) == TRUE then
stopEvent(savingEvent)
savingDelay = 15 * 1000 * 60
save()
end
end
end
function save()
savingEvent = addEvent(save, savingDelay, {})
broadcastMessage(cid, "Server save. Next save too 15 minutes.", 11)
saveData()
end
 
Odp: Save +informacja

PHP:
local savingEvent = 0

function onSay(cid, words, param, channel)
	if(isNumber(param) == TRUE) then
		broadcastMessage(cid, "Za 30sekund save", 11)
		stopEvent(savingEvent)
		save(tonumber(param) * 60 * 1000)
	else
		doSaveServer()
	end
	return TRUE
end

function save(delay)
	doSaveServer()
	if(delay > 0) then
		savingEvent = addEvent(save, delay, delay)
		broadcastMessage(cid, "Server save. Next save too 15 minutes.", 11)
	end
end

My?l?, ?e powinno zadzia?a?.

Pozdrawiam.
 
Odp: Save +informacja

Nie dzia?a b?edy wyskakuja:
[02/08/2009 13:28:39] data/talkactions/scripts/save.lua:9: attempt to call global 'doSaveServer' (a nil value)
[02/08/2009 13:28:39] stack traceback:
[02/08/2009 13:28:39] data/talkactions/scripts/save.lua:9: in function <data/talkactions/scripts/save.lua:3>
 
Odp: Save +informacja

Wejdz w Data\globalevents\globalevents
I doklej ta Linike.
<globalevent name="save" interval="900" event="script" value="save.lua"/>

Poznij wejdz Data\globalevents\scripts
I otworz plik lua. o nazwie save.

function onThink(interval, lastExecution)
doSaveServer()
return TRUE
end

Chyba bedzie dzia?a?
 
Odp: Save +informacja

Ten Silnik Tfs 03.2 nie ma globalevent:(
REFRESH!

refresh!prosze o pomoc!
 
Ostatnia edycja:
Odp: Save +informacja

Ten skrypt powinien chodzi? bynajmniej u mnie wszystko dzia?a. :)

Kod:
function onThink(interval, lastExecution)

    doBroadcastMessage("Save in 30 seconds!", 22)
    addEvent(save, 30000)

return TRUE
end

function save()
    doSaveServer()
    doBroadcastMessage("Server saved,next save in 15 min.", 22)
return TRUE
end
 
Odp: Save +informacja

Nie widzisz co napisa?em mi nie chodzi do globalevents tylko do talkactions!
NIE CHODZI MI OTO!:
function onThink(interval, lastExecution)
doBroadcastMessage("Save in 30 seconds!", 22)
addEvent(save, 30000)
return TRUE
end
function save()
doSaveServer()
doBroadcastMessage("Server saved,next save in 15 min.", 22)
return TRUE
end
 
Ostatnia edycja:
Odp: Save +informacja

Przepraszam! Mam The Forgotten Server 0.2.4
W nim nie ma:(
A wiesz jak zrobi??
 
Back
Do góry