Home » Renegade Discussions » Mod Forum » C++ help question
Re: C++ help question [message #381736 is a reply to message #380533] |
Tue, 21 April 2009 14:03 |
|
Xpert
Messages: 1588 Registered: December 2005 Location: New York City
Karma:
|
General (1 Star) |
|
|
Okay, I'm completely stomped. I tried so many things and still end up back to square one. This time I went to debug the scripts.dll. It points to 2 parts of the code and it makes no sense to me.
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++) {
HERE --> if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) {
int Points;
Points = VetInfo[i].VeteranPoints;
return Points;
}
}
}
return 0;
}
GMMAIN.H
int VetCheckPoints(int ID);
GMSCRIPTS.CPP
void MDB_SSGM_Vehicle::Custom(GameObject *obj, int message, int param, GameObject *sender) {
HERE -->int 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);
Commands->Set_Health(obj, Commands->Get_Max_Health(obj));
Commands->Set_Shield_Strength(obj, Commands->Get_Max_Shield_Strength(obj));
Attach_Script_Once(obj,"cAMpa_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);
Commands->Set_Health(obj, Commands->Get_Max_Health(obj));
Commands->Set_Shield_Strength(obj, Commands->Get_Max_Shield_Strength(obj));
Attach_Script_Once(obj,"cAMpa_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);
Commands->Set_Health(obj, Commands->Get_Max_Health(obj));
Commands->Set_Shield_Strength(obj, Commands->Get_Max_Shield_Strength(obj));
Attach_Script_Once(obj,"cAMpa_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);
Commands->Set_Health(obj, Commands->Get_Max_Health(obj));
Commands->Set_Shield_Strength(obj, Commands->Get_Max_Shield_Strength(obj));
Attach_Script_Once(obj,"cAMpa_Regen","4,1,2");
}
}
}
}
When I debugged it, it pointed to the parts I put "HERE -->" above, as being the problem.
I don't know what to do. This is frustrating me >.>
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
[Updated on: Tue, 21 April 2009 14:05] Report message to a moderator
|
|
|
|
|
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 10:42:17 MST 2024
Total time taken to generate the page: 0.00969 seconds
|