Results 1 to 10 of 10
  1. #1
    Evolved Modder
    Living Liek Larry
    tony's Avatar
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
    Gamer IDs

    PSN ID: L33T_T0ny Steam ID: ToNy Wii Code: L33T_T0ny

    Default [release] Round up function

    This is used to round a non-whole number into a whole number.

    you would use it like so.

    self.newvale = Round_it("5.7");

    this would make self.newvalue == 6

    Code:
    Round_it( number )
    {
    	numer = strtok( number, "." );
    	if( numer[1] >= 5 || numer[1] >= 50 || numer[1] >= 500 || numer[1] >= 5000 )
    	{
    		numer[0]++;
    	}
    	else
    	{
    		numer[0]--;
    	}
    	return (numer[0]);
    }

    0 Not allowed! Not allowed!

  2. #2
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    tony, do you mind teaching me about strtok? I have no idea how to use it and what it's used for.

    0 Not allowed! Not allowed!

  3. #3
    Evolved Modder
    Living Liek Larry
    tony's Avatar
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
    Gamer IDs

    PSN ID: L33T_T0ny Steam ID: ToNy Wii Code: L33T_T0ny

    Default

    Quote Originally Posted by MorderVonJuden View Post
    tony, do you mind teaching me about strtok? I have no idea how to use it and what it's used for.
    no problem ill sum it up real quik.

    numer = strtok( "option 1|option2|option3, "|" );

    the first part of strolok that i filled with option 1-3 are variables that are seperated by a symbol, it takes these options and adds it to a array

    so it would become
    numer[0] = "option1"
    numer[1] = "option 2'
    and so on, you can use any symbol as long as you specify that symbol in the last field ( "|" )

    0 Not allowed! Not allowed!

  4. #4
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Quote Originally Posted by tony View Post
    no problem ill sum it up real quik.

    numer = strtok( "option 1|option2|option3, "|" );

    the first part of strolok that i filled with option 1-3 are variables that are seperated by a symbol, it takes these options and adds it to a array

    so it would become
    numer[0] = "option1"
    numer[1] = "option 2'
    and so on, you can use any symbol as long as you specify that symbol in the last field ( "|" )
    I still don't get it..
    can you put a detailed tut up for me?

    0 Not allowed! Not allowed!
    Last edited by MorderVonJuden; 09-17-2012 at 01:57 PM.

  5. #5
    Evolved Modder
    Living Liek Larry
    tony's Avatar
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
    Gamer IDs

    PSN ID: L33T_T0ny Steam ID: ToNy Wii Code: L33T_T0ny

    Default

    Quote Originally Posted by MorderVonJuden View Post
    I still don't get it..
    can you put a detailed tut up for me?
    i will let me switch to my tablet

    0 Not allowed! Not allowed!

  6. #6
    Wii Coder
    ChumLee's Avatar

    Badge

    Join Date
    Apr 2011
    Location
    'Murica
    Posts
    5,383
    Points
    7,606
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    'Murica
    Posts
    5,383
    Points
    7,606
    Gamer IDs

    Gamertag: TERR0Rx9

    Contact info:

    Youtube Channel: http://www.youtube.com/user/HAXZingTERR0R

    Default

    Quote Originally Posted by MorderVonJuden View Post
    I still don't get it..
    can you put a detailed tut up for me?
    The character you put at the end of the strtok is used to separate the options in the first part of the strtok, so if I put strtok( "dicks/dicks1/dicks2", "/" ) then it says when "/" is found, separate array or something like that. It like creates arrays from a list and uses a symbol to separate them.

    0 Not allowed! Not allowed!

  7. #7
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Quote Originally Posted by tony View Post
    i will let me switch to my tablet
    Thanks bud!

    0 Not allowed! Not allowed!

  8. #8
    http://xat.com/cleaker
    Dv0id's Avatar
    Join Date
    Aug 2012
    Location
    Taking a shit... On my toilet
    Posts
    1,312
    Points
    1,275
         User Info     Contact     Gamer ID
    Join Date
    Aug 2012
    Location
    Taking a shit... On my toilet
    Posts
    1,312
    Points
    1,275
    Gamer IDs

    Wii Code: 3213-373-1827

    Default

    This will also help me too because I know very little of this.

    0 Not allowed! Not allowed!
    #SOTW Second place
    More sigs here


    1. Clash Of Clans Hack *Working as of 10-3-14*
    2. To lazy to go to homepage? Click >HERE<

  9. #9
    Evolved Modder
    Living Liek Larry
    tony's Avatar
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
    Gamer IDs

    PSN ID: L33T_T0ny Steam ID: ToNy Wii Code: L33T_T0ny

    Default Re: [release] Round up function

    i posted the tutorial

    Sent from my Transformer TF101 using Tapatalk 2

    0 Not allowed! Not allowed!

  10. #10
    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

    This is a little script create by Killingdyl:
    Code:
    roundUp( floatVal ) 
    { 
            if ( int( floatVal ) != floatVal ) 
                    return int( floatVal+1 ); 
            else 
                    return int( floatVal ); 
    }
    It should return an integer and accept an integer for the parameter.

    0 Not allowed! Not allowed!

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:21 PM.
Powered by vBulletin®
Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.