• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Spells checking queststatus

christiandb

Member
Joined
Feb 5, 2008
Messages
2,469
Reaction score
5
Location
010
Hey I need a spell that checks a queststatus before it works because some people bought VIP which simply adds a queststatus so they can open a special VIP door. Now I want to make a spell for them but I dont know how. I came till this but it doesnt work.

if queststatus = getPlayerStorageValue(cid,11551,1) then
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 45000)
setConditionFormula(condition, 0.95, -74, 0.95, -74)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
doCombat(cid, combat, var)
end

PS: I'm very very very noob at scripting so don't blaim me.
 
change
function onCastSpell(cid, var)
doCombat(cid, combat, var)
end

to

function onCastSpell(cid, var)
if getPlayerStorageValue(cid, ****) == 1 then
doCombat(cid, combat, var)
else
doPlayerSendTextMessage(cid, 22, "You need to buy VIP before useing this spell!")
end
Change **** for your queststatus
 
Try adding
Code:
return FALSE
after
Code:
doPlayerSendTextMessage(cid, 22, "You need to buy VIP before using this spell!")
 
That didn't work out. Thanks for the effort tho.

got this right now:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 70000)
setConditionFormula(condition, 1.1, -100, 1.1, -100)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 11551) == 1 then
doCombat(cid, combat, var)
else
doPlayerSendTextMessage(cid, 22, "You need to buy VIP before useing this spell!")
return FALSE
end
end


edit: rep added to both
 
change
Code:
doCombat(cid, combat, var)
to
Code:
 return doCombat(cid, combat, var)

Maybe this one will work
 
Back
Top