Is it possible to send player tag updates to select players [message #474093] |
Sat, 08 September 2012 06:43 |
BillieJoe67
Messages: 35 Registered: March 2012
Karma:
|
Recruit |
|
|
What I'm trying to do is create an improved spectate mode, and I had this idea where players who are scoped have the tag Scoping or whatever. Obviously, the tag should only be sent to players that are in spectate mode, but would it be possible to do a select update? Send_Object_Update doesn't work.
This is the basic code I have so far, but it sends the tag to all players
DynamicVectorClass<int> SpectatingPlayers;
void ExamplePlugin::OnThink()
{
for(SLNode<cPlayer>* PlayerIter = Get_Player_List()->Head(); (PlayerIter != NULL); PlayerIter = PlayerIter->Next())
{
cPlayer* cP = PlayerIter->Data();
if(cP && cP->IsActive)
{
GameObject* PlayerObj = Get_GameObj(cP->PlayerId);
if(PlayerObj)
{
if(PlayerObj->As_SoldierGameObj()->Is_Sniping() == true)
{
cP->customTag.Format(L"Sniping");
cP->Set_Object_Dirty_Bit(NetworkObjectClass::BIT_CREATION, true); //remove this line
for(int i = 0; i < SpectatingPlayers.Length(); i++)
{
//Do the update here
}
}
else
{
cP->customTag.Format(L"");
cP->Set_Object_Dirty_Bit(NetworkObjectClass::BIT_CREATION, true); //remove this line
for(int i = 0; i < SpectatingPlayers.Length(); i++)
{
//Do the update here
}
}
}
}
}
}
[Updated on: Sat, 08 September 2012 06:50] Report message to a moderator
|
|
|