Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    PS3 Modder
    PS3 Sniper

    Join Date
    Aug 2011
    Posts
    717
    Points
    317
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Posts
    717
    Points
    317
    Gamer IDs

    PSN ID: xMATRIX_22x

    Contact info:

    Youtube Channel: http://www.youtube.com/ItzMatriix

    Question Why is this script giving bad syntax

    i have no idea why this script is giving me bad syntax

    Code:
    //This is where the variable is
    userVars()
    {
              self.RPG = 1;
    }
    
    //Here is give rpg script
    doRPG()
    {
              switch( self.RPG )
              {
                         case 0:
                                   self GiveWeapon( "rpg_mp" );
                                   wait 1;
                                   self iPrintln( "Uses: 1" );
                                   wait 1;
                                   self.RPG++;
                                   break;
                         case 1:
                                   self GiveWeapon( "rpg_mp" );
                                   wait 1;
                                   self iPrintln( "Uses: 2" );
                                   wait 1;
                                   self.RPG++;
                                   break;
                         case 2:
                                   self GiveWeapon( "rpg_mp" );
                                   wait 1;
                                   self iPrintln( "Uses: 3" );
                                   wait 1;
                                   self.RPG++;
                                   break;
                         case 3:
                                   self iPrintlnBold( "No More Uses Availible..." );
                                   break;
              }
    }
    have any ideas?

    0 Not allowed! Not allowed!
    http://www.youtube.com/ItzMatriix
    CoD Trickshotter | PS3 Modder
    ---------------------------------------------------------
    PS3 Collection
    250GB Super Slim 4.60 OFW
    320GB Slim 4.50ITA DEX CFW

  2. #2
    Formally known as Tlpwnzer KazzababeGamer's Avatar
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427
         User Info     Contact     Gamer ID
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427

    Default

    With a quick glance, I dont see anything obvious.
    Try adding a "default" case to your switch statement.

    0 Not allowed! Not allowed!

  3. #3
    PS3 Modder
    PS3 Sniper

    Join Date
    Aug 2011
    Posts
    717
    Points
    317
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Posts
    717
    Points
    317
    Gamer IDs

    PSN ID: xMATRIX_22x

    Contact info:

    Youtube Channel: http://www.youtube.com/ItzMatriix

    Default

    Quote Originally Posted by Kazzababe View Post
    With a quick glance, I dont see anything obvious.
    Try adding a "default" case to your switch statement.
    ok. ill try.

    and i also tried this
    Code:
    doRPG()
    {
              if( self.RPG == 1 )
              {
                        self GiveWeapon( "rpg_mp" );
                        wait 1;
                        self iPrintln( "Uses: 1" );
                        wait 1;
                        self.RPG = 2;
              }
              else if( self.RPG == 2 )
              {
                        self GiveWeapon( "rpg_mp" );
                        wait 1;
                        self iPrintln( "Uses: 2" );
                        wait 1;
                        self.RPG = 3;
              }
              else if( self.RPG == 3 )
              {
                        self GiveWeapon( "rpg_mp" );
                        wait 1;
                        self iPrintln( "Uses: 3" );
                        wait 1;
                        self.RPG = 4;
              }
              else if( self.RPG == 4 )
              {
                        self iPrintlnBold( "Used Too Many Times" );
              }
    }

    0 Not allowed! Not allowed!
    Last edited by ItzMatriix; 10-22-2012 at 12:12 PM. Reason: forgot [code]
    http://www.youtube.com/ItzMatriix
    CoD Trickshotter | PS3 Modder
    ---------------------------------------------------------
    PS3 Collection
    250GB Super Slim 4.60 OFW
    320GB Slim 4.50ITA DEX CFW

  4. #4
    Formally known as Tlpwnzer KazzababeGamer's Avatar
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427
         User Info     Contact     Gamer ID
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427

    Default

    Quote Originally Posted by [email protected] View Post
    ok. ill try.

    and i also tried this
    Code:
    doRPG()
    {
              if( self.RPG == 1 )
              {
                        self GiveWeapon( "rpg_mp" );
                        wait 1;
                        self iPrintln( "Uses: 1" );
                        wait 1;
                        self.RPG = 2;
              }
              else if( self.RPG == 2 )
              {
                        self GiveWeapon( "rpg_mp" );
                        wait 1;
                        self iPrintln( "Uses: 2" );
                        wait 1;
                        self.RPG = 3;
              }
              else if( self.RPG == 3 )
              {
                        self GiveWeapon( "rpg_mp" );
                        wait 1;
                        self iPrintln( "Uses: 3" );
                        wait 1;
                        self.RPG = 4;
              }
              else if( self.RPG == 4 )
              {
                        self iPrintlnBold( "Used Too Many Times" );
              }
    }
    Check your other code, I'm not seeing any problems here.

    0 Not allowed! Not allowed!

  5. #5
    ✝ Pursuit of Happiness ✝ Sh0x's Avatar

    Badge

    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,838
    Points
    3,175
         User Info     Contact     Gamer ID
    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,838
    Points
    3,175
    Gamer IDs

    Gamertag: iiSh0x

    Contact info:

    Youtube Channel: http://www.youtube.com/zSh0x

    Default

    Probably better for you to use if and else statements.

    0 Not allowed! Not allowed!





  6. #6
    PS3 Modder
    PS3 Sniper

    Join Date
    Aug 2011
    Posts
    717
    Points
    317
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Posts
    717
    Points
    317
    Gamer IDs

    PSN ID: xMATRIX_22x

    Contact info:

    Youtube Channel: http://www.youtube.com/ItzMatriix

    Default

    Quote Originally Posted by x_zSh0x_x View Post
    Probably better for you to use if and else statements.
    i know. i was going to use those. but everytime i try to add those. even if i am SURE i am doing it correctly, i get bad syntax. so i am just trying different methods. i have every other part of my gametype working. just not the biggest part :/

    0 Not allowed! Not allowed!
    http://www.youtube.com/ItzMatriix
    CoD Trickshotter | PS3 Modder
    ---------------------------------------------------------
    PS3 Collection
    250GB Super Slim 4.60 OFW
    320GB Slim 4.50ITA DEX CFW

  7. #7
    ✝ Pursuit of Happiness ✝ Sh0x's Avatar

    Badge

    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,838
    Points
    3,175
         User Info     Contact     Gamer ID
    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,838
    Points
    3,175
    Gamer IDs

    Gamertag: iiSh0x

    Contact info:

    Youtube Channel: http://www.youtube.com/zSh0x

    Default

    I can help you out if you want me too.

    0 Not allowed! Not allowed!





  8. #8
    PS3 Modder
    PS3 Sniper

    Join Date
    Aug 2011
    Posts
    717
    Points
    317
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Posts
    717
    Points
    317
    Gamer IDs

    PSN ID: xMATRIX_22x

    Contact info:

    Youtube Channel: http://www.youtube.com/ItzMatriix

    Default

    Quote Originally Posted by Kazzababe View Post
    With a quick glance, I dont see anything obvious.
    Try adding a "default" case to your switch statement.
    Thank You!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    adding default case worked. now it should work with all of them.
    and just another question.

    is it ok to do self GiveWeapon with grenades and equipment?
    like
    Code:
              self GiveWeapon( "frag_grenade_mp" );
    or
              self GiveWeapon( "claymore_mp" );
    and i know those are the right things for then weapon

    0 Not allowed! Not allowed!
    http://www.youtube.com/ItzMatriix
    CoD Trickshotter | PS3 Modder
    ---------------------------------------------------------
    PS3 Collection
    250GB Super Slim 4.60 OFW
    320GB Slim 4.50ITA DEX CFW

  9. #9
    Banned
    Join Date
    May 2011
    Location
    ');DROP TABLE 'users';--
    Posts
    737
    Points
    1,710
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    ');DROP TABLE 'users';--
    Posts
    737
    Points
    1,710

    Default

    Things like this causes lots of frustration, I suggest slimming down your code to improve run time and to make it easier to spot syntax errors.
    Code:
    doRPG()
    {
      if( self.RPG >=0 && self.RPG < 3  )
      {
        self GiveWeapon( "rpg_mp" );
        self iPrintln( "Uses: " + self.RPG - 1 );
        self.RPG++;
      }
      else
        self iPrintlnBold( "No More Uses Availible..." );
    }
    The code above does the same thing (relatively, I think I had a pretty good understanding of what you were going after) as the switch statement, but with far less code.

    I didn't notice any syntax errors in the code you posted, however, you could be experiencing another error dealing with the variable 'RPG.' Make sure you initialize it before calling it.

    0 Not allowed! Not allowed!

  10. #10
    PS3 Modder
    PS3 Sniper

    Join Date
    Aug 2011
    Posts
    717
    Points
    317
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Posts
    717
    Points
    317
    Gamer IDs

    PSN ID: xMATRIX_22x

    Contact info:

    Youtube Channel: http://www.youtube.com/ItzMatriix

    Default

    Quote Originally Posted by Nity View Post
    Things like this causes lots of frustration, I suggest slimming down your code to improve run time and to make it easier to spot syntax errors.
    Code:
    doRPG()
    {
      if( self.RPG >=0 && self.RPG < 3  )
      {
        self GiveWeapon( "rpg_mp" );
        self iPrintln( "Uses: " + self.RPG - 1 );
        self.RPG++;
      }
      else
        self iPrintlnBold( "No More Uses Availible..." );
    }
    The code above does the same thing (relatively, I think I had a pretty good understanding of what you were going after) as the switch statement, but with far less code.

    I didn't notice any syntax errors in the code you posted, however, you could be experiencing another error dealing with the variable 'RPG.' Make sure you initialize it before calling it.
    Thanks alot. never would have thought of this. this will make my gametype alot slimmer

    0 Not allowed! Not allowed!
    http://www.youtube.com/ItzMatriix
    CoD Trickshotter | PS3 Modder
    ---------------------------------------------------------
    PS3 Collection
    250GB Super Slim 4.60 OFW
    320GB Slim 4.50ITA DEX CFW

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 10:17 PM.
Powered by vBulletin®
Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.