Hello, I want to make script which returns false if there are 5 players in range
I'm trying to do it
Of course it does not work at all, this script needs to be fixed and should count players, does anyone know how can it be done?
Thanks in advance
I'm trying to do it
Code:
function onCastSpell(cid, var)
if(isInRange(getPlayerPosition(cid), {x = toPosition.x-7, y = toPosition.y-5, z = toPosition.z}, {x = toPosition.x+7, y = toPosition.y+5, z = toPosition.z})) then
return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'Sorry, not possible.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
return doCombat(cid, combat, var)
end
Of course it does not work at all, this script needs to be fixed and should count players, does anyone know how can it be done?
Thanks in advance