PDA

View Full Version : zombie detector



malyczolg
24th October 2013, 15:15
hello , i make zombie detector
why if I am further than the distance detector see me ?



detector()
{
self.detector = spawn("script_model",self.origin);
self.detector.angles = (self.angles);
self.detector setmodel("xmodel/prop_hydrant");

time = 45;
for(;;)
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
distance = distance(self.detector.origin, players[i].origin);
if(distance < 100 && players[i].sessionstate == "playing" && isAlive(players[i]) && players[i].pers["team"] == "axis" && players[i].detector == 0)
{
players[i].detector = 1;
iprintlnbold("detect : "+players[i].name);
//players[i] thread detector2();
}
else
{
players[i].detector = 0;
}
}
if(time<=0)
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
players[i].detector = 0;
}
self.detector delete();
break;
}

time -= 1;
wait 1;
}
}

default
24th October 2013, 16:04
What is zombie detector :D

malyczolg
24th October 2013, 16:15
if detector see you , hunters see appears over your head icon

default
24th October 2013, 16:17
but this bad :D

IzNoGoD
24th October 2013, 19:00
I assume you walk away from the original location of the detector spawn.

This means your detector.origin will remain where it was spawned, and the distance between THAT point and the zom will be less than 100.

malyczolg
24th October 2013, 21:27
work . delete players[i].detector