What's new

-Skrypt Skrypt na uzywanie itemu raz na pare godzin

Status
Not open for further replies.

reeeq

Active User
Joined
Mar 3, 2012
Messages
141
Reaction score
10
Witam, poszukuje skryptu ma on polega? na tym, ?e po kliknieciu na dany item o uniqueid teleportuje nas na dane miejsce, ALE dany player moze go uzywac RAZ NA GODZINE !. Czy posiadacie taki skrypt ?
Najlepiej jakby to bylo pod 7.6, ale moga byc wyzsze wersje to sproboje to przerobic pod 7.6
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Skrypt na uzywanie itemu raz na pare godzin

To proste. Tworzysz tablic?, potem indeksujesz j? uid playera i dodajesz exhaust w ten spos?b:
os.time() + exhausted
Na przyk?ad:
PHP:
local exhaustedSpell = {}
local exhausted = 10 --in seconds

function onCastSpell(cid, var)
	exhaustedSpell[cid] = exhaustedSpell[cid] or os.time()
	if exhaustedSpell[cid] > os.time() then
		return doPlayerSendCancel(cid, 'Wait: '.. (exhaustedSpell[cid] - os.time()) .. ' seconds.') and false
	end
	exhaustedSpell[cid] = os.time() + exhausted
	--code
end
 

Sooh

Advanced User
Joined
Jun 26, 2014
Messages
489
Reaction score
26
Age
30
Odp: Skrypt na uzywanie itemu raz na pare godzin

[lua]
function secondsToClock(sSeconds)
local nSeconds = tonumber(sSeconds)
if nSeconds == 0 then
return "00:00:00"
else
local nHours = string.format("%02.f", math.floor(nSeconds / 3600))
local nMins = string.format("%02.f", math.floor(nSeconds / 60 - (nHours * 60)))
local nSecs = string.format("%02.f", math.floor(nSeconds - nHours * 3600 - nMins * 60))
return nHours..":"..nMins..":"..nSecs
end
end

function onUse(cid,item,fromPosition,itemEx,toPosition)

local level = (8)
local position = getPlayerMasterPos(cid)

local storage = (10000)
local time = (60 * 60 * 24)

if getCreatureStorage(cid, storage) >= os.time() then
doPlayerSendCancel(cid, "You will be able to use teleporteru for " .. secondsToClock(math.abs(os.difftime(getCreatureStorage(cid, storage), os.time()))) .. ".")
return true
end

if getCreatureCondition(cid,CONDITION_INFIGHT) == TRUE then
doPlayerSendCancel(cid,'You can not teleport in combat!')
return true
end

if (getPlayerLevel(cid) <= level) then
doPlayerSendCancel(cid, "Sorry, you need to " .. level .. " level or higher.")
return true
end

if (isPlayerPzLocked(cid) == true) then
doPlayerSendCancel(cid, "You can not teleport because attacked the player!")
return true
end

doCreatureSay(cid, ".:: You teleported to the Temple ::.", TALKTYPE_ORANGE_1)
doTeleportThing(cid, position)
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doSendMagicEffect(position, CONST_ME_TELEPORT)

doCreatureSetStorage(cid, storage, os.time() + time)
doPlayerSave(cid)

return true
end
[/lua]
 

misztrz440

Banned
Joined
Dec 15, 2012
Messages
1,032
Reaction score
39
Odp: Skrypt na uzywanie itemu raz na pare godzin

Oskara fajnie wygl?da tylko nie przemy?la?e? ziom, ?e jak relognie to exhausted znika ;/
Czyli kole? u?yje, tepnie go i ma exhausted na 1h, ale w ci?gu tej godziny jak relognie to b?dzie m?g? u?y? go nawet jak bior?c pod uwag? fakt, ?e ta 1h nie min??a jeszcze.
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Skrypt na uzywanie itemu raz na pare godzin

Ee... Nie. Co ma relog do tablicy zadeklarowanej w kodzie?
 

misztrz440

Banned
Joined
Dec 15, 2012
Messages
1,032
Reaction score
39
Odp: Skrypt na uzywanie itemu raz na pare godzin

Jakbym nie testowa? to bym nie pierdoli?. Wzi??em skrypt do action doda?em, ?eby teleportowa? na dane pozycje no i tepa daje exhausted. Pisze, ?e trzeba poczeka? tyle i tyle.
P??niej relog?em i teleportowa?o. Ustawi?em na 20 sekund tak?e 18 sec bylo reloglem to chyba nie minelo by tak szybko i nie by?o exhausted.

Sam sobie zobacz u Siebie, jak nie wierzysz.
 

Sooh

Advanced User
Joined
Jun 26, 2014
Messages
489
Reaction score
26
Age
30
Odp: Skrypt na uzywanie itemu raz na pare godzin

Zawsze mo?esz sobie sam skrypt zrobi? korzystaj?c z przyk?ad?w kt?re dodali?my.

Wys?ane z mojego GT-I8200 przy u?yciu Tapatalka
 

misztrz440

Banned
Joined
Dec 15, 2012
Messages
1,032
Reaction score
39
Odp: Skrypt na uzywanie itemu raz na pare godzin

@up Mi nie chodzi o to tylko, ?e to nie spe?nia wymog?w.
 

Sooh

Advanced User
Joined
Jun 26, 2014
Messages
489
Reaction score
26
Age
30
Odp: Skrypt na uzywanie itemu raz na pare godzin

Dosta?e? skrypt za darmo (pomoc bezinteresown?), jeszcze masz do tego wymagania?
No prosz? cie, poszukaj skryptera lub zap?a? komu?.
Zreszt? doda?em ci skrypt z warunkami na action "battle pz", "pvp pz", "level", "czas exhausted storage", kt?ry u mnie kiedy? na serwerze ?adnie dzia?a?. Wi?c temat raczej do zamkni?cia.
 
Status
Not open for further replies.
Top