Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Zonked CoolGuyJones's Avatar
    Join Date
    Aug 2012
    Location
    Behind you
    Posts
    1,180
    Points
    898
         User Info     Contact     Gamer ID
    Join Date
    Aug 2012
    Location
    Behind you
    Posts
    1,180
    Points
    898
    Gamer IDs

    Gamertag: thatonedude19 PSN ID: CoolGuyJones420 Wii Code: Cannibal666

    Contact info:

    Kik Username: CannibalKush

    Default [TUT] Using Variables For 'Mods'

    i'm gonna do a tut on using variables, they are very important.
    i use them pretty much with every mod i make and are seen threw out everybody elses code too.
    lets start with how the variable is actully utilized.
    you can carry it out to a'player', the 'level', or your 'self'.

    here is a variable example.

    Code:
    example
    now we need to set 'example' to part of the game.

    lets use 'self'

    Code:
    self.example
    after that it needs to be identifiable as on or off, true or false, 1 or 0.

    i like to use it this way

    Code:
    self.example = "Off"
    or

    Code:
    self.example = "On"
    for this i will be using the 'off', you need a place to put it to ill do it like this cause i'm doing it for 'self'.

    Code:
    Spawnd()
    {
    	self thread SelfVars();
    }
    
    SelfVars()
    {
    	self.example = "Off";
    }
    now i have the variable setup and ready to go for any thing. ill be making a little something for this tut so lets start.

    Code:
    init()
    {
    	level.onPlayerKilled = ::onPlayerKilled;
    	level thread Spawnd();
    }
    
    Spawnd()
    {
    	self thread SelfVars();
    	//not adding the connect and bull shit, this is a tut
    }
    
    SelfVars()
    {
    	self.example = "Off";
    }
    
    onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration )
    {
    	if( self.example == "Off" )
    	{
    		if ( isDefined( attacker ) && isPlayer( attacker ) && self != attacker )
    		{
    			attacker.example = "On";
    			attacker thread Waepon( "minigun_mp" );
    		}
    	}
    }
    
    Waepon( gun )
    {
    	self endon( "death" );
    	for(;;)
    	{
    		if( self.example == "On" )
    		{
      			self GiveWeapon( gun, 0, self calcWeaponOptions( 10, 0, 0, 0, 0 ) );
      			self switchToWeapon( gun );
      			self giveMaxAmmo( gun );
    			self giveWeapon( "frag_grenade_mp" );
    		}
    		else if( self.example == "Off" )
    		{
    			self takeAllWeapons();
    			self giveWeapon( "m1911_mp" );
    			self giveWeapon( "frag_grenade_mp" );
    			self giveWeapon( "knife_mp" ); 	
    		}
    		wait 0.1;
    	}
    }
    yea i know thats whack as fuck but it was real fast just to show the variable in action. i did not test the script that is there do to it just being a example of a var being used.
    if you have any questions please comment and i will answer. thanks for using my tut.


    YES I KNOW I SUCK A TUT'S THATS WHY I'M DOING THEM. I NEED TO GET BETTER AT DOING THEM!

    0 Not allowed! Not allowed!

    Thanks for the sig/avatar Blacksun!
    #ChickenWildWings

  2. #2
    Rising Coder and Modder
    Rising Graphic Artist
    Griffy's Avatar

    Badge

    Join Date
    Jun 2012
    Location
    ▓░░░░ 1% Attempting to give a fuck...
    Posts
    666
    Points
    906
         User Info     Contact     Gamer ID
    Join Date
    Jun 2012
    Location
    ▓░░░░ 1% Attempting to give a fuck...
    Posts
    666
    Points
    906

    Default

    Nice Work!!

    0 Not allowed! Not allowed!



    ^Thanks to Tenza for the Sig^

  3. #3
    Zonked CoolGuyJones's Avatar
    Join Date
    Aug 2012
    Location
    Behind you
    Posts
    1,180
    Points
    898
         User Info     Contact     Gamer ID
    Join Date
    Aug 2012
    Location
    Behind you
    Posts
    1,180
    Points
    898
    Gamer IDs

    Gamertag: thatonedude19 PSN ID: CoolGuyJones420 Wii Code: Cannibal666

    Contact info:

    Kik Username: CannibalKush

    Default

    Thanks bro

    0 Not allowed! Not allowed!

    Thanks for the sig/avatar Blacksun!
    #ChickenWildWings

  4. #4
    Banned
    Join Date
    Jul 2013
    Location
    Trinidad&Tobago
    Posts
    325
    Points
    695
         User Info     Contact     Gamer ID
    Join Date
    Jul 2013
    Location
    Trinidad&Tobago
    Posts
    325
    Points
    695

    Default

    thx.lookin4ward to more tuts.

    0 Not allowed! Not allowed!

  5. #5
    Wii Code Creator
    T.U.F.F. PUPPY
    T.B.W's Avatar

    Badge

    Join Date
    Dec 2012
    Location
    Barcelona Spain
    Posts
    4,212
    Points
    6,669
         User Info     Contact     Gamer ID
    Join Date
    Dec 2012
    Location
    Barcelona Spain
    Posts
    4,212
    Points
    6,669

    Default

    nice work man. Keep it up

    0 Not allowed! Not allowed!

  6. #6
    Zonked CoolGuyJones's Avatar
    Join Date
    Aug 2012
    Location
    Behind you
    Posts
    1,180
    Points
    898
         User Info     Contact     Gamer ID
    Join Date
    Aug 2012
    Location
    Behind you
    Posts
    1,180
    Points
    898
    Gamer IDs

    Gamertag: thatonedude19 PSN ID: CoolGuyJones420 Wii Code: Cannibal666

    Contact info:

    Kik Username: CannibalKush

    Default

    ill be doing be more soon, glad you guys like it!

    0 Not allowed! Not allowed!

    Thanks for the sig/avatar Blacksun!
    #ChickenWildWings

  7. #7
    Rising Coder and Modder
    Rising Graphic Artist
    Griffy's Avatar

    Badge

    Join Date
    Jun 2012
    Location
    ▓░░░░ 1% Attempting to give a fuck...
    Posts
    666
    Points
    906
         User Info     Contact     Gamer ID
    Join Date
    Jun 2012
    Location
    ▓░░░░ 1% Attempting to give a fuck...
    Posts
    666
    Points
    906

    Default

    Looking forward to more tuts in the future.

    0 Not allowed! Not allowed!



    ^Thanks to Tenza for the Sig^

  8. #8
    Zonked CoolGuyJones's Avatar
    Join Date
    Aug 2012
    Location
    Behind you
    Posts
    1,180
    Points
    898
         User Info     Contact     Gamer ID
    Join Date
    Aug 2012
    Location
    Behind you
    Posts
    1,180
    Points
    898
    Gamer IDs

    Gamertag: thatonedude19 PSN ID: CoolGuyJones420 Wii Code: Cannibal666

    Contact info:

    Kik Username: CannibalKush

    Default

    Quote Originally Posted by Griffy View Post
    Looking forward to more tuts in the future.
    Any requests? lol

    0 Not allowed! Not allowed!

    Thanks for the sig/avatar Blacksun!
    #ChickenWildWings

  9. #9
    Rising Coder and Modder
    Rising Graphic Artist
    Griffy's Avatar

    Badge

    Join Date
    Jun 2012
    Location
    ▓░░░░ 1% Attempting to give a fuck...
    Posts
    666
    Points
    906
         User Info     Contact     Gamer ID
    Join Date
    Jun 2012
    Location
    ▓░░░░ 1% Attempting to give a fuck...
    Posts
    666
    Points
    906

    Default

    Quote Originally Posted by Cannibal666 View Post
    Any requests? lol
    Not at the moment but ill think of some.

    0 Not allowed! Not allowed!



    ^Thanks to Tenza for the Sig^

  10. #10
    Zonked CoolGuyJones's Avatar
    Join Date
    Aug 2012
    Location
    Behind you
    Posts
    1,180
    Points
    898
         User Info     Contact     Gamer ID
    Join Date
    Aug 2012
    Location
    Behind you
    Posts
    1,180
    Points
    898
    Gamer IDs

    Gamertag: thatonedude19 PSN ID: CoolGuyJones420 Wii Code: Cannibal666

    Contact info:

    Kik Username: CannibalKush

    Default

    Quote Originally Posted by Griffy View Post
    Not at the moment but ill think of some.
    K just tell me when you got something and ill do it.

    0 Not allowed! Not allowed!

    Thanks for the sig/avatar Blacksun!
    #ChickenWildWings

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 11:53 AM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.