Post: Overflow Fix
11-02-2014, 11:38 PM #1
TheFallen
Former Dark Night
(adsbygoogle = window.adsbygoogle || []).push({}); Overflow Fix
An easy to implement way of preventing any string overflows.

Introduction

Make sure to read the entire thread before attempting to use otherwise there may be issues with it not working properly.

Usage

First get the source from You must login or register to view this content.. You are going to need everything in here so do not try to edit it or remove things as it will most likely cause issues. To use this you must first call initOverflowFix() once in onPlayerSpawned(). You must only call this once for each player otherwise there will be problems.
    
onPlayerSpawned()
{
self endon("disconnect");
level endon( "game_ended" );

// YOU MUST HAVE THIS
isFirstSpawn = true;


for(;Winky Winky
{
self waittill("spawned_player");

// YOU MUST HAVE THIS
// only runs once when the player spawns for the first time
if(isFirstSpawn)
{
initOverFlowFix();

isFirstSpawn = false;
}
}
}


Creating Text

When creating text make sure to use my createText function or if you would rather use your own you must have these three lines at the bottom just before the return statement:
    
// textElem is the name of the object you defined with createFontString()
// view my createText function for an example
textElem.type = "text";
addTextTableEntry(textElem, getStringId(text));
textElem setSafeText(self, text);

You must do this for every text element you use otherwise it will result in an overflow.

Setting Text

When setting text make sure to call setSafeText(<player>, <text>Winky Winky instead of setText(<text>Winky Winky. If you do not do this it will result in an overflow. To use setSafeText() you must call it like so:
    
// textElement is the text element you wish to set text for. This is the object you would normally call setText() on.
// self is the player object you wish to set text for. If you don't know what this is just use self.
textElement setSafeText(self, "text");


Destroying Text

When destroying text you must call clear(<player>Winky Winky instead of destroy(). Clear takes one argument and that is the player that the text element belongs to. If you don't know what I mean by that just use self.
    
textElement clear(self);


Simple Example by Exelo
You can view an example of how to use this You must login or register to view this content..

Real Menu Examples
(adsbygoogle = window.adsbygoogle || []).push({});

The following 33 users say thank you to TheFallen for this useful post:

AlexNGU, Bigmoneyhustlin, BossamBemass, canadiancaper, Chris, codybenti, Devilemi, FatalityMods, Full-Evil, HiddenHour, Im Not Boobdidas, Krypton, Dzre-, LegitGamer264, Magnate13Snake, ModernTriicks, Nothingbutbread, Obris, Patrick, RTE, SaberNGU, ScaRzModZ, Script Kiddie, Shark, Dacoco, SnaY, Taylor, SyGnUs, ViRuzModzHD, xePixTvx, xJessex, xKasper, Zambie
11-09-2014, 07:07 PM #11
TheFallen
Former Dark Night
Originally posted by ybnice1234779 View Post
This will stop freezes and such?


No, it keeps your menu from crashing in game because of strings.
11-09-2014, 10:18 PM #12
koekblik2
Do a barrel roll!
did you already found the thing in my menu? that made it overflow?
o and please add me on skype so we can talk better haha :P
skype: fabianmicha
11-12-2014, 03:56 AM #13
TheFallen
Former Dark Night
Found a small conflict with monitoring strings and adding a string. Should be fixed now.
11-15-2014, 05:14 AM #14
Turk_Warrior
League Champion
Originally posted by TheFallen View Post
Overflow Fix
An easy to implement way of preventing any string overflows.

Introduction

Make sure to read the entire thread before attempting to use otherwise there may be issues with it not working properly.

Usage

First get the source from You must login or register to view this content.. You are going to need everything in here so do not try to edit it or remove things as it will most likely cause issues. To use this you must first call initOverflowFix() once in onPlayerSpawned(). You must only call this once for each player otherwise there will be problems.
    
onPlayerSpawned()
{
self endon("disconnect");
level endon( "game_ended" );

// YOU MUST HAVE THIS
isFirstSpawn = true;


for(;Winky Winky
{
self waittill("spawned_player");

// YOU MUST HAVE THIS
// only runs once when the player spawns for the first time
if(isFirstSpawn)
{
initOverFlowFix();

isFirstSpawn = false;
}
}
}


Creating Text

When creating text make sure to use my createText function or if you would rather use your own you must have these three lines at the bottom just before the return statement:
    
// textElem is the name of the object you defined with createFontString()
// view my createText function for an example
textElem.type = "text";
addTextTableEntry(textElem, getStringId(text));
textElem setSafeText(self, text);

You must do this for every text element you use otherwise it will result in an overflow.

Setting Text

When setting text make sure to call setSafeText(<player>, <text>Winky Winky instead of setText(<text>Winky Winky. If you do not do this it will result in an overflow. To use setSafeText() you must call it like so:
    
// textElement is the text element you wish to set text for. This is the object you would normally call setText() on.
// self is the player object you wish to set text for. If you don't know what this is just use self.
textElement setSafeText(self, "text");


Destroying Text

When destroying text you must call clear(<player>Winky Winky instead of destroy(). Clear takes one argument and that is the player that the text element belongs to. If you don't know what I mean by that just use self.
    
textElement clear(self);


Simple Example by Exelo
You can view an example of how to use this You must login or register to view this content..

Real Menu Examples


i just put the overflow fix in it worked no errors but i cant verify my friends
when i die i lose the mod menu why lol
11-16-2014, 04:48 AM #15
Bigmoneyhustlin
Can’t trickshot me!
nice thread man...
can someone here plz tell me if my problem is like the overflow problem?
never had overflow problem but mine is basic base and works great.
only thing is didnt know if the script can cause of lag cuz of pre verified names or sloppy code or like this a code repeat....
with this code from thread it sure looks like my pre varified list should be like this 2 prevent problems cuz if i host games without gsc
it shows 4 bars 4 everyone but with gsc only verified players 4 bar and most others have 3 bar connection
11-19-2014, 04:24 AM #16
ViggyYT
Little One
Awesome
11-22-2014, 02:51 PM #17
Adrian
Adrian is back!
thanx gonna help me alot
01-27-2015, 02:36 PM #18
Patrick
League Champion
after i have put the overflow fix into my menu my menu always freezes in mid game can someone help me?
01-29-2015, 09:46 PM #19
alexjones1009
Bounty hunter
care to message me on Skype? I don't know how to exactly put this coding into my GSC menu I know every other code just this exact code d: Tustin

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo