Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [Plug-in] SSGM2.02 Ping Plugin  () 1 Vote
Re: [Plug-in] SSGM2.02 Ping Plugin [message #439345 is a reply to message #439296] Fri, 12 November 2010 13:25 Go to previous messageGo to previous message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma:
General (1 Star)
reborn wrote on Fri, 12 November 2010 04:45

Did you use my code as an example? I think I fixed the bug in get_part_names for that to work, you should post that too. Smile

Good effort! Smile



Ahh yes I forgot about that.

engine_player.cpp
int Get_Part_Names(const char *name1)
{
	GenericSLNode *x = BaseGameObjList->HeadNode;
	int count = 0;
	while (x)
	{
		GameObject *o = As_ScriptableGameObj((GameObject *)x->NodeData);
		if (o && Commands->Is_A_Star(o) && As_SoldierGameObj(o)){
			const char *name = Get_Player_Name(o);
			if (stristr(name,name1))
			{
				count++;
			}
			delete[] name;
		}
		x = x->NodeNext;
	}
	return count;
}

const char *Get_Player_Name(GameObject *obj)
{
	if (!Commands->Get_ID(obj) || !obj)
	{
		return newstr("None");
	}
	GameObject *o = As_SoldierGameObj(obj);
	char *c = (char *)o;
	if (!o)
	{
		return newstr("None");
	}
	c += 0x960;
	cPlayer *x = (cPlayer *)*(unsigned int *)c;
	if (!x)
	{
		return newstr("None");
	}
	return WideCharToChar(x->PlayerName);
}

const char *Get_Player_Name_By_ID(int PlayerID)
{
	cPlayer *x = FindPlayer(PlayerID);
	if (!x)
	{
		return 0;
	}
	return WideCharToChar(x->PlayerName);
}


http://i32.photobucket.com/albums/d42/XpertMaverick/xpertyankee.jpg

Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.

Part time streamer - https://twitch.tv/gg_wonder

[Updated on: Fri, 12 November 2010 13:26]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [skin] Skittles Stealth Effect
Next Topic: [Skins] Duke 3D doors
Goto Forum:
  


Current Time: Fri Feb 14 12:52:48 MST 2025

Total time taken to generate the page: 0.01026 seconds