Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [script]AirStrike function  () 1 Vote
Re: AirStrike function [message #330321 is a reply to message #330229] Tue, 13 May 2008 04:04 Go to previous message
EA-DamageEverything
Messages: 423
Registered: January 2005
Location: Germany
Karma:
Commander
SSnipe wrote on Mon, 12 May 2008 20:52

why cant i get it i think i put the codes in the right places

1>.\gmscripts.cpp(68) : error C3861: 'Get_Random_Building': identifier not found

...wat files to put the code in
The Random_Building is an addition to SSGM and has to be put in this way:

engine_gm.cpp

GameObject * Get_Random_Building(int Team) {
std::vector<GameObject*> Buildings;
GenericSLNode *x = BuildingGameObjList->HeadNode;
while (x != 0) {
GameObject *obj = (GameObject *)x->NodeData;
if (obj && (Get_Object_Type(obj) == Team || Team == 2) && !Is_Building_Dead(obj)) {
Buildings.push_back(obj);
}
x = x->NodeNext;
}
if (!Buildings.empty()) {
int Rand = Commands->Get_Random_Int(0,Buildings.size());
return Buildings[Rand];
}
return 0;
}
This comes right after "GameObject *Find_My_Veh"
---------
To get it working, you have to put the following into

engine_gm.h

GameObject *Get_Random_Building(int Team); // Selects a random building which has to be alive

This goes under "GameObject *Find_My_Veh(GameObject *obj); //Find my vehicle"
----------------

Generally, scripts should go into the gmmain.cpp, their classes into gmmain.h, ScriptRegistrants into gmmain.cpp OR gmcrate.cpp (does work even if it isn't a crate event). Chat hooks are in the gmmain.cpp, their Scriptregistrants can be put either in gmmain.cpp OR gmcrate.cpp.

==========

Reborn thanks for the script, I'll check it later.
 
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
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
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
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]Codename Havoc - hotwire replacement
Next Topic: [script]Parachute function
Goto Forum:
  


Current Time: Tue Jun 24 18:26:25 MST 2025

Total time taken to generate the page: 0.01803 seconds