Es gibt ja diesen Hook "Drop" womit man prüfen kann ob der Spieler eine Waffe fallen lässt (mit G). Aber mit Granaten geht das nicht. Gibt es da alternativen zu "Drop"?
Danke
Scripts
Drop Hook bei Granaten
Drop Hook bei Granaten
1

drop(id,iid,type,ain,a,mode,x,y)			on drop -id: player id -iid: item id -type: item type -ain: ammo in weapon / item count -a: additional ammo -mode: item mode (silencer/laser color/...) -x: drop x position (tiles) -y: drop y position (tiles) >return:	0 - proceed normally (drop?) 		1 - don't drop 		2 - drop and never fade out the item
addhook("drop","grenadedroplolwaswirdgeschehen?")
function grenadedroplolwaswirdgeschehen?(id,iid)
	if (iid=51) then
		-- Code
	end
end
if (iid=51) then
	msg("Geht")
	return 0
end
addhook("drop","sorrywegendemfragezeichem")
function sorrywegendemfragezeichem(id,iid)
if iid==51 then
return 0;
end
end
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end
drop = initArray(32)
addhook("drop","lol")
function lol(id)
	drop[id]=1
end
Achso...addhook("projectile","projectile_hook")
function projectile_hook(id,w,x,y)
	if w==51 then
		--Code
	end
end
1
