Attempt to call local "y" (a number value)
~edited:
Ok, da fehlte ein komma. Der code sieht jetzt so aus:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
addhook ("second","maap")
function maap()
local id = getplayers();
if id~=nil then
msg (string.format("%s stands in nobuildzone",id));
end
end
function getplayers()
for id=1,32 do
if player(id,"exists") then
for y=0,map("ysize") do
for x=0,map("xsize") do
if entity(x,y,"exists") and entity(x,y,"typename")=="Info_NoBuildings" and player(id,"tilex")==x and player(id,"tiley")==y then
return id;
end
end
end
end
end
end
Das spiel stürzt jetzt aber ab, wenn ich das testen will...

EDIT2:
Hab jetzt einen eigenen script erstellt

1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
addhook ("second","nobuildentity")
function nobuildentity()
for _, id in ipairs(player(0, "table")) do
x=player(id,"tilex")
y=player(id,"tiley")
if inentityzone(x,y,18) then
msg (string.format(" YEAAH" ,id));
noteleport[id]={t=1}
else
msg (string.format(" NO!",id));
noteleport[id]={0}
end
end
leider wird hier nicht die ganze area gescannt, sondern nur das wo das entity ist. Wie kann ich testen ob sich der Spieler auf dem area befindet?
edited 2×, last 08.11.10 08:00:01 pm