Home » Renegade Discussions » Mod Forum » Editing Existing Code
Editing Existing Code [message #268581] |
Sun, 24 June 2007 19:09 |
_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 #268590 is a reply to message #268581] |
Sun, 24 June 2007 19:28 |
|
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 #268616 is a reply to message #268581] |
Sun, 24 June 2007 20:25 |
|
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 #268625 is a reply to message #268581] |
Sun, 24 June 2007 20:58 |
_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 #268644 is a reply to message #268581] |
Mon, 25 June 2007 01:26 |
_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
|
|
|
Goto Forum:
Current Time: Mon Dec 23 19:18:17 MST 2024
Total time taken to generate the page: 0.00917 seconds
|