What's new

Czas co ile mo?na wykona? skrypt

Status
Not open for further replies.

Gitu123

Senior User
Joined
Jun 25, 2009
Messages
700
Reaction score
22
PHP:
local t = {
    storage = 3201,
    monster = {"Rotworm", {x=4028, y=4046, z=7}},
}
function onStepIn(cid, item, position, fromPosition)
if ((getPlayerStorageValue(cid, t.storage) < 1) and isPlayer(cid)) then  
    doSummonCreature(t.monster[1], t.monster[2])
	    end
    return TRUE
end
witam jak mo?na doda? czas co ile xx sekund mo?na ponownie zrespi? potwora staj?c na tej kratce
 

Ghalla

Active User
Joined
Aug 24, 2010
Messages
88
Reaction score
12
Age
31
Odp: Czas co ile mo?na wykona? skrypt

Wystarczy przechowa? czas wej?cia w globalStorage i doda? do niego ilo?? sekund ile nie mo?na wchodzi? :D
Code:
local t = {
    storage = 3201,
    monster = {"Rotworm", {x=4028, y=4046, z=7}},
	globalExhaust = {value = , time = }, --value to id globalstoragevalue, a time to czas blokady summonowania 
}
function onStepIn(cid, item, position, fromPosition)
	if(getGlobalStorageValue(t.globalExhaust.value) > os.time()) then
		if((getPlayerStorageValue(cid, t.storage) < 1) and isPlayer(cid)) then  
			doSummonCreature(t.monster[1], t.monster[2])
			setGlobalStorageValue(t.globalExhaust.value,os.time() + t.globalExhaust.time)
		end
	end
    return TRUE
end
 
Status
Not open for further replies.
Top