Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Having problems with C++
Re: Having problems with C++ [message #335849 is a reply to message #335728] Wed, 18 June 2008 14:12 Go to previous messageGo to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
Get_GameObj needs a player ID.

class jailChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
if (!Text[1].empty() ) {
      const char *pris = Get_Player_Name(Get_Part_Name(Text[1].c_str())); 
GameObject *obj = Get_GameObj_By_Player_Name(pris);
	int x = 100054;
GameObject *gotoObject = Commands->Find_Object(x);
		 Vector3 gotoLocation = Commands->Get_Position(gotoObject);
 		Commands->Set_Position(obj,gotoLocation);
			Change_Character(obj,"GDI_Prisoner_v0a");
             Commands->Set_Shield_Type(obj,"Blamo");
			       Console_Input(StrFormat("cmsg 166,149,56 [BSS: %d Has Been Arrested ]", Get_Player_ID(Get_Part_Name(Text[1].c_str()))).c_str());

}
else {
Console_Input(StrFormat("ppage %d ERROR!",ID).c_str());
}
}
};
ChatCommandRegistrant<jailChatCommand> jailChatCommandReg("!jail;!j",CHATTYPE_ALL,1,GAMEMODE_AOW);
 
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: could anyone help me with this mod commands
Next Topic: [Release] split mine limit plug-in
Goto Forum:
  


Current Time: Tue Nov 26 05:25:21 MST 2024

Total time taken to generate the page: 0.00803 seconds