I need your help !
I search a Script for my Server
It made a zone where nobody can make damage, kill other people. "A peace area"
Please, help !
Thanks you !
iDios
area = { x1 = 0, y1 = 0, x2 = 100, y2 = 100 } addhook([[hit]], [[area.hit]]) function area.hit(id, src, wpn) if player(id, "tilex") >= area.x1 and player(id, "tiley") >= area.y1 and player(id, "tilex") <= area.x2 and player(id, "tiley") <= area.y2 then return 1 end end
function sa(id,x1,y1,x2,y2) return (player(id,'tilex')>x1 or player(id,'tilex')==x1) and (player(id,'tilex')<x2 or player(id,'tilex')==x2) and (player(id,'tiley')>y1 or player(id,'tiley')==y1) and (player(id,'tiley')<y2 or player(id,'tiley')==y2) end --DONT TOUCH THIS peacearea={} --NOW U CAN TOOUCH peacearea[1]={x1=12,y1=32,x2=58,y2=64} addhook('hit','nohit') function nohit(id,source) for a=1,#peacearea do if sa(id,peacearea[a].x1,peacearea[a].y1,peacearea[a].x2,peaceare[a].y2) then msg2(source,'You cant attack on peaceful area!') return 1 end end end
function sa(id,x1,y1,x2,y2) return (player(id,'tilex')>x1 or player(id,'tilex')==x1) and (player(id,'tilex')<x2 or player(id,'tilex')==x2) and (player(id,'tiley')>y1 or player(id,'tiley')==y1) and (player(id,'tiley')<y2 or player(id,'tiley')==y2) end --DONT TOUCH THIS peacearea={} --NOW U CAN TOOUCH peacearea[1]={x1=12,y1=32,x2=58,y2=64} addhook('hit','nohit') function nohit(id,source) for a=1,#peacearea do if sa(id,peacearea[a].x1,peacearea[a].y1,peacearea[a].x2,peacearea[a].y2) then msg2(source,'You cant attack on peaceful area!') return 1 end end end