Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » My First Code
My First Code [message #268476] Sat, 23 June 2007 21:38 Go to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
will this code work so that MY NICK (ID) can teleport ANOTHER PLAYER

if(stristr(Msg2, "!<command>") == 0 && strcmp(Get_Player_Name_By_ID(ID), "<player name>") == 0)
{
	if (stricmp(Get_Player_Name_By_ID(ID),"<nick>") == 0) {
                Change_Team(obj,2);
                Change_Character(obj,"c_ag_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->Set_Position(obj,Move);


so like explame
<joe>!teleport zunnie

then it does teleport him (which ill fill out later) and wit the stuff i added above

so will it work if not please help me fix it
Re: My First Code [message #268517 is a reply to message #268476] Sun, 24 June 2007 08:10 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
You cannot change the charater to a w3d file.

Change_Character(obj,"c_ag_gdi_mp");

Should be:

Commands->Set_Model(obj, "c_ag_gdi_mp");


We don't know how you've set "Move" so we can't tell you is the teleport will actully work.

if(stristr(Msg2, "!<command>") == 0 && strcmp(Get_Player_Name_By_ID(ID), "<player name>") == 0)
{
	if (stricmp(Get_Player_Name_By_ID(ID),"<nick>") == 0) {

Should be:
if(stristr(Msg2, "!<command>") == 0 && strcmp(Get_Player_Name_By_ID(ID), "<player name>") == 0)
{

After changing that you will need to remove a right brace "}" from the block.

Re: My First Code [message #268539 is a reply to message #268476] Sun, 24 June 2007 14:12 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)
my bad i already meant to put the presents name not model i forgot
and i know the move is set but just ignore it i dont have the rest for it (and when i do idk how to put it lol)


also it has to make it so ONLY I (my nick) can do the command on another player so ya with this info above what else do i really have to change Very Happy


here let me fix it

if(stristr(Msg2, "!<command>") == 0 && strcmp(Get_Player_Name_By_ID(ID), "<player name>") == 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->Set_Position(obj,Move); (skip this for now)

if that loooks right to u now so only I can do the command on someone?
and ty guy

[Updated on: Sun, 24 June 2007 14:15]

Report message to a moderator

Re: My First Code [message #268621 is a reply to message #268539] Sun, 24 June 2007 20:47 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
joe937465 wrote on Sun, 24 June 2007 22:12


if that loooks right to u now so only I can do the command on someone?
and ty guy


Try it Wink
Re: My First Code [message #268622 is a reply to message #268476] Sun, 24 June 2007 20:49 Go to previous message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
lol not easy to find someone to help <_<
Previous Topic: how can i do these
Next Topic: Editing Existing Code
Goto Forum:
  


Current Time: Mon Dec 23 12:22:28 MST 2024

Total time taken to generate the page: 0.00646 seconds