Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » [script]Code Release - Kamikaze Suit Crate
Re: Code Release - Kamikaze Suit Crate [message #312966 is a reply to message #312962] Tue, 22 January 2008 17:59 Go to previous messageGo to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma:
General (3 Stars)
wittebolx wrote on Tue, 22 January 2008 03:20

reborn wrote on Thu, 13 December 2007 19:04

Yeah, sorry math Sad


Anyway, madrocks...


class sbhChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
float Credits = Commands->Get_Money(obj);
int Team = Get_Object_Type(obj);
GameObject *hon = Find_Soldier_Factory(0);
Vector3 position;
position = Commands->Get_Position(obj);
if(hon){
if(Credits >= 2000 && (Team == 0) ){
	Commands->Give_Money(obj,-2000,false);
Change_Character(obj,"CnC_Nod_FlameThrower_2SF");
Commands->Set_Position(obj,position);
	}
else{
Console_Input(StrFormat("ppage %d You have not been charged for this purchase because you did not meet requirements.",Get_Player_ID(obj)).c_str());		
}
}
	}
};
ChatCommandRegistrant<sbhChatCommand> sbhChatCommandReg("!sbh",CHATTYPE_TEAM,0,GAMEMODE_AOW);



I havn't looked at your code yet hex, looking foward to it Smile


you can still use this command when hand of nod is dead.
would this work?

GameObject *hon = Find_Soldier_Factory(0);
Vector3 position;
position = Commands->Get_Position(obj);
if Is_Building_Dead(GameObject *hon);



I didn't actually test it, I thought that would work. Interesting...
I guess what you posted would work, but I havn't tried.

Darknes2 wrote on Tue, 22 January 2008 19:36

i just wanted to tell you guys *and this is pointless in saying that i too dislike chat hook although i probly dont dislike it AS much as everyone else but i use key hooks to let players buy vehicles and all. *i will post my code that stealths ur bound vehicle for 500 when its done!



The code you posted but removed was a little off, here it is re-written to actually work:

class svChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {

		GameObject *obj = Get_GameObj(ID);
		GameObject *veh = Find_My_Veh(obj);
			if (Commands->Get_Money(obj) <= 500){
			Console_Input(StrFormat("page %s you need at least 500$ to buy this",Get_Player_Name(obj)).c_str());
			}
			else{
	Commands->Give_Money(obj, -500, 1);
	Commands->Enable_Stealth(veh, 1);
	}
	}
};
ChatCommandRegistrant<svChatCommand> svChatCommandReg("!sv",CHATTYPE_PUBLIC,0,GAMEMODE_ALL);


However, it's still not very good because what if the dude doesn't have a vehichle?
You should do something like
"if(veh){//do the f0sh0zzle}
else{//msg to say you don't have a vehichle dumbass}"



 
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: Editing Reborn
Next Topic: How to add an OBGun in SSGM
Goto Forum:
  


Current Time: Fri Aug 16 11:59:39 MST 2024

Total time taken to generate the page: 0.01111 seconds