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 #381848 is a reply to message #380533] Tue, 21 April 2009 23:53 Go to previous messageGo to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
if (VetInfo[i].PlayerName == Get_Player_Name_By_ID(ID)) {


Very bad
Use:
const char *pName = Get_Player_Name_By_ID(ID);
if(!pName) return 0;
if (strcmp(VetInfo[i].PlayerName.c_str(), pName) == 0) {
...
}
delete []pName;


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) {



Bad
Use:
if(!Commands->Is_A_Star(sender)) return;

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) {

 
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 Jan 11 17:58:15 MST 2025

Total time taken to generate the page: 0.00836 seconds