can anyone just help me finish my code? [message #268783] |
Mon, 25 June 2007 22:50 |
_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 |
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 |
_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 #269380 is a reply to message #268783] |
Thu, 28 June 2007 11:24 |
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 #269798 is a reply to message #269392] |
Sat, 30 June 2007 09:39 |
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 #270347 is a reply to message #270342] |
Tue, 03 July 2007 02:31 |
|
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.
|
|
|
|