If the player doesn't own a spell, they can't cast it.
spells.xml
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.