Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » get_part_name, chathooks and strings
Re: get_part_name, chathooks and strings [message #366918 is a reply to message #366913] Sun, 11 January 2009 08:30 Go to previous messageGo to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
int FindPlayer(const char *Part) //-2: not unique, -1: not found
{
	int Player = -1;
	for(GenericSLNode *x = PlayerList->HeadNode; x != 0; x = x->NodeNext)
	{
		cPlayer *p = (cPlayer *)x->NodeData;
		if(p && p->IsActive)
		{
			const char *pName = WideCharToChar(p->PlayerName);
			if(stricmp(pName, Part) == 0)
			{
				delete []pName;
				Player = p->PlayerId;
				break;
			}
			if(stristr(pName, Part))
			{
				if(Player >= 0)
				{
					delete []pName;
					return -2;
				}
				else
				{
					Player = p->PlayerId;
				}
			}
			delete []pName;
		}
	}
	return Player;	
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Renegade SSMods Archive
Next Topic: Camera.ini
Goto Forum:
  


Current Time: Sat Dec 21 07:58:23 MST 2024

Total time taken to generate the page: 0.00681 seconds