Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » C++ help question
Re: C++ help question [message #380840 is a reply to message #380533] Fri, 17 April 2009 11:58 Go to previous messageGo to previous message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma:
General (1 Star)
I'm not bothered by the health and armor. I'm trying to recreate the mod that we use on our server. There were too many modifications for me to keep it as a plugin because it required so much stuff from my main code. I edited the veteran system a lot and even had it work for CTF mode flag events.

This is what I'm trying to pull off. Maybe you can get the idea. I placed this in gmscripts.cpp


void MDB_SSGM_Vehicle::Custom(GameObject *obj, int message, int param, GameObject *sender) {
	int Points;
	Points = VetCheckPoints(Get_Player_ID(sender));
	float health = Commands->Get_Max_Health(obj);
	float armor = Commands->Get_Shield_Strength(obj);

	
	if (message == CUSTOM_EVENT_VEHICLE_ENTER) {
		if (Settings->EnableVehOwn && Get_Vehicle_Owner(obj) == sender && !Find_My_Veh(sender)) {
			Commands->Attach_Script(obj,"MDB_SSGM_Vehicle_Owner",StrFormat("%d,%d",Commands->Get_ID(sender),Get_Object_Type(sender)).c_str());
			Console_Input(StrFormat("ppage %d Your vehicle has been auto-bound to you. Use !unbind to relinquish ownership. Use !lock to prevent your teammates from stealing the vehicle.",Get_Player_ID(sender)).c_str());
			if (Points >= 120) {
				Set_Max_Health(obj, health*1.40f);
				Set_Max_Shield_Strength(obj, armor*1.40f);
				Attach_Script_Once(obj,"c_Regen","3,1,8");
			}
			else if (Points >= 90 && Points < 120) {
				Set_Max_Health(obj, health*1.30f);
				Set_Max_Shield_Strength(obj, armor*1.30f);
				Attach_Script_Once(obj,"c_Regen","4,1,6");
			}
			else if (Points >= 60 && Points < 90) {
				Set_Max_Health(obj, health*1.20f);
				Set_Max_Shield_Strength(obj, armor*1.20f);
				Attach_Script_Once(obj,"c_Regen","4,1,4");
			}
			else if (Points >= 30 && Points < 60) {
				Set_Max_Health(obj, health*1.10f);
				Set_Max_Shield_Strength(obj, armor*1.10f);
				Attach_Script_Once(obj,"c_Regen","4,1,2");
			}
			Commands->Set_Health(obj, Commands->Get_Max_Health(obj));
			Commands->Set_Shield_Strength(obj, Commands->Get_Max_Shield_Strength(obj));
		}
	}
}


This is what I'm trying to do thus why I'm asking how to use a function from another cpp file. And I'm having no luck right now because I'm having crash issues or code errors.


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 11:34:21 MST 2024

Total time taken to generate the page: 0.01294 seconds