Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » It's there a Grant Power Up script?
It's there a Grant Power Up script? [message #467945] Fri, 25 May 2012 05:31 Go to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

Here's what I got so far.

class Distrbd21ChatCommand : public ChatCommandClass {
            void Triggered(int ID,const TokenClass &Text,int ChatType) {
     
            if(strcmp(Get_Player_Name_By_ID(ID), "Distrbd21")) return;
                    GameObject *obj = Get_GameObj(ID);
                    int cost = 0;
                    if (Commands->Get_Money(obj) > cost)
                    {
                            Change_Character(obj, "CnC_GDI_MiniGunner_3Boss_ALT3");
                            Set_Max_Shield_Strength(obj, (Commands->Get_Max_Shield_Strength(obj) + 500));
							Set_Max_Health(obj, (Commands->Get_Max_Health(obj) + 500));
                            Attach_Script_Once(Get_GameObj(ID), "M00_No_Falling_Damage_DME", "");
							Attach_Script_Once(Get_GameObj(ID), "RA_Infantry_Spy", "");
							Attach_Script_Once(Get_GameObj(ID), "JFW_Blow_Up_On_Death", "Explosion_IonCannonBeacon");
							Attach_Script_Once(Get_GameObj(ID), "JFW_Poke_Play_3D_Sound", "Paging_caution_2.wav");
                            Commands->Set_Shield_Type(obj,"SkinMutant");
                           
              }
       }
 };
ChatCommandRegistrant<Distrbd21ChatCommand> Distrbd21ChatCommandReg("!dis",CHATTYPE_ALL,0,GAMEMODE_ALL);


Note I have tried to put
Commands->Give_Powerup(obj, "Weap Name here." 1);


But it doesn't give me the Weapons I tell it to.



Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[Updated on: Fri, 25 May 2012 05:34]

Report message to a moderator

Re: It's there a Grant Power Up script? [message #467949 is a reply to message #467945] Fri, 25 May 2012 05:43 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
You need to supply a Powerup preset name instead of a weapon name.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: It's there a Grant Power Up script? [message #467950 is a reply to message #467949] Fri, 25 May 2012 05:47 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

iRANian wrote on Fri, 25 May 2012 07:43

You need to supply a Powerup preset name instead of a weapon name.

Yes that is what I meant I did that, but sense I technically re spawn when changed to havoc it give's my weapons to my old char not the new one ;p


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Re: It's there a Grant Power Up script? [message #467951 is a reply to message #467945] Fri, 25 May 2012 05:52 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
Does changing the skin to mutant work?

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: It's there a Grant Power Up script? [message #467953 is a reply to message #467945] Fri, 25 May 2012 05:58 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

Haven't tried that, how would I change it like that?

I'm a n00b that is one of the codes I started working on, had help with it to lol.


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Re: It's there a Grant Power Up script? [message #467955 is a reply to message #467945] Fri, 25 May 2012 06:07 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
That code you showed already has a line to do that:

Commands->Set_Shield_Type(obj,"SkinMutant");

dunno if it works.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: It's there a Grant Power Up script? [message #467956 is a reply to message #467945] Fri, 25 May 2012 06:17 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

Oh that's to give me the tib shield so when I walk in tib field I Regen ;p

Can I put havoc's preset there?

I'm also having problems with.
Attach_Script_Once(Get_GameObj(ID), "JFW_Poke_Play_3D_Sound", "Paging_caution_2.wav");


When someone pokes me no sound, and I tried the 2D script to.


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[Updated on: Fri, 25 May 2012 06:18]

Report message to a moderator

Re: It's there a Grant Power Up script? [message #467958 is a reply to message #467945] Fri, 25 May 2012 06:30 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
I'm not sure.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: It's there a Grant Power Up script? [message #467960 is a reply to message #467956] Fri, 25 May 2012 06:42 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3806
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
GameObject *player = Get_GameObj(ID);
Use Commands->Create_Sound(Commands->Get_Position(player),"Paging_caution_2.wav",player);


I think thats the correct order for the params, not sure as I'm not at home.

There is also a Create_Sound_Player or Create_Player_Sound (something like that) which would only play the sound for one specific player.


[Updated on: Fri, 25 May 2012 06:44]

Report message to a moderator

Re: It's there a Grant Power Up script? [message #467990 is a reply to message #467945] Fri, 25 May 2012 18:25 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

I need it so when you poke me you hear the sound. ;p

And I'm getting a error on that script saying something about vector 3.


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Re: It's there a Grant Power Up script? [message #467991 is a reply to message #467945] Fri, 25 May 2012 18:27 Go to previous messageGo to next message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma: 0
General (1 Star)
vector3 means xyz coordinates

http://i32.photobucket.com/albums/d42/XpertMaverick/xpertyankee.jpg

Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.

Part time streamer - https://twitch.tv/gg_wonder
Re: It's there a Grant Power Up script? [message #467994 is a reply to message #467991] Fri, 25 May 2012 19:01 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

Xpert wrote on Fri, 25 May 2012 20:27

vector3 means xyz coordinates


I know that and I don't need that right now.

I don't want it to play a sound when we get it I want it to play a sound when someone comes up to me and press's e on me.


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Re: It's there a Grant Power Up script? [message #467996 is a reply to message #467994] Fri, 25 May 2012 22:54 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

DistrbdSt0rm21 wrote on Fri, 25 May 2012 21:01

Xpert wrote on Fri, 25 May 2012 20:27

vector3 means xyz coordinates


I know that and I don't need that right now.

I don't want it to play a sound when we get it I want it to play a sound when someone comes up to me and press's e on me.

That will do that. The problem is, that script says "3D" sound. Which means it requires a Vector3, because that sound plays at a specific position in the world and gets quieter the farther you are from it.

So yes, you do need that right now.


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: It's there a Grant Power Up script? [message #467997 is a reply to message #467945] Fri, 25 May 2012 23:40 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

OK so what do I need for the 2D sound?

Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Re: It's there a Grant Power Up script? [message #468000 is a reply to message #467945] Sat, 26 May 2012 00:12 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
JFW_Poke_Play_2D_Sound_Player is kind of what you want, though it takes a sound preset and not a sound file. If you want to play a sound file you'll need to make a new script to do it.

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 - )
Re: It's there a Grant Power Up script? [message #468002 is a reply to message #467945] Sat, 26 May 2012 00:44 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

That wont work, it give's an error saying attach script can't have 4 arguments....

Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[Updated on: Sat, 26 May 2012 01:02]

Report message to a moderator

Re: It's there a Grant Power Up script? [message #468006 is a reply to message #467945] Sat, 26 May 2012 02:54 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
You need to attach the arguments to a script to the last argument of Attach_Script_Once() and related functions, if a script has more than one arguments you need to do something like:

Attach_Script_Once(obj, "script_name", "1024,derp,4.5");


where 1024 is an int, derp is a string and 4.5 is a float. In most cases you want to supply a "params" char buffer that contains the arguments formatted with a sprintf before hand, like so:

			char params[256];
			sprintf(params,"%d,%s,%s,%s,%s,%s",param,Get_Parameter("Underwater_Effect_Controller"),Get_Parameter("Surface_Water_Effect"),Get_Parameter("Underwater_Effect"),Get_Parameter("Surface_Swim_Sound"),Get_Parameter("Underwater_Swim_Sound"));
			Attach_Script_Once(sender,"JMG_Swimming_Water_Effects_Script",params);


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Sat, 26 May 2012 02:55]

Report message to a moderator

Re: It's there a Grant Power Up script? [message #468024 is a reply to message #467945] Sat, 26 May 2012 09:59 Go to previous message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

That makes a lot of sense thank you for explaining it to a n00b ;p

Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Previous Topic: Hand of Nod WIP
Next Topic: Need help please
Goto Forum:
  


Current Time: Tue Jul 02 01:27:16 MST 2024

Total time taken to generate the page: 0.00865 seconds