Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    [WhA]4FunPlayin's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    Not here
    Posts
    757
    Reputation
    8
    Thanks
    169
    My Mood
    Lonely

    [Release] Easy Text Functions \w No Overflows/Crashes

    These are functions, not a gametype, don't ask how to play or where are the files.

    This is really good and easy to use, best of all no overflows

    Few examples:


    Functions for creating text:
    Code:
    createText(TextID, Text, textSize, Place1, Place2, offset1, offset2)
    destroyText(TextID)
    renameText(TextID, Text)
    replaceText(TextID, Place1, Place2, offset1, offset2)
    resizeText(TextID, newFont)
    Code:
    createText(TextID, Text, textSize, Place1, Place2, offset1, offset2)
    TextID - must be different each time you create text, it's the ID for the text.
    Text - the text itself
    testSize - basically text size
    Place1 - place, where at? "TOP", "CENTER" etc
    place2 - same
    offset1 - offset?
    offset2 - same

    Code:
    destroyText(TextID)
    The text ID to be destroyed.

    Code:
    renameText(TextID, Text)
    TextID - the text ID to rename
    Text - new text

    Code:
    replaceText(TextID, Place1, Place2, offset1, offset2)
    TextID - the text ID to put in new place
    place1/place2 - TOP/CENTER etc..
    offset1/2 - offset?

    Code:
    resizeText(TextID, newFont)
    TextID - the text ID to resize
    newFont - new size for the text

    Examples:
    Code:
    self thread createText(0, "^2Sup Dawg", 2.5, "CENTER", "CENTER", 50, 50);
    self thread createText(1, "^2I am cool", 2.5, "CENTER", "CENTER", 150, 150);
    wait 5;
    self thread renameText(0, "^1I AM AWESOME!");
    self thread renameText(1, "^5To bad.");
    self thread resizeText(1, 14);


    Functions for creating numbers (just like text, but use it if it's number only)
    Code:
    createNumber(NumberID, Number, numberSize, Place1, Place2, offset1, offset2, color)
    createNumber(NumberID, Number, numberSize, Place1, Place2, offset1, offset2, colorz)
    replaceNumber(NumberID, Place1, Place2, offset1, offset2)
    resizeNumber(NumberID, newFont)

    Code:
    createNumber(NumberID, Number, numberSize, Place1, Place2, offset1, offset2, color)
    NumberID - Must be different for each time you create it. Note: if you created a text with the same ID as the number, it wouldn't matter.
    Number - basically the number to write
    numberSize - number size
    Place1/2 - CENTER/TOP
    offset1/2 - offset
    color - the color itself. Note: must be a character, like "blue" or "green" and etc.

    Code:
    renameNumber(NumberID, Number, color)
    NumberID - the number ID to rename
    Number - new number to write
    color - the color itself. Note: must be a character, like "blue" or "green" and etc.

    Code:
    replaceNumber(NumberID, Place1, Place2, offset1, offset2)
    NumberID - the number ID to replace
    Place1/2 - CENTER/TOP etc
    offset1/2 - offset

    Code:
    resizeNumber(NumberID, newFont)
    NumberID - the number ID to resize
    newFont - new size for the number


    Examples:
    Code:
    self thread createNumber(0, 137, 2.5, "CENTER", "CENTER", 50, 50, "green");
    wait 5;
    self thread renameNumber(0, 1337, "red");
    self thread resizeNumber(0, 12);
    Things that you should know:

    1. If you use a number and a text, and both have the same ID, it won't matter.
    2. Just need to createText/Number without setting stuff blablabla.
    3. Text/Number will auto remove from screen when you die.


    https://pastebin.com/RnWfS8WJ

    Enjoy!

  2. The Following 10 Users Say Thank You to [WhA]4FunPlayin For This Useful Post:

    cgallagher21 (10-30-2010),chrisdavis97 (10-30-2010),JoeAbunga (10-30-2010),justas1234 (11-14-2010),Kingkiller272 (10-30-2010),Lemon30 (10-30-2010),MuLtiHuNTeR (10-31-2010),rkaf (10-31-2010),TheLynx (10-30-2010),TheSaboteur (10-31-2010)

  3. #2
    bomb21's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Unknown
    Posts
    57
    Reputation
    10
    Thanks
    22
    you wouldn't of posted this if you never looked in my mod :P

    none the less, gj

  4. #3
    [WhA]4FunPlayin's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    Not here
    Posts
    757
    Reputation
    8
    Thanks
    169
    My Mood
    Lonely
    setValue is from your mod only

  5. #4
    spiritwo's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Rochester, NY
    Posts
    709
    Reputation
    17
    Thanks
    76
    My Mood
    Happy
    wow really helpful, should be stickied
    --
    "Life is tough. It's tougher if you're stupid."

    Spiritwo |






  6. #5
    Dr.Ballsack's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    18
    Reputation
    10
    Thanks
    0
    My Mood
    Blah
    How will this help me? Honestly, please explain!

  7. #6
    [WhA]4FunPlayin's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    Not here
    Posts
    757
    Reputation
    8
    Thanks
    169
    My Mood
    Lonely
    • No overflows.
    • 1 line instead 3 to create a text.
    • can be used in any thread, it has an ID, so if you create it in _rank.gsc, you can remove it in _weapons.gsc, I mean can be used globally.
    • JUST EASIER K?

  8. #7
    candyface's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Right there.
    Posts
    194
    Reputation
    8
    Thanks
    34
    My Mood
    Psychedelic
    nice

  9. #8
    cgallagher21's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    1,627
    Reputation
    11
    Thanks
    325
    My Mood
    Angelic
    Yes Very helpful indeed
    /Sticky?
    /Thanked

  10. #9
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    32
    My Mood
    Goofy
    How about some prettier text?

  11. #10
    TheLynx's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Sverige
    Posts
    366
    Reputation
    10
    Thanks
    42
    My Mood
    Happy
    Quote Originally Posted by alistair4322 View Post
    How about some prettier text?
    Don't think its easy to do/possible

  12. #11
    [WhA]4FunPlayin's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    Not here
    Posts
    757
    Reputation
    8
    Thanks
    169
    My Mood
    Lonely
    Quote Originally Posted by alistair4322 View Post
    How about some prettier text?
    What is that

  13. #12
    shotyoudie's Avatar
    Join Date
    May 2009
    Gender
    female
    Posts
    119
    Reputation
    10
    Thanks
    6
    My Mood
    Angelic
    If u count up with numbers or something. and u count from 0 to 300 and it's not crashing it works. I'm going to test it thx !

  14. #13
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,668
    My Mood
    Breezy
    Here is a nice little way you can easy add this to a mod:
    1. Save the following as _textfunc.gsc and put it in maps\mp\gametypes:
    [php]#include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;

    createText(TextID, Text, textSize, Place1, Place2, offset1, offset2)
    {
    self.fastText = spawnstruct();

    game["strings"]["CustomText"][TextID] = Text;

    precacheString(game["strings"]["CustomText"][TextID]);

    self.fastText.ie[TextID] = game["strings"]["CustomText"][TextID];

    self.NewText[TextID] = self createFontString( "default", textSize );

    self.NewText[TextID] setPoint( Place1, Place2, offset1, offset2);

    self.NewText[TextID] setText(self.fastText.ie[TextID]);

    self thread destroyOnDeath(self.NewText[TextID]);
    }

    destroyText(TextID)
    {
    self.NewText[TextID] destroy();
    }

    renameText(TextID, Text)
    {
    self.fastText.ie[TextID] = Text;

    self.NewText[TextID] setText(self.fastText.ie[TextID]);
    }

    replaceText(TextID, Place1, Place2, offset1, offset2)
    {
    self.NewText[TextID] setPoint(Place1, Place2, offset1, offset2);
    }

    resizeText(TextID, newFont)
    {
    self.NewText[TextID].fontScale = newFont;
    }

    createNumber(NumberID, Number, numberSize, Place1, Place2, offset1, offset2, colorz)
    {
    self.fastNumber = spawnstruct();
    self.fastNumber.ie[NumberID] = Number;

    self.NewNumber[NumberID] = self createFontString( "default", numberSize );

    self.NewNumber[NumberID] setPoint( Place1, Place2, offset1, offset2);

    self.NewNumber[NumberID] setValue(Number);

    self thread destroyOnDeath(self.NewNumber[NumberID]);

    /*
    1, 0, 0 red
    0, 1, 0 green
    0, 0, 1 blue
    1, 1, 0 yellow
    1, 0, 1 pink
    0, 1, 1 cyan
    1, 1, 1 white
    0, 0, 0 black
    */

    switch(colorz)
    {
    case "red":
    self.NewNumber[NumberID].color = (1, 0, 0);
    break;

    case "green":
    self.NewNumber[NumberID].color = (0, 1, 0);
    break;

    case "blue":
    self.NewNumber[NumberID].color = (0, 0, 1);
    break;

    case "yellow":
    self.NewNumber[NumberID].color = (1, 1, 0);
    break;

    case "pink":
    self.NewNumber[NumberID].color = (1, 0, 1);
    break;

    case "cyan":
    self.NewNumber[NumberID].color = (0, 1, 1);
    break;

    case "white":
    self.NewNumber[NumberID].color = (1, 1, 1);
    break;

    case "black":
    self.NewNumber[NumberID].color = (0, 0, 0);
    break;

    default:
    self.NewNumber[NumberID].color = (1, 1, 1);
    break;
    }
    }

    renameNumber(NumberID, Number, colorz)
    {
    self.NewNumber[NumberID] setValue(Number);

    switch(colorz)
    {
    case "red":
    self.NewNumber[NumberID].color = (1, 0, 0);
    break;

    case "green":
    self.NewNumber[NumberID].color = (0, 1, 0);
    break;

    case "blue":
    self.NewNumber[NumberID].color = (0, 0, 1);
    break;

    case "yellow":
    self.NewNumber[NumberID].color = (1, 1, 0);
    break;

    case "pink":
    self.NewNumber[NumberID].color = (1, 0, 1);
    break;

    case "cyan":
    self.NewNumber[NumberID].color = (0, 1, 1);
    break;

    case "white":
    self.NewNumber[NumberID].color = (1, 1, 1);
    break;

    case "black":
    self.NewNumber[NumberID].color = (0, 0, 0);
    break;

    default:
    self.NewNumber[NumberID].color = self.NewNumber[NumberID].color;
    break;
    }
    }

    replaceNumber(NumberID, Place1, Place2, offset1, offset2)
    {
    self.NewNumber[NumberID] setPoint(Place1, Place2, offset1, offset2);
    }

    resizeNumber(NumberID, newFont)
    {
    self.NewNumber[NumberID].fontScale = newFont;
    }

    destroyOnDeath(obj)
    {
    self waittill("death");
    obj destroy();
    }
    [/php]

    2. At the start of the file you want to use these functions in, add this:
    [php]#include maps\mp\gametypes\_textfunc;[/php]

    Now you can use the text functions without making your GSC look messy!
    [php]self thread createText(0, "Yay, you are a genius!", 1, "TOPRIGHT", "TOPRIGHT", 0, -10)[/php]

    -----------------------------------
    You should allow an option to change the font (optional), something like this:
    [php]createText(TextID, Text, textSize, font, Place1, Place2, offset1, offset2)
    {
    self.fastText = spawnstruct();

    game["strings"]["CustomText"][TextID] = Text;

    precacheString(game["strings"]["CustomText"][TextID]);

    self.fastText.ie[TextID] = game["strings"]["CustomText"][TextID];

    if(isDefined(font))
    self.NewText[TextID] = self createFontString( font, textSize );
    else
    self.NewText[TextID] = self createFontString( "default", textSize );

    self.NewText[TextID] setPoint( Place1, Place2, offset1, offset2);

    self.NewText[TextID] setText(self.fastText.ie[TextID]);

    self thread destroyOnDeath(self.NewText[TextID]);
    }

    changeFont(NumberID, newFont)
    {
    self.NewNumber[NumberID].font = newFont;
    }
    [/php]

    Fonts:
    - default
    - bighud
    - bigfixed
    - hudbig
    - smallfixed
    - objective
    - arial
    Last edited by master131; 10-31-2010 at 03:07 AM.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  15. #14
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    32
    My Mood
    Goofy
    Quote Originally Posted by TheLynx View Post
    Don't think its easy to do/possible
    Change the font to arial

  16. #15
    zxz0O0's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    209
    Reputation
    10
    Thanks
    138
    My Mood
    Aggressive
    Nice release. But this will only work with numbers. If you use strings (text) it will overflow. Btw in your video the title is east text :P
    [YOUTUBE]Ja7-WnJcMcs[/YOUTUBE]

Page 1 of 2 12 LastLast

Similar Threads

  1. [RELEASE] Easy Image Brightener - To make your images look good
    By Shakugan no Shana in forum Combat Arms Mods & Rez Modding
    Replies: 51
    Last Post: 07-15-2010, 09:12 PM
  2. [RELEASE] Time & Date Function
    By Fabolous in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 26
    Last Post: 07-13-2010, 02:55 AM
  3. [RELEASE]EASY CAMO TUT
    By RedThunder in forum Combat Arms Mod Discussion
    Replies: 9
    Last Post: 06-26-2010, 09:22 PM
  4. Replies: 48
    Last Post: 10-29-2008, 10:21 PM
  5. [Release]Easy-Hide-Ip with keygen
    By XxeekXx in forum General
    Replies: 5
    Last Post: 10-12-2008, 05:33 PM