Home » Renegade Discussions » Mod Forum » Ingame Error?
Re: Ingame Error? [message #273847 is a reply to message #273843] |
Tue, 17 July 2007 10:47   |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma:
|
General (4 Stars) |
|
|
dead6re wrote on Tue, 17 July 2007 18:42 | What code do you have?
|
i tryed to make it so u can use the command on another player but failed
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);
}
}
}
|
|
|
Goto Forum:
Current Time: Fri May 23 17:02:14 MST 2025
Total time taken to generate the page: 0.01244 seconds
|