function onCombat(cid, target)
if isPlayer(cid) and isPlayer(target) then
if getPlayerLevel(cid) >= 20 and getPlayerLevel(target) < 16 then
doPlayerSendCancel(cidm 'You can not attack players below level 16')
return false
end
end
return true
end
registerCreatureEvent(cid, "prot")
<event type="combat" name="prot" event="script" value="prot.lua"/>
[18/11/2010 18:44:00] [Error - CreatureScript Interface]
[18/11/2010 18:44:00] data/creaturescripts/scripts/prot.luanCombat
[18/11/2010 18:44:00] Description:
[18/11/2010 18:44:00] data/creaturescripts/scripts/prot.lua:4: attempt to call global 'cidm' (a nil value)
[18/11/2010 18:44:00] stack traceback:
[18/11/2010 18:44:00] data/creaturescripts/scripts/prot.lua:4: in function <data/creaturescripts/scripts/prot.lua:1>
I put a m instead of commaIt works but i have a problem that is annoying me much
+ 1 more problem
People under level 13 can attack the 20s but they cant attack back lol ;s
function onCombat(cid, target)
if isPlayer(cid) and isPlayer(target) then
if getPlayerLevel(cid) >= 20 and getPlayerLevel(target) < 16 then
doPlayerSendCancel(cid, 'You can not attack players below level 16')
return false
elseif getPlayerLevel(cid) < 16 and getPlayerLevel(target) >= 20 then
doPlayerSendCancel(cid, 'You can not attack players above level 20')
return false
end
end
return true
end