So the easy way is to mute the player.. But then the player experience is lowered, since they literally cannot talk at all, in pm's / to npc's / et ceteralooking more to make unable to cast just for the period of event is running OR for like 10 seconds. (maybe may be done with adding exhaust for all spells?)
and by event I mean the repeatable action, not like zombie event![]()
data/lib/050-function.lua
add this function-- if this returns true, then the player is exhausted
function spellExhausted(cid)
if not isPlayer(cid) then
return false
end
if getCreatureStorage(cid, 45001) == 1 then
return true...
spells.xml
needlearn="1"
doPlayerLearnInstantSpell(cid, name)
doPlayerUnlearnInstantSpell(cid, name)
PlayerFlag_CannotUseSpells
looking more to make unable to cast just for the period of event is running OR for like 10 seconds. (maybe may be done with adding exhaust for all spells?)If the player doesn't own a spell, they can't cast it.
spells.xml
LUA:needlearn="1"
LUA:doPlayerLearnInstantSpell(cid, name) doPlayerUnlearnInstantSpell(cid, name)
Or, if it's for a gm/cm/god you could edit the player flags
PlayerFlag_CannotUseSpells
You'd have to go into const.h in order to find the value of that flag in your server though.
I guess it will mute completely the person.local muted = createConditionObject(CONDITION_MUTED)
setConditionParam(muted, CONDITION_PARAM_TICKS, 3000)
function....
return doAddCondition(target, muted)
end
if you dont want to edit sources or edit every spell's lua this is the only wayI guess it will mute completely the person.
Looking to just make unable to cast spells. ^^
well. that really sucks :/if you dont want to edit sources or edit every spell's lua this is the only way
So the easy way is to mute the player.. But then the player experience is lowered, since they literally cannot talk at all, in pm's / to npc's / et ceteralooking more to make unable to cast just for the period of event is running OR for like 10 seconds. (maybe may be done with adding exhaust for all spells?)
and by event I mean the repeatable action, not like zombie event![]()
data/lib/050-function.lua
add this function-- if this returns true, then the player is exhausted
function spellExhausted(cid)
if not isPlayer(cid) then
return false
end
if getCreatureStorage(cid, 45001) == 1 then
return true
end
return false
end
function onCastSpell(cid, var)
put thisif spellExhausted(cid) then
-- can add some text here if you want, telling the player they are spell exhausted.
return false
end
whew, that looks promising. Will give it a go, thanks! =DSo the easy way is to mute the player.. But then the player experience is lowered, since they literally cannot talk at all, in pm's / to npc's / et cetera
I'd recommend instead to create a function inside all of your spells to disable them.
so indata/lib/050-function.lua
add this function
and then under theLUA:-- if this returns true, then the player is exhausted function spellExhausted(cid) if not isPlayer(cid) then return false end if getCreatureStorage(cid, 45001) == 1 then return true end return false end
function onCastSpell(cid, var)
put this
LUA:if spellExhausted(cid) then -- can add some text here if you want, telling the player they are spell exhausted. return false end
yeah and as one person saying it's impossible, he's making the way to overcome it and make it possible.I like Xikini
He still supports older tfs version users while other users telling us to use 1.2 or 1.3
thanks for your help xikini
I knew it's going to work.So the easy way is to mute the player.. But then the player experience is lowered, since they literally cannot talk at all, in pm's / to npc's / et cetera
I'd recommend instead to create a function inside all of your spells to disable them.
so indata/lib/050-function.lua
add this function
and then under theLUA:-- if this returns true, then the player is exhausted function spellExhausted(cid) if not isPlayer(cid) then return false end if getCreatureStorage(cid, 45001) == 1 then return true end return false end
function onCastSpell(cid, var)
put this
LUA:if spellExhausted(cid) then -- can add some text here if you want, telling the player they are spell exhausted. return false end