Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Editing Existing Code
Editing Existing Code [message #268581] Sun, 24 June 2007 19:09 Go to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
heres the code i got
		else if ((stricmp(Msg2, "!!turrent") == 0))
Pos = Commands->Get_Position(obj);
  Vector3 Pos.Z += 0;
GameObject *turret = Commands->Create_Object(team==0?"<preset>":"<name of object>",Pos);
			   Commands->Disable_Physical_Collisions(turret);
if (team == 1)
			   Commands->Set_Player_Type(turret,1);
                     Commands->Give_Money(obj,2500*-1.0f,false);
	}
}


dont mine the parts that are blank the only thing i need someone to help me is make it say a message when you buy it like this

"You Have Just Purchased <name>"

and if u dont have enough money make it says

"you dont have enough creds to purchase this"

please someone help

[Updated on: Sun, 24 June 2007 19:22]

Report message to a moderator

Re: Editing Existing Code [message #268582 is a reply to message #268581] Sun, 24 June 2007 19:16 Go to previous messageGo to next message
Canadacdn is currently offline  Canadacdn
Messages: 1830
Registered: September 2005
Location: Temple of Nod
Karma: 0
General (1 Star)
PLECOS MASTER
Instead of learning coding, go learn spelling.
Re: Editing Existing Code [message #268590 is a reply to message #268581] Sun, 24 June 2007 19:28 Go to previous messageGo to next message
jamiejrg is currently offline  jamiejrg
Messages: 403
Registered: February 2007
Location: Canada
Karma: 0
Commander
I don't mean to be rude or flame or anything. But, is english your primary language?

Jamie


cncnick13 wrote on Fri, 24 August 2007 23:39

ok im using my dektop right now


cncnick13 wrote on Sun, 26 August 2007 00:04

umm whats the edit button
Re: Editing Existing Code [message #268592 is a reply to message #268581] Sun, 24 June 2007 19:33 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
yes it is i just have trouble typing message out but please can someone help me ?
Re: Editing Existing Code [message #268616 is a reply to message #268581] Sun, 24 June 2007 20:25 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
This is something I made for Kamuix. You can use it for what you're trying to do.

else if (stricmp(Msg2,"!Deploy GuardTower") == 0) {
	if (Get_Object_Type(obj) == 1) {
	        int Cost = 500;
	        char message[256];
	        GameObject *obj = Get_GameObj(ID);
		if (Purchase_Item(obj,Cost)) {
			Vector3 Pos = Commands->Get_Position(obj);
			Pos.Z += 5;
GameObject *GT = Commands->Create_Object("GDI_Guard_Tower",Pos);
Commands->Disable_Physical_Collisions(GT);
			sprintf(message,"msg Player %s has deployed a GDI Guard Tower",Get_Player_Name_By_ID(ID));
			Console_Input(message);
		}
		else {
			sprintf(message,"ppage %d Sorry, a Guard Tower costs $500",ID);
			Console_Input(message);
		}
	}
}


Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )

[Updated on: Sun, 24 June 2007 20:26]

Report message to a moderator

Re: Editing Existing Code [message #268617 is a reply to message #268581] Sun, 24 June 2007 20:29 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
ty this is what i needed now i got to try myself to make a char change one but if i look at this i may get it


now do i type this in the chat hook?

[Updated on: Sun, 24 June 2007 20:51]

Report message to a moderator

Re: Editing Existing Code [message #268625 is a reply to message #268581] Sun, 24 June 2007 20:58 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
heres something else i have a teleport command but every map is diffrent now heres the code string

                Commands->Set_Position(obj,"

how can i make it so it also moves it to where the renegade spawner is (objects>startup spawner's>renegade spawner

so like everytime i do the command it places the player in the spot where that spawner is on the map that i edit

any way of doing that?
Re: Editing Existing Code [message #268631 is a reply to message #268581] Sun, 24 June 2007 21:41 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
or if u can teleport it to a zone id that i make?
Re: Editing Existing Code [message #268644 is a reply to message #268581] Mon, 25 June 2007 01:26 Go to previous message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
how about this code
else if (stristr(Msg2, "!Teleport <players name>") == 0 && strcmp(Get_Player_Name_By_ID(ID),"<nick>") == 0) {
           {     
                Change_Team(obj,2);
                Change_Character(obj,"GDI_MP");
                Commands->Give_Powerup(obj,"CnC_POW_AutoRifle_Player_Nod",false);
		Commands->Give_Powerup(obj,"CnC_POW_AutoRifle_Player_GDI",false);
		Commands->Give_Powerup(obj,"POW_Shotgun_Player",false);
		Commands->Give_Powerup(obj,"POW_Flamethrower_Player",false);
		Commands->Give_Powerup(obj,"POW_GrenadeLauncher_Player",false);
		Commands->Give_Powerup(obj,"POW_Pistol_Player",false);
		Commands->Give_Powerup(obj,"CnC_POW_MineRemote_02",false);
		Commands->Give_Powerup(obj,"CnC_POW_MineTimed_Player_01",false);
		Commands->Give_Powerup(obj,"POW_Chaingun_Player_Nod",false);
		Commands->Give_Powerup(obj,"CnC_POW_RocketLauncher_Player",false);
		Commands->Give_Powerup(obj,"POW_ChemSprayer_Player",false);
		Commands->Give_Powerup(obj,"POW_LaserRifle_Player",false);
		Commands->Give_Powerup(obj,"POW_LaserChaingun_Player",false);
		Commands->Give_Powerup(obj,"POW_SniperRifle_Player_Nod",false);
		Commands->Give_Powerup(obj,"POW_RamjetRifle_Player",false);
		Commands->Give_Powerup(obj,"POW_Railgun_Player",false);
		Commands->Give_Powerup(obj,"CnC_POW_VoltAutoRifle_Player_Nod",false);
		Commands->Give_Powerup(obj,"POW_VoltAutoRifle_Player",false);
		Commands->Give_Powerup(obj,"POW_SniperRifle_Player",false);
		Commands->Give_Powerup(obj,"CnC_POW_RepairGun_Player",false);
		Commands->Give_Powerup(obj,"CnC_POW_RepairGun_Player",false);
Vector3 Pos = Commands->Get_Position(Find_Object_By_Preset(2,"Daves Arrow"));
Commands->Set_Position(obj,Pos);

            {
	        if (RandomNum == 1 || RandomNum == 2 || RandomNum == 3 || RandomNum == 4)
	    {
		Vector3 Pos = Commands->Get_Position(Find_Object_By_Preset(2,"Daves Arrow"));
            }
		else
	    {
		Vector3 Pos = Commands->Get_Position(Find_Object_By_Preset(2,"Daves Arrow"));
	    }
		else
	    {
		Vector3 Pos = Commands->Get_Position(Find_Object_By_Preset(2,"Daves Arrow"));
	    }		
                else
	    {
		Vector3 Pos = Commands->Get_Position(Find_Object_By_Preset(2,"Daves Arrow"));
	    }




im trying to make a code so ingame under my ID (ren nick) can do this command !teleport <playersname>
to teleport a player to a spot on the map (since all maps are diffrent) and have it teleport there to the 2 random spots
i choose (daves arrow) and when it gets here it will be unteamed as a gdi MP and have all the weps
Previous Topic: My First Code
Next Topic: Serverside
Goto Forum:
  


Current Time: Mon Dec 23 12:36:18 MST 2024

Total time taken to generate the page: 0.01450 seconds