Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help uninitialised variable[SOLVED]
#1
Anyone know how to fix this problem?

[Image: 2011-07-02_00001.jpg]

here is the thread its in: http://pastebin.com/LndjjxuK
Quote: (report) SuperNovaAO - 03-03 23:34 -- Your mom's cunt also belongs to her private parts, yet everyone knows it.
(report) OrangePL - 03-03 23:34 -- And if you can't understand, this is called PRIVATE message
[Image: userbars.jpg]
My MW2 mod Group: http://steamcommunity.com/groups/davesmodzz
Reply

#2
forwardbuttonpressed is undefined, I think you want to know if someone is walking forward .. which afaik is not possible without checking his coordinates.
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#3
change it to if(usebuttonpressed())
[Image: lQDUjba.jpg]
Reply

#4
(07-02-2011, 20:55)OrangePL Wrote: change it to if(usebuttonpressed())

thanks man
Quote: (report) SuperNovaAO - 03-03 23:34 -- Your mom's cunt also belongs to her private parts, yet everyone knows it.
(report) OrangePL - 03-03 23:34 -- And if you can't understand, this is called PRIVATE message
[Image: userbars.jpg]
My MW2 mod Group: http://steamcommunity.com/groups/davesmodzz
Reply

#5
Sorry guys i got another problem

Black Ops sais there is a syntax error, everytime i have those 4 options "else if", if you know what i mean.
The 4 options proberly can't start with "else if"
You guys have any idea how to fix this and still have only 1 choice per spawn?

Code:
classmenu()

{
        else if ( !self ButtonPressed( "+actionslot 1" ) )
        {
            self takeAllWeapons();
                        self giveWeapon("tesla_gun_zm");
                        self giveWeapon("stg44_sp");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("tabun_gas_mp");
                        self giveWeapon("knife_mp");
                        self setPerk("specialty_movefaster");  
                        self setPerk("specialty_fallheight");
                        self setPerk("specialty_longersprint");  
                        self setPerk("specialty_unlimitedsprint");
                }

                else if ( !self ButtonPressed( "+actionslot 2" ) )
                {
            self takeAllWeapons();
                        self giveWeapon("thundergun_zm");
                        self giveWeapon("ppsh_sp");
            self setPerk("specialty_twogrenades");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("tabun_gas_mp");
                        self giveweapon("knife_mp");
                        self setPerk("specialty_movefaster");  
                        self setPerk("specialty_fallheight");
                        self setPerk("specialty_longersprint");  
                        self setPerk("specialty_unlimitedsprint");
                }

                else if ( !self ButtonPressed( "+actionslot 3" ) )
                {
            self takeAllWeapons();
                        self giveWeapon("ray_gun_zm");
                        self giveWeapon("sten_sp");
            self setPerk("specialty_twogrenades");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("tabun_gas_mp");
                        self giveweapon("knife_mp");
                        self setPerk("specialty_movefaster");  
                        self setPerk("specialty_fallheight");
                        self setPerk("specialty_longersprint");  
                        self setPerk("specialty_unlimitedsprint");
                }

                else if ( !self ButtonPressed( "+actionslot 4" ) )
                {
            self takeAllWeapons();
                        self giveWeapon("m16_acog_gl_extclip_mp");
                        self giveWeapon("commando_ir_mk_dualclip_silencer_mp");
                        self giveWeapon("l96a1_vzoom_extclip_mp");
                        self giveWeapon("cz75_upgradesight_extclip_silencer_mp");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("concussion_grenade_mp");
                        self giveWeapon("satchel_charge_mp");
                        self giveWeapon("knife_mp");
                        self setPerk("specialty_scavenger");  
                        self setPerk("specialty_extraammo");
                        self setPerk("specialty_fastreload");  
                        self setPerk("specialty_fastads");
                        self setPerk("specialty_gas_mask");  
                        self setPerk("specialty_showonradar");  
                        self setPerk("specialty_stunprotection");
                }
}
Quote: (report) SuperNovaAO - 03-03 23:34 -- Your mom's cunt also belongs to her private parts, yet everyone knows it.
(report) OrangePL - 03-03 23:34 -- And if you can't understand, this is called PRIVATE message
[Image: userbars.jpg]
My MW2 mod Group: http://steamcommunity.com/groups/davesmodzz
Reply

#6
You don't need the else if at start, only the if
Reply

#7
(07-03-2011, 11:09)Opel Wrote: You don't need the else if at start, only the if

that gets rid of the bad syntax,
but then it automaticly gives me the last class.

And i want to be able to choose one at spawn.
Quote: (report) SuperNovaAO - 03-03 23:34 -- Your mom's cunt also belongs to her private parts, yet everyone knows it.
(report) OrangePL - 03-03 23:34 -- And if you can't understand, this is called PRIVATE message
[Image: userbars.jpg]
My MW2 mod Group: http://steamcommunity.com/groups/davesmodzz
Reply

#8
Well try removing the ! from the conditions as you are saying
Code:
if ( !self ButtonPressed( "+actionslot 1" ) )
if the actionslot button isnt pressed,
etc


Reply

#9
Code:
classmenu()

{
        if ( self ButtonPressed( "+actionslot 1" ) )
        {
            self takeAllWeapons();
                        self giveWeapon("tesla_gun_zm");
                        self giveWeapon("stg44_sp");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("tabun_gas_mp");
                        self giveWeapon("knife_mp");
                        self setPerk("specialty_movefaster");  
                        self setPerk("specialty_fallheight");
                        self setPerk("specialty_longersprint");  
                        self setPerk("specialty_unlimitedsprint");
                }

                else if ( self ButtonPressed( "+actionslot 2" ) )
                {
            self takeAllWeapons();
                        self giveWeapon("thundergun_zm");
                        self giveWeapon("ppsh_sp");
            self setPerk("specialty_twogrenades");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("tabun_gas_mp");
                        self giveweapon("knife_mp");
                        self setPerk("specialty_movefaster");  
                        self setPerk("specialty_fallheight");
                        self setPerk("specialty_longersprint");  
                        self setPerk("specialty_unlimitedsprint");
                }

                else if ( self ButtonPressed( "+actionslot 3" ) )
                {
            self takeAllWeapons();
                        self giveWeapon("ray_gun_zm");
                        self giveWeapon("sten_sp");
            self setPerk("specialty_twogrenades");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("tabun_gas_mp");
                        self giveweapon("knife_mp");
                        self setPerk("specialty_movefaster");  
                        self setPerk("specialty_fallheight");
                        self setPerk("specialty_longersprint");  
                        self setPerk("specialty_unlimitedsprint");
                }

                else if ( self ButtonPressed( "+actionslot 4" ) )
                {
            self takeAllWeapons();
                        self giveWeapon("m16_acog_gl_extclip_mp");
                        self giveWeapon("commando_ir_mk_dualclip_silencer_mp");
                        self giveWeapon("l96a1_vzoom_extclip_mp");
                        self giveWeapon("cz75_upgradesight_extclip_silencer_mp");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("concussion_grenade_mp");
                        self giveWeapon("satchel_charge_mp");
                        self giveWeapon("knife_mp");
                        self setPerk("specialty_scavenger");  
                        self setPerk("specialty_extraammo");
                        self setPerk("specialty_fastreload");  
                        self setPerk("specialty_fastads");
                        self setPerk("specialty_gas_mask");  
                        self setPerk("specialty_showonradar");  
                        self setPerk("specialty_stunprotection");
                }
}
Reply

#10
(07-03-2011, 15:36)koil Wrote:
Code:
classmenu()

{
        if ( self ButtonPressed( "+actionslot 1" ) )
        {
            self takeAllWeapons();
                        self giveWeapon("tesla_gun_zm");
                        self giveWeapon("stg44_sp");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("tabun_gas_mp");
                        self giveWeapon("knife_mp");
                        self setPerk("specialty_movefaster");  
                        self setPerk("specialty_fallheight");
                        self setPerk("specialty_longersprint");  
                        self setPerk("specialty_unlimitedsprint");
                }

                else if ( self ButtonPressed( "+actionslot 2" ) )
                {
            self takeAllWeapons();
                        self giveWeapon("thundergun_zm");
                        self giveWeapon("ppsh_sp");
            self setPerk("specialty_twogrenades");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("tabun_gas_mp");
                        self giveweapon("knife_mp");
                        self setPerk("specialty_movefaster");  
                        self setPerk("specialty_fallheight");
                        self setPerk("specialty_longersprint");  
                        self setPerk("specialty_unlimitedsprint");
                }

                else if ( self ButtonPressed( "+actionslot 3" ) )
                {
            self takeAllWeapons();
                        self giveWeapon("ray_gun_zm");
                        self giveWeapon("sten_sp");
            self setPerk("specialty_twogrenades");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("tabun_gas_mp");
                        self giveweapon("knife_mp");
                        self setPerk("specialty_movefaster");  
                        self setPerk("specialty_fallheight");
                        self setPerk("specialty_longersprint");  
                        self setPerk("specialty_unlimitedsprint");
                }

                else if ( self ButtonPressed( "+actionslot 4" ) )
                {
            self takeAllWeapons();
                        self giveWeapon("m16_acog_gl_extclip_mp");
                        self giveWeapon("commando_ir_mk_dualclip_silencer_mp");
                        self giveWeapon("l96a1_vzoom_extclip_mp");
                        self giveWeapon("cz75_upgradesight_extclip_silencer_mp");
                        self giveWeapon("sticky_grenade_mp");
                        self giveWeapon("concussion_grenade_mp");
                        self giveWeapon("satchel_charge_mp");
                        self giveWeapon("knife_mp");
                        self setPerk("specialty_scavenger");  
                        self setPerk("specialty_extraammo");
                        self setPerk("specialty_fastreload");  
                        self setPerk("specialty_fastads");
                        self setPerk("specialty_gas_mask");  
                        self setPerk("specialty_showonradar");  
                        self setPerk("specialty_stunprotection");
                }
}

Ok that gets rid of the bad syntax, thanks.
but when i press one of those buttons nothing happens.
any idea?
Quote: (report) SuperNovaAO - 03-03 23:34 -- Your mom's cunt also belongs to her private parts, yet everyone knows it.
(report) OrangePL - 03-03 23:34 -- And if you can't understand, this is called PRIVATE message
[Image: userbars.jpg]
My MW2 mod Group: http://steamcommunity.com/groups/davesmodzz
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help [C#] WebClient how to know real url [solved] narkos 21 13,053 09-09-2013, 15:21
Last Post: surtek
Information Help How to edit new derived entry? (Solved) SSonic70 1 2,752 08-20-2013, 15:29
Last Post: Nekochan
  Help [solved]red hitmark mod? founderlj 7 4,785 12-30-2012, 23:06
Last Post: Pozzuh
  !weapon Plugin help pls [solved] Hallla 0 1,983 12-30-2012, 14:04
Last Post: Hallla
  Help !giveammo Plugin doesnt work [solved] Hallla 3 3,578 12-29-2012, 20:53
Last Post: Hallla
  Help OnPlayerConnect [Solved] 99IRock 4 4,145 11-18-2012, 10:07
Last Post: 99IRock
  Give Gun Error [SOLVED] koro35 4 3,926 11-17-2012, 15:15
Last Post: koro35
  Help Mw3 server error 2 [Solved] 99IRock 6 23,176 11-17-2012, 12:38
Last Post: 99IRock
  Help Mw3 server Error [Solved] 99IRock 3 4,755 11-16-2012, 07:38
Last Post: 99IRock
Information [Solved] Info about functions, events and etc. Nerus 2 2,520 09-09-2012, 20:57
Last Post: surtek

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.