Home » Renegade Discussions » Mod Forum » Ingame Error?
Re: Ingame Error? [message #273334 is a reply to message #273299] |
Sun, 15 July 2007 05:56 |
dead6re
Messages: 602 Registered: September 2003
Karma:
|
Colonel |
|
|
a100 wrote on Sun, 15 July 2007 04:31 | Are you sure they have enabled collision properties?
PS. Looking at the code, dont continuasly open the file and read from it everytime the command is called on because it will lag the server and will crash it sometimes. Or atleast thats what happned to me.
|
Opening/Closing a file won't crash your server. I always did that until I wrote my "cache ini class".
class testChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
if (Is_Mod("Test_Mods.txt",Get_Player_Name_By_ID(ID))) {
GameObject *obj = Get_GameObj(ID); // Gets GameObj using Player ID
Change_Character(obj, "GDI_MP");
Commands->Attach_Script(obj, "JFW_Permanent_No_Falling_Damage", ""); // Prevent obj from recieving falling damage
Commands->Give_Powerup(obj,"CnC_POW_AutoRifle_Player_GDI", ""); // Give GDI Auto Rifle
SimpleDynVecClass<GameObject*> List = Get_All_Objects_By_Preset(2,"Signal_Flares"); // Get a list of all the flares (MAKE SURE THE TEAM IS SET TO 2! WILL NOT WORK OTHERWISE)
int id = Commands->Get_Random_Int(0, List.Count()-1) // C++ always starts at 0, not 1 therefore -1 :)
GameObject *RandObj = List[id]; // Pick the GameObj
Commands->Set_Position(obj, Commands->Get_Position(RandObj)); // Move the position of your GameObj to the flare!
}
else {
char Bad[256];
sprintf(Bad, "ppage %d You do not have access to this command", ID);
Console_Input(Bad);
}
}
}
Let all your wishes be granted except one, so you will still have something to strieve for.
|
|
|
Goto Forum:
Current Time: Wed Nov 06 14:34:45 MST 2024
Total time taken to generate the page: 0.00775 seconds
|