Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Spectate yo
Spectate yo [message #277551] Mon, 06 August 2007 11:24 Go to next message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
I need something that is invisible so I can set my character model to so I can spectate. I can't find the model for invisible_object for obvious reason. I tried the daves arrow model but it didn't work. What else could I use?

http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost
Re: Spectate yo [message #277559 is a reply to message #277551] Mon, 06 August 2007 11:42 Go to previous messageGo to next message
BlueThen is currently offline  BlueThen
Messages: 2402
Registered: February 2006
Karma: 0
General (2 Stars)
null.

What I usually do is, set the model to null, increase the speed by a dozen or so, attach jfw_flying_infantry, and remove physical collision. So then it'd be like some kind of ghost mode. Smile

[Updated on: Mon, 06 August 2007 11:44]

Report message to a moderator

Re: Spectate yo [message #277560 is a reply to message #277559] Mon, 06 August 2007 11:50 Go to previous messageGo to next message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
How do you increase the speed in C++?
Edit: I'm still visible when I set my model as null.


http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost

[Updated on: Mon, 06 August 2007 11:57]

Report message to a moderator

Re: Spectate yo [message #277563 is a reply to message #277560] Mon, 06 August 2007 11:58 Go to previous messageGo to next message
BlueThen is currently offline  BlueThen
Messages: 2402
Registered: February 2006
Karma: 0
General (2 Stars)
Idk. It always works for me when I do it through objects.
Re: Spectate yo [message #277566 is a reply to message #277551] Mon, 06 August 2007 12:07 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Commands->Set_Model(obj,"null");
Commands->Set_Is_Visible(obj,false);
Commands->Clear_Weapons(obj);
Commands->Set_Shield_Type(obj,"blamo");
Commands->Attach_Script(obj,"jfw_flying_infantry","");



Re: Spectate yo [message #277567 is a reply to message #277566] Mon, 06 August 2007 12:11 Go to previous messageGo to next message
BlueThen is currently offline  BlueThen
Messages: 2402
Registered: February 2006
Karma: 0
General (2 Stars)
Reborn wrote on Mon, 06 August 2007 14:07

Commands->Set_Model(obj,"null");
Commands->Set_Is_Visible(obj,false);
Commands->Clear_Weapons(obj);
Commands->Set_Shield_Type(obj,"blamo");
Commands->Attach_Script(obj,"jfw_flying_infantry","");



Commands->Attach_Script(obj,"jfw_Disable_Physical_Collision","");

am I right?!

Re: Spectate yo [message #277570 is a reply to message #277551] Mon, 06 August 2007 12:15 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Commands->Disable_Physical_Collisions(obj);
Commands->Disable_All_Collisions(obj);



Re: Spectate yo [message #277573 is a reply to message #277551] Mon, 06 August 2007 12:23 Go to previous messageGo to next message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
I'm still not invisible. Here is my code.
Quote:

else if (strncmp(Msg3,"!spectate",9) == 0) { // change 12 to how many letters command + ! is change !yourcommand to what you want
if (obj){ // LEAVE THIS VERY IMPORTANT
const char *name = Get_Player_Name(obj);
if ((strncmp(name,"Sn1per74",Cool == 0) || (strncmp(name,"Sniperhid",9) == 0)) {
char message[500];
sprintf(message,"team2 %d -2",ID);
Console_Input(message);
Change_Character(obj,"CnC_Nod_MiniGunner_0");
Commands->Set_Model(obj,"null");
Commands->Set_Is_Visible(obj,false);
Commands->Clear_Weapons(obj);
Commands->Set_Shield_Type(obj,"blamo");
Commands->Attach_Script(obj,"jfw_flying_infantry","");
Commands->Disable_All_Collisions(obj);
Commands->Give_Powerup(obj,"POW_AutoRifle_Player",false);
Commands->Give_Powerup(obj,"POW_Chaingun_Player",false);
Commands->Give_Powerup(obj,"POW_ChemSprayer_Player",false);
Commands->Give_Powerup(obj,"POW_Flamethrower_Player",false);
Commands->Give_Powerup(obj,"POW_GrenadeLauncher_Player",false);
Commands->Give_Powerup(obj,"POW_LaserChaingun_Player",false);
Commands->Give_Powerup(obj,"POW_MineProximity_Player",false);
Commands->Give_Powerup(obj,"POW_LaserRifle_Player",false);
Commands->Give_Powerup(obj,"POW_MineRemote_Player",false);
Commands->Give_Powerup(obj,"POW_MineTimed_Player",false);
Commands->Give_Powerup(obj,"POW_PersonalIonCannon_Player",false);
Commands->Give_Powerup(obj,"POW_Railgun_Player",false);
Commands->Give_Powerup(obj,"POW_RamjetRifle_Player",false);
Commands->Give_Powerup(obj,"POW_RepairGun_ai",false);
Commands->Give_Powerup(obj,"POW_RocketLauncher_Player",false);
Commands->Give_Powerup(obj,"POW_Shotgun_Player",false);
Commands->Give_Powerup(obj,"POW_SniperRifle_Player",false);
Commands->Give_Powerup(obj,"POW_TiberiumAutoRifle_Player",false);
Commands->Give_Powerup(obj,"POW_TiberiumFlechetteGun_Player",false);
Commands->Give_Powerup(obj,"POW_VoltAutoRifle_Player",false);
sprintf(message,"ppage %d You are now a spectator.",ID);
Console_Input(message);
}
else {
// gets here if second word was not a valid player
char message[256];
sprintf(message,"ppage %d You aren't Sn1per74!",ID);
Console_Input(message);
}
}
}



http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost

[Updated on: Mon, 06 August 2007 12:36]

Report message to a moderator

Re: Spectate yo [message #277576 is a reply to message #277573] Mon, 06 August 2007 12:28 Go to previous messageGo to next message
BlueThen is currently offline  BlueThen
Messages: 2402
Registered: February 2006
Karma: 0
General (2 Stars)
Sn1per74* wrote on Mon, 06 August 2007 14:23

I'm still not invisible.
Quote:

else if (strncmp(Msg3,"!spectate",9) == 0) { // change 12 to how many letters command + ! is change !yourcommand to what you want
if (obj){ // LEAVE THIS VERY IMPORTANT
const char *name = Get_Player_Name(obj);
if ((strncmp(name,"Sn1per74",Cool == 0) || (strncmp(name,"Sniperhid",9) == 0)) {
char message[500];
sprintf(message,"team2 %d -2",ID);
Console_Input(message);
Change_Character(obj,"CnC_Nod_MiniGunner_0");
Commands->Set_Model(obj,"null");
Commands->Set_Is_Visible(obj,false);
Commands->Clear_Weapons(obj);
Commands->Set_Shield_Type(obj,"blamo");
Commands->Attach_Script(obj,"jfw_flying_infantry","");
Commands->Disable_All_Collisions(obj);
Commands->Give_Powerup(obj,"POW_AutoRifle_Player",false);
Commands->Give_Powerup(obj,"POW_Chaingun_Player",false);
Commands->Give_Powerup(obj,"POW_ChemSprayer_Player",false);
Commands->Give_Powerup(obj,"POW_Flamethrower_Player",false);
Commands->Give_Powerup(obj,"POW_GrenadeLauncher_Player",false);
Commands->Give_Powerup(obj,"POW_LaserChaingun_Player",false);
Commands->Give_Powerup(obj,"POW_MineProximity_Player",false);
Commands->Give_Powerup(obj,"POW_LaserRifle_Player",false);
Commands->Give_Powerup(obj,"POW_MineRemote_Player",false);
Commands->Give_Powerup(obj,"POW_MineTimed_Player",false);
Commands->Give_Powerup(obj,"POW_PersonalIonCannon_Player",false);
Commands->Give_Powerup(obj,"POW_Railgun_Player",false);
Commands->Give_Powerup(obj,"POW_RamjetRifle_Player",false);
Commands->Give_Powerup(obj,"POW_RepairGun_ai",false);
Commands->Give_Powerup(obj,"POW_RocketLauncher_Player",false);
Commands->Give_Powerup(obj,"POW_Shotgun_Player",false);
Commands->Give_Powerup(obj,"POW_SniperRifle_Player",false);
Commands->Give_Powerup(obj,"POW_TiberiumAutoRifle_Player",false);
Commands->Give_Powerup(obj,"POW_TiberiumFlechetteGun_Player",false);
Commands->Give_Powerup(obj,"POW_VoltAutoRifle_Player",false);
sprintf(message,"ppage %d You are now a spectator.",ID);
Console_Input(message);
}
else {
// gets here if second word was not a valid player
char message[256];
sprintf(message,"ppage %d You aren't Sn1per74!",ID);
Console_Input(message);
}
}
}



Edit:nvm

[Updated on: Mon, 06 August 2007 12:29]

Report message to a moderator

Re: Spectate yo [message #277579 is a reply to message #277551] Mon, 06 August 2007 12:41 Go to previous messageGo to next message
AoBfrost is currently offline  AoBfrost
Messages: 1248
Registered: March 2007
Karma: 0
General (1 Star)
I was told setting infantry runspeed by a command was not easy, that it needed to be made because it wasnt there already. I may be wrong.

http://i4.photobucket.com/albums/y133/FMAROCKS/godotsig.gif
Scrin wrote on Fri, 05 October 2007 12:19

''whoa im the photoshop''

KANE LIVES!!!
Re: Spectate yo [message #277582 is a reply to message #277551] Mon, 06 August 2007 12:56 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
usig weapons will most lightly crash the server/client and is also pointless is your mwnt to be spectating

goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: Spectate yo [message #277584 is a reply to message #277582] Mon, 06 August 2007 13:09 Go to previous messageGo to next message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
Hex wrote on Mon, 06 August 2007 14:56

usig weapons will most lightly crash the server/client and is also pointless is your mwnt to be spectating

But it'd be fun to shoot ppl when they can't shoot back. Big Grin
/me always think ahead.


http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost
Re: Spectate yo [message #277586 is a reply to message #277551] Mon, 06 August 2007 13:12 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
const char *WideCharToChar(const wchar_t *wcs);
void Chat(int ID, int Type, const wchar_t *Msg) {

GameObject *obj = Get_GameObj(ID);

const char *Msg2 = WideCharToChar(Msg);
if (stricmp(Msg2,"!spec2") == 0)
{
if (stricmp(Get_Player_Name_By_ID(ID),"ren00b") == 0) {
Change_Character(obj,"CnC_Nod_FlameThrower_2SF");
Commands->Set_Model(obj,"null");
Commands->Set_Is_Visible(obj,false);
Commands->Clear_Weapons(obj);
Commands->Set_Shield_Type(obj,"blamo");
Commands->Attach_Script(obj,"jfw_flying_infantry","");
Commands->Disable_Physical_Collisions(obj);
Commands->Disable_All_Collisions(obj);
}
}
}



Re: Spectate yo [message #277587 is a reply to message #277586] Mon, 06 August 2007 13:16 Go to previous messageGo to next message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
Reborn wrote on Mon, 06 August 2007 15:12

const char *WideCharToChar(const wchar_t *wcs);
void Chat(int ID, int Type, const wchar_t *Msg) {

GameObject *obj = Get_GameObj(ID);

const char *Msg2 = WideCharToChar(Msg);
if (stricmp(Msg2,"!spec2") == 0)
{
if (stricmp(Get_Player_Name_By_ID(ID),"ren00b") == 0) {
Change_Character(obj,"CnC_Nod_FlameThrower_2SF");
Commands->Set_Model(obj,"null");
Commands->Set_Is_Visible(obj,false);
Commands->Clear_Weapons(obj);
Commands->Set_Shield_Type(obj,"blamo");
Commands->Attach_Script(obj,"jfw_flying_infantry","");
Commands->Disable_Physical_Collisions(obj);
Commands->Disable_All_Collisions(obj);
}
}
}

Does that make me unspec or is that to make me invisible? And, do I put that at the end of my command right?


http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost
Re: Spectate yo [message #277591 is a reply to message #277551] Mon, 06 August 2007 13:26 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
It's an abbridged version of the chat hook in ssaow 1.5 to make you spectate.


Re: Spectate yo [message #277603 is a reply to message #277551] Mon, 06 August 2007 15:14 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
void Player_Spectate::Created(GameObject *obj) {
	Commands->Set_Is_Visible(obj,false);
	Commands->Set_Model(obj,"null");
	Commands->Set_Shield_Type(obj,"Blamo");
	Commands->Clear_Weapons(obj);
	Toggle_Fly_Mode(obj);
	Commands->Disable_All_Collisions(obj);
}


class SpectateChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
     GameObject *obj = Get_GameObj(ID);

  if (stricmp(Get_Player_Name_By_ID(ID),"yourname") == 0) {
    if (Is_Script_Attached(obj,"Player_Spectate")) {
    Commands->Destroy_Object(obj);
    }
    else {
   Commands->Attach_Script(obj,"Player_Spectate","");
   }
  }
 }
};
ChatCommandRegistrant<SpectateCommand> SpectateCommandReg("!spec",CHATTYPE_ALL,0,GAMEMODE_AOW);

ScriptRegistrant<Player_Spectate> Player_Spectate_Registrant("Player_Spectate","");


That will allow you to turn spec mode on and off.


goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: Spectate yo [message #277643 is a reply to message #277551] Mon, 06 August 2007 19:23 Go to previous messageGo to next message
AoBfrost is currently offline  AoBfrost
Messages: 1248
Registered: March 2007
Karma: 0
General (1 Star)
When i use spectate i can pick up guns and use them, for some reason, they dont do damage, but they still work fine, it's funny watching a floating gun fly around.

http://i4.photobucket.com/albums/y133/FMAROCKS/godotsig.gif
Scrin wrote on Fri, 05 October 2007 12:19

''whoa im the photoshop''

KANE LIVES!!!
Re: Spectate yo [message #277709 is a reply to message #277643] Tue, 07 August 2007 09:14 Go to previous messageGo to next message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
Ok.. I got it working.
Now, how would I make my thingamabobber read a text document to find out who the moderators are, and let only them do the commands?


http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost
Re: Spectate yo [message #277711 is a reply to message #277551] Tue, 07 August 2007 09:22 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
If you are releasing it then I would say do it as a text file. If you are keeping it private then I would keep it hard coded so no one can add or remove other mods apart from yourself.


Re: Spectate yo [message #277716 is a reply to message #277711] Tue, 07 August 2007 09:36 Go to previous messageGo to next message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
But, I know how to hard code it. I want to learn how to make it read text documents so I can maybe use that for something else in the future.

http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost
Re: Spectate yo [message #277718 is a reply to message #277716] Tue, 07 August 2007 09:55 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
RoShamBo wrote on Sat, 07 July 2007 15:56



#include <fstream>

is at the top of the cpp file


bool Is_Mod(const char *Name)
{
     fstream file("mods.txt", ios::in);
     string tmp;
     while(file >> tmp)
     { 
         if(strcmp(Name, tmp.c_str()) == 0)
          {
               return 1;
         }
     }
     return 0;
}

class exampleChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
         if(Is_Mod(Get_Player_Name_By_ID(ID))
         {
             Commands->(do something)
         }
         else
         {
                 //this player isn't a mod
         }

};



then, in mods.txt
<nick1>
<nick2>
<nick3>




goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: Spectate yo [message #277720 is a reply to message #277718] Tue, 07 August 2007 09:59 Go to previous messageGo to next message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
Thank you Reborn and Hex. You've been a great help! Thumbs Up
I put the text document in the server folder correct?


http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost

[Updated on: Tue, 07 August 2007 10:00]

Report message to a moderator

Re: Spectate yo [message #277740 is a reply to message #277551] Tue, 07 August 2007 12:32 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
yes

goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: Spectate yo [message #278156 is a reply to message #277718] Thu, 09 August 2007 19:51 Go to previous messageGo to next message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
Hex wrote on Tue, 07 August 2007 11:55

RoShamBo wrote on Sat, 07 July 2007 15:56



#include <fstream>

is at the top of the cpp file


bool Is_Mod(const char *Name)
{
     fstream file("mods.txt", ios::in);
     string tmp;
     while(file >> tmp)
     { 
         if(strcmp(Name, tmp.c_str()) == 0)
          {
               return 1;
         }
     }
     return 0;
}

class exampleChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
         if(Is_Mod(Get_Player_Name_By_ID(ID))
         {
             Commands->(do something)
         }
         else
         {
                 //this player isn't a mod
         }

};



then, in mods.txt
<nick1>
<nick2>
<nick3>




It tells me fstream is an undeclared identifier.


http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost
Re: Spectate yo [message #278158 is a reply to message #277551] Thu, 09 August 2007 20:08 Go to previous messageGo to previous message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
under fstream add this?
using namespace std;


right?
Previous Topic: need name of dds file
Next Topic: 3 new guns
Goto Forum:
  


Current Time: Mon Jul 29 08:20:35 MST 2024

Total time taken to generate the page: 0.01220 seconds