Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » C++ help question
C++ help question [message #380533] Wed, 15 April 2009 16:56 Go to previous message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma:
General (1 Star)
I'm trying to use a certain code that's in one .cpp file to be used in another .cpp file. How do I go about doing that?

I have this in gmmain.cpp
struct VeteranPlayers {
	std::string PlayerName;
	int VeteranPoints;
};

std::vector<VeteranPlayers> VetInfo;


int VetCheckPoints(int ID) {
	if (!VetInfo.empty()) {
		for (int i = 0; i < VetInfo.size(); i++) {
			if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) {
				int Points;
				Points = VetInfo[i].VeteranPoints;
				return Points;
			}
		}
	}
	return 0;
}


I'm trying to get this to work also in gmscripts.cpp. Anyone can help me do that?


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
 
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 Request]
Next Topic: RenX ERROR
Goto Forum:
  


Current Time: Sat Dec 21 03:01:50 MST 2024

Total time taken to generate the page: 0.00810 seconds