Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Is it possible to send player tag updates to select players
Is it possible to send player tag updates to select players [message #474093] Sat, 08 September 2012 06:43 Go to previous message
BillieJoe67 is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SP Character Voices to Online
Next Topic: Feel like making something
Goto Forum:
  


Current Time: Thu Dec 12 00:44:59 MST 2024

Total time taken to generate the page: 0.00860 seconds