Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » scripts.dll 2.6 and beoynd
Re: scripts.dll 2.6 and beoynd [message #193534 is a reply to message #193175] Tue, 21 March 2006 18:12 Go to previous messageGo to previous message
theplague is currently offline  theplague
Messages: 261
Registered: May 2004
Karma:
Recruit
nice work JW. here are two scripts people might find intresting...

pass a part of a name to this and it'll find the first person with that part of the name
GameObject *Get_Part_Name(const char *name1) {
	GenericSLNode *x = BaseGameObjList->HeadNode;
	int count = 0;
	GameObject *current;
	std::string name = StringToLower(name1);
	while (x != 0) {
		GameObject *o = As_SoldierGameObj((GameObject *)x->NodeData);
		if (o != 0) {
			std::string pname = StringToLower(Get_Player_Name(o));
			if (pname.find(name) != std::string::npos) {
				current = o;
				count++;
			}
		}
		x = x->NodeNext;
	}
	if (count == 1 && current && Commands->Get_ID(current)) return current;
	else return 0;
}


This is just to see how many people have this part in their names
int Get_Part_Names(const char *name1) {
	GenericSLNode *x = BaseGameObjList->HeadNode;
	int count = 0;
	std::string name = StringToLower(name1);
	while (x != 0) {
		GameObject *o = As_SoldierGameObj((GameObject *)x->NodeData);
		if (o != 0) {
			std::string pname = StringToLower(Get_Player_Name(o));
			if (pname.find(name) != std::string::npos) {
				count++;
			}
		}
		x = x->NodeNext;
	}
	return count;
}


http://users.tpg.com.au/ling44/av_firefox.gifhttp://users.tpg.com.au/ling44/av_rg.gif
 
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: Attack Helicopter's Carrying two People.
Next Topic: Mod installer?
Goto Forum:
  


Current Time: Wed Jan 08 13:56:42 MST 2025

Total time taken to generate the page: 0.00937 seconds