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 |
|
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.
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
|
|
|
|
|
C++ help question
By: Xpert on Wed, 15 April 2009 16:56
|
|
|
Re: C++ help question
By: Zuess on Wed, 15 April 2009 18:24
|
|
|
Re: C++ help question
By: Xpert on Thu, 16 April 2009 19:00
|
|
|
Re: C++ help question
By: nopol10 on Thu, 16 April 2009 20:54
|
|
|
Re: C++ help question
By: reborn on Fri, 17 April 2009 04:02
|
|
|
Re: C++ help question
By: Xpert on Fri, 17 April 2009 11:58
|
|
|
Re: C++ help question
By: reborn on Fri, 17 April 2009 12:44
|
|
|
Re: C++ help question
|
|
|
Re: C++ help question
By: jnz on Fri, 17 April 2009 13:09
|
|
|
Re: C++ help question
By: Xpert on Tue, 21 April 2009 14:03
|
|
|
Re: C++ help question
By: cAmpa on Tue, 21 April 2009 15:34
|
|
|
Re: C++ help question
By: Xpert on Tue, 21 April 2009 23:39
|
|
|
Re: C++ help question
By: jnz on Tue, 21 April 2009 23:53
|
|
|
Re: C++ help question
By: Xpert on Wed, 22 April 2009 16:20
|
Goto Forum:
Current Time: Sat Dec 21 11:34:21 MST 2024
Total time taken to generate the page: 0.01294 seconds
|