Skrypty & Kody attempt to call global "checkReq"

Status
Zamknięty.

Myaka

Advanced User
Zarejestrowany
Dołączył
Czerwiec 20, 2011
Posty
330
Liczba reakcji
0
PHP:
function onSay(cid, words, param, channel)
	local effect = 10
	local etime = 25200
	local estorage = 1429
	local reqLv=27
	local tps = {{x=96, y=96, z=9},{x=96, y=94, z=9} ,{x=84, y=98, z=9} }
	local needPremium = false -- true - potrzebny pacc, false - niepotrzebny
	local needStorage = 1429 --Mozna ustawic potrzebne storage
	
	local response = {
	"Your level is too low.",
	"You can't do this.",
	"You need premium.",
	"You must wait 7 hours."
	}
	
	if checkReq(cid)==0 then
		doTeleportThing(cid, tps[math.random(1, #tps)])
		doSendMagicEffect(getPlayerPosition(cid), efekt)
		exhaustion.make(cid, estorage,etime)
		return true
	else
		doPlayerSendTextMessage(cid, 22, response[checkReq(cid)])
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return false
	end
	
	
end
	
local function checkReq(cid)
	if getPlayerLevel(cid) <reqLv then
		return 1
	elseif needStorage>0 and getPlayerStorage(cid, needStorage) <= 0 then
		return 2
	elseif needPremium and isPremium(cid) then
		return 3
	elseif exhaustion.get(cid, estorage) > 0 then
		return 4
	end
	
	return 0
end

taki mi wychodzi b??d po wpisani tego (w konfigu)

attempt to call global "checkReq"
a nil value
17 linijka

chcia?em w tamtym pytaniu dopisa? ale skoro mod zamkn?, to tematy sie namno?? =,=
 
Odp: attempt to call global "checkReq"

odswiezam

co to za blond ?
 
Odp: attempt to call global "checkReq"

nie wiem co to za blond ale wiem co to za b??d [blad]

Kod:
local config = {
	effect = 10
	time = 25200
	storage = 1429
	reqLv=27
	tps = {{x=96, y=96, z=9},{x=96, y=94, z=9} ,{x=84, y=98, z=9} }
	needPremium = false
	needStorage = 1429
	}
	
local response = {
	"Your level is too low.",
	"You can't do this.",
	"You need premium.",
	"You must wait 7 hours."
	}

function checkReq(cid)
	if getPlayerLevel(cid) <config.reqLv then
		return 1
	elseif config.needStorage>0 and getPlayerStorage(cid, config.needStorage) <= 0 then
		return 2
	elseif config.needPremium and isPremium(cid) then
		return 3
	elseif exhaustion.get(cid, config.storage) > 0 then
		return 4
	end
 
	return 0
end
function onSay(cid, words, param, channel)
	if checkReq(cid)==0 then
		doTeleportThing(cid, config.tps[math.random(1, #config.tps)])
		doSendMagicEffect(getPlayerPosition(cid), config.effect)
		exhaustion.make(cid, config.storage,config.time)
		return true
	else
		doPlayerSendTextMessage(cid, 22, response[checkReq(cid)])
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return false
	end
end
 
Ostatnia edycja:
Odp: attempt to call global "checkReq"

PHP:
effect = 10
etime = 25200
estorage = 1429
reqLv=27
tps = {{x=96, y=96, z=9},{x=96, y=94, z=9} ,{x=84, y=98, z=9} }
needPremium = false -- true - potrzebny pacc, false - niepotrzebny
needStorage = 1429 --Mozna ustawic potrzebne storage
	
response = {
	"Your level is too low.",
	"You can't do this.",
	"You need premium.",
	"You must wait 7 hours."
	}
function checkReq(cid)
	if getPlayerLevel(cid) <reqLv then
		return 1
	elseif needStorage>0 and getPlayerStorage(cid, needStorage) <= 0 then
		return 2
	elseif needPremium and isPremium(cid) then
		return 3
	elseif exhaustion.get(cid, estorage) > 0 then
		return 4
	end
	
	return 0
end
function onSay(cid, words, param, channel)
	if checkReq(cid)==0 then
		doTeleportThing(cid, tps[math.random(1, #tps)])
		doSendMagicEffect(getPlayerPosition(cid), efekt)
		exhaustion.make(cid, estorage,etime)
		return true
	else
		doPlayerSendTextMessage(cid, 22, response[checkReq(cid)])
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return false
	end
end
Tak o.
 
Status
Zamknięty.
Back
Do góry