PDA

View Full Version : List players by name and loc in a zone


Capheus
06-14-2009, 11:37 AM
Always was frustrated by trying to find and get to players in a zone. Tracking only works so good so I took some scriptwork that Kayen did for AE Rampage and Trevius' Thanksgiving event. I assigned this to my bot and it outputs all players in the zone with their locations.

#list Players by name and location in the zone

sub EVENT_SAY {

if($text=~/client/i) {
quest::settimer("pc",2);
quest::say("Working on it.....");
}
}

sub EVENT_TIMER {

if ($timer eq "pc") {

my $list_check = 0;

for ($list_check = 0; $list_check < 2000; $list_check++) {

$client_search = $entity_list->GetClientByID($list_check);

if ($client_search) {
my $cx = int($client_search->GetX());
my $cy = int($client_search->GetY());
my $cz = int($client_search->GetZ());
$person = $client_search->GetCleanName();
quest::say("$person is at___$cx,___$cy,___$cz");
}
}
}
quest::stoptimer("pc");
}