Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » can anyone just help me finish my code?
can anyone just help me finish my code? [message #268783] Mon, 25 June 2007 22:50 Go to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
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,"Signal_Flares"));
                Commands->Set_Position(obj,Pos);
		{
			if (RandomNum == 1 || RandomNum == 2 || RandomNum == 3)
			{
				Vector3 Pos = Commands->Set_Position(obj,Pos);
			}
			else
			{
				Vector3 Pos = Commands->Set_Position(obj,Pos);
			}
                        else
			{
				Vector3 Pos = Commands->Set_Position(obj,Pos);
			}
		}


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 (single flares as heled by white dragon) and when it gets here it will be unteamed as a gdi MP and have all the weps but idk what i did wrong can soeone help me please!
Re: can anyone just help me finish my code? [message #268892 is a reply to message #268783] Tue, 26 June 2007 11:18 Go to previous messageGo to next message
dead6re is currently offline  dead6re
Messages: 602
Registered: September 2003
Karma: 0
Colonel
else if (stristr(Msg2, "!Teleport <players name>") == 0 && strcmp(Get_Player_Name_By_ID(ID),"<nick>") == 0) {


Are you expecting to to compile a version of the scripts.dll for each person in the game?

I believe the best way to have one command for this is to tokenize the string seperating the char* into two parts.

For yourself, it may be easier to convert Msg2 into a std::string for the time being and using subrstr(Start, Length).

It has been a while since I have looked into the scripts/bhs.dll but you could perform something like the following?


std::string ChatMsg(Msg2);
else if (ChatMsg.substr(0, 9) == "!Teleport") {
const char* TargetName = Get_Player_Name_By_ID(atoi(ChatMsg.substr(10).c_str));



PS: This is an idea, not complete code and may require editing.


Let all your wishes be granted except one, so you will still have something to strieve for.
Re: can anyone just help me finish my code? [message #268952 is a reply to message #268783] Tue, 26 June 2007 15:09 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)
well it it for some mods but idk how to edit brenbot to do that so im just using nick
and for this
std::string ChatMsg(Msg2);
else if (ChatMsg.substr(0, 9) == "!Teleport") {
const char* TargetName = Get_Player_Name_By_ID(atoi(ChatMsg.substr(10).c_str));

im not knowing what i does LOL

[Updated on: Tue, 26 June 2007 15:10]

Report message to a moderator

Re: can anyone just help me finish my code? [message #269117 is a reply to message #268783] Wed, 27 June 2007 07:20 Go to previous messageGo to next message
Sir Kane
Messages: 1701
Registered: March 2003
Location: Angerville
Karma: 0
General (1 Star)
std:: is bad.

Proud N9500 and proud N6270 user. Creator of the IEE libraries (original bhs.dll) and the RB series software.
http://n00bstories.com/image.fetch.php?id=1189992501http://www.n00bstories.com/image.fetch.php?id=1257492907
Re: can anyone just help me finish my code? [message #269118 is a reply to message #268783] Wed, 27 June 2007 07:22 Go to previous messageGo to next message
ST3ALTH is currently offline  ST3ALTH
Messages: 118
Registered: May 2007
Karma: 0
Recruit
Lmfao STD's are bad ;d

http://www.roleplay2.com/downloads/siggy.jpg
Re: can anyone just help me finish my code? [message #269380 is a reply to message #268783] Thu, 28 June 2007 11:24 Go to previous messageGo to next message
dead6re is currently offline  dead6re
Messages: 602
Registered: September 2003
Karma: 0
Colonel
I agree using std:: is bad, but for learning purposes with his knowledge it may be better for him. No doubt Sir Kane, you have your own functions/library for char*.

Either way, I think joe needs to read more into C++ and get to gribs with the functions and write a few simple programs before he moves onto a huge tasks that he seems to be embarking on with the current posts.


Let all your wishes be granted except one, so you will still have something to strieve for.
Re: can anyone just help me finish my code? [message #269392 is a reply to message #269380] Thu, 28 June 2007 12:07 Go to previous messageGo to next message
BlueThen is currently offline  BlueThen
Messages: 2402
Registered: February 2006
Karma: 0
General (2 Stars)
IT looks to me that Joe has barely done anything with the coding. He just get's everyone to code it and all he does is fill it out. Maybe you should learn first.
Re: can anyone just help me finish my code? [message #269747 is a reply to message #268783] Sat, 30 June 2007 02:04 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)
Sad
Re: can anyone just help me finish my code? [message #269798 is a reply to message #269392] Sat, 30 June 2007 09:39 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
BlueThen wrote on Thu, 28 June 2007 13:07

IT looks to me that Joe has barely done anything with the coding. He just get's everyone to code it and all he does is fill it out. Maybe you should learn first.



Yea, I'm currently (re-)learning Native C++ so that I can eventually begin modifying my own Renegade server.


-MathK1LL

[Updated on: Sat, 30 June 2007 09:39]

Report message to a moderator

Re: can anyone just help me finish my code? [message #270342 is a reply to message #268783] Tue, 03 July 2007 02:24 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)
lol
Re: can anyone just help me finish my code? [message #270347 is a reply to message #270342] Tue, 03 July 2007 02:31 Go to previous messageGo to next message
futura83
Messages: 1285
Registered: July 2006
Location: England
Karma: 0
General (1 Star)
Viva la Resistance!
joe937465 wrote on Tue, 03 July 2007 10:24

lol



How is it funny?

He said 'eventually' cos obviously he dosn't intend to rush straight into modding, so he dosn't have to ask for help loads on here....


This is a signature. Reading this is wasting your time.
Re: can anyone just help me finish my code? [message #270348 is a reply to message #268783] Tue, 03 July 2007 02:32 Go to previous message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
well i have learned alot of scrips in a short time lol
Previous Topic: the kamiux serv sustom made things
Next Topic: Random Char Error I need Fixed
Goto Forum:
  


Current Time: Mon Dec 30 02:07:26 MST 2024

Total time taken to generate the page: 0.01413 seconds