1
[15:04:58] LUA ERROR (ai_hear_chat): attempt to call a nil value
das ist ein Fehler aus dem botscript.Hast du irgendetwas an den Bots verändert ,oder hast du dein folgendes script darein geschrieben?
Scripts
Sammelthread/FAQ zu Lua & Editor[15:04:58] LUA ERROR (ai_hear_chat): attempt to call a nil value
[ENTITY] - entity(x,y,"value")		Return a value of an entity at the tile position (X|Y): 				exists, typename, type, name, trigger, state, int0, int1, 				int2, int3, int4, int5, int6, int7, int8, int9, str0, str1, 				str2, str3, str4, str5, str6, str7, str8, str9, aistate 				(int0-9 and str0-9 are used for entity settings and are 				different for each entity type) - randomentity(type,[ai],[i0])	Returns the tile x and y position (2 values!) of a random entity 				of a certain type or -100,-100 if no entity has been found. 				ai=only find entities with this AI state (-1 to ignore) 				i0=only find entities with this int0 value (-1 to ignore) - inentityzone(x,y,type)	Checks if the tile position (x|y) is in the area of a certain 				entity type and returns true or false
function(x,y,Info.Nobuildings) if Info.Nobuildings then --CODE end end

elseif sel == 6 then rp_msg2(id,"000255000","[RP] Command: !bring <player>") rp_msg2(id,"000255000","[RP] Command: !goto <player>") rp_msg2(id,"000255000","[RP] Command: !rp_arrest <player>") rp_msg2(id,"000255000","[RP] Command: !rp_free <player>") rp_msg2(id,"000255000","[RP] Command: !rp_give_money <player> <money>") rp_msg2(id,"000255000","[RP] Command: !rp_admin <password>") rp_msg2(id,"000255000","[RP] Command: !parse <command>") rp_msg2(id,"000255000","[RP] Command: !createt <player>") rp_msg2(id,"000255000","[RP] Command: !createct <player>") elseif sel == 7 then menu(id,[[CT Menu Props,]]..udp_scar(id)
function initArray(size,value)
local t = {}
for i=1, size do
t[i] = value
end
return t
end
hasgasmask = initArray(32,0)
gasmaskid = initArray(32,0)
addhook("startround","_startround")
function _startround()
for i=1,32 do --Loop thru all possible ids
if player(i,"exists") and player(i,"team") < 3 and player(i,"team") > 0 then --If the player exists and is T or CT
if hasgasmask[i] == 1 then --And has bought a gasmask, give him the image of it.
local id1=image("gfx/todesengel/gasmask.bmp",1,1,200+i)
imagescale(id1,1,1)
imageblend(id1,0)
imagealpha(id1,1.0)
gasmaskid[i] = id1
end
else --Else, clear the array just in case
hasgasmask[i] = 0
gasmaskid[i] = 0
end
end
end
addhook("spawn","gfx")
function gfx(id)
parse("hudtxt 0 \"©255255255Press F2 to buy or drop a gasmask\" 4 102 0")
end
addhook("die","_die")
function _die(id) --Remove gasmask from this player
if hasgasmask[id]==1 then
		freeimage(gasmaskid[id])
		gasmaskid [id] = 0
		dropmask(id)
	end
end
addhook("serveraction","fmenus")
function fmenus(id,btn)
if (btn==1) then
menu(id,"Equip,Gasmask| 1000$, Drop the Gasmask")
end
end
addhook("hit","gashit")
function gashit(id,source,weapon,hpdmg,apdmg)
if weapon==72 then -- wenn es die waffe mit der id 72 ist // No gas dmg
if hasgasmask[id] == 1 then
return 1
end
end
end
addhook ("menu","meno")
function meno(id,menoo,sel)
if menoo=="Equip" then
if sel==1 then
if(player(id,"money")>=1000) then
if hasgasmask[id] == 0 then
parse("setmoney "..id.." "..(player(id,"money")-1000))
local id1=image("gfx/todesengel/gasmask.bmp",1,1,200+id)
imagescale(id1,1,1)
imageblend(id1,0)
imagealpha(id1,1.0)
hasgasmask[id] = 1
gasmaskid[id] = id1
else
msg2(id,"©255000000You already have a gasmask!@C")
end
else
msg2(id,"©255000000You dont have enough money for a gasmask!@C")
end
elseif sel==2 then
if hasgasmask[id]==1 then
freeimage(gasmaskid[id])
gasmaskid [id] = 0
dropmask(id)
msg2(id,"©255000000You dropped your gasmask!@C")
else
msg2(id,"©255000000You dont have a gasmask!@C")
end
end
end
end
maskpath="gfx/todesengel/gasmask.bmp"
maskitms={}
maskimg={}
addhook("movetile","pickup_itms")
function pickup_itms(id,tx,ty)
for i=1,#maskitms do
if maskitms[i]~=nil and maskitms[i].exists and hasgasmask[id]==0 and maskitms[i].x==tx and maskitms[i].y==ty then
maskitms[i].exists=false
refreshgfx(i,"gasmask",0)
hasgasmask[id]=1
parse("sv_sound2 "..id.." items/pickup.wav")
local id1=image("gfx/todesengel/gasmask.bmp",1,1,200+id)
imagescale(id1,1,1)
imageblend(id1,0)
imagealpha(id1,1.0)
gasmaskid[id] = id1
end
end
end
function refreshgfx(id,type,mode)
	local rndrot
	if type=="gasmask" then
		if mode==1 then
			if maskimg[id]==nil then
				maskimg[id]=image(maskpath,0,0,0)
			end
			rndrot=math.random(0,359)
			imagepos(maskimg[id],maskitms[id].x*32+16,maskitms[id].y*32+16,rndrot)
			imagescale(maskimg[id],0.9,0.9)
		elseif mode==0 then
			if maskimg[id]~=nil then
				freeimage(maskimg[id])
				maskimg[id]=nil
			end
		else
		print("incorrect MODE setting!")
		end
	end
end
function dropmask(id)
	local tilex,tiley
	tilex=player(id,"tilex")
	tiley=player(id,"tiley")
	hasgasmask[id] = 0
	for i=1,#maskitms+1 do
		if maskitms[i]==nil or not maskitms[i].exists then
			maskitms[i]={}
			maskitms[i].exists=1
			maskitms[i].x=tilex
			maskitms[i].y=tiley
			refreshgfx(i,"gasmask",1)
			break
		end
	end
end
[ENTITY] - entity(x,y,"value")		Return a value of an entity at the tile position (X|Y): 				exists, typename, type, name, trigger, state, int0, int1, 				int2, int3, int4, int5, int6, int7, int8, int9, str0, str1, 				str2, str3, str4, str5, str6, str7, str8, str9, aistate 				(int0-9 and str0-9 are used for entity settings and are 				different for each entity type) - randomentity(type,[ai],[i0])	Returns the tile x and y position (2 values!) of a random entity 				of a certain type or -100,-100 if no entity has been found. 				ai=only find entities with this AI state (-1 to ignore) 				i0=only find entities with this int0 value (-1 to ignore) - inentityzone(x,y,type)	Checks if the tile position (x|y) is in the area of a certain 				entity type and returns true or false
function(x,y,Info.Nobuildings) if Info.Nobuildings then --CODE end end
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") and then
for y=0,map("sizey") do
for x=0,map("sizex") do
if entity(x,y,"exists") and entity(x,y"typename")=="Info_Nobuild" and player(id,"tilex")==x and player(id,"tiley")==y then
return id;
end
end
end
end
end