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 nameGameObject *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 namesint 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;
}