Thread: Group Tasks
View Single Post
  #10  
Old 04-18-2014, 02:58 AM
Kayen
Developer
 
Join Date: Mar 2009
Location: -
Posts: 228
Default

I was missing an if statement in the code I initially posted.
Code:
//Define the variable '$Group_ID'  by getting the client's (ie person getting the primary task update) actual group ID. THIS is your groups ID.
$Group_ID = $client->GetGroup()->GetID();

//This pulls all clients in the zone and puts it into an array.		
my @clientlist = $entity_list->GetClientList();

//Now go through the array and ONLY select other clients IN your group.	
foreach $cur (@clientlist) 
{
       //Make sure client exists
	if ($cur) 
	{
              //Make sure you got a group ID
               if ($Group_ID)
			{ 
                               //Check if this client is in a group
				if ($cur->GetGroup())
				{
                                        
					$Client_GroupID = $cur->GetGroup()->GetID();
 //Now if the primary group ID (as first defined) is the same as THIS clients group id, you are in the same group. Now do whatever.
                                       if (Client_GroupID == $Group_ID)
                                       {
                                        Shout("We are in the same group");
                                        cur->UpdateTaskActivity(275,7,1); // example
					}
				}
}}}}
The reason your signal code won't work is because your signaling an NPC it looks like and having it do the task update on that it. You need to have the task updates on the client, so it needs to be in player.pl IF your not directly interacting with the npc like hailing it ect. In other words the NPC has to know who it is updating some how and just a signal does not provide that alone.
Reply With Quote