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 #367678 is a reply to message #366918] Sat, 17 January 2009 20:37 Go to previous messageGo to previous message
Genesis2001
Messages: 1397
Registered: August 2006
Karma:
General (1 Star)
RoShamBo wrote on Sun, 11 January 2009 08:30

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;	
}




Nice Very Happy
 
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:59:25 MST 2024

Total time taken to generate the page: 0.01036 seconds