Question How to add an overflow fix to a GSC Call of Duty: Black Ops 2 mod menu?

rui vieira

Insane-Known Member
Messages
10
Points
358
hello can anyone help me do a overflow fix script for this menu thanks
 

Attachments

amand

Known Member
Messages
12
Points
118
Add This Code In A New Script.GSC :


Code:
//credits to YouViolateMe
recreateText()
{
    self endon("disconnect");
    self endon("death");

    input = self.CurMenu;
    title = self.CurTitle;
   
    self thread submenu(input, title);
}

//Credits to dtx12, jwm614, and xTurntUpLobbies
overflowfix()
{
    level endon("game_ended");

    level.test = createServerFontString("default",1.5);
    level.test setText("xTUL");          
    level.test.alpha = 0;
 
    for(;;)
    {
        level waittill("textset");
        if(level.result >= 50)
        {
                level.test ClearAllTextAfterHudElem();
                level.result = 0;

        foreach(player in level.players)
            {
                if(player.menu.open == true)
                {
                    player recreateText();
                }
            }
        }
        wait 0.01;
    }
}
If You Always Come Not Click This Links :

You do not have permission to view link Log in or register now.


Or

You do not have permission to view link Log in or register now.
 
Last edited:

Iwau

Well-Known Member
Messages
91
Points
238
hello can anyone help me do a overflow fix script for this menu thanks
Srry I was late
initOverFlowFix()
{
// tables
self.stringTable = [];
self.stringTableEntryCount = 0;
self.textTable = [];
self.textTableEntryCount = 0;

if(isDefined(level.anchorText) == false)
{
level.anchorText = createServerFontString("default",1.5);
level.anchorText setText("anchor");
level.anchorText.alpha = 0;

level.stringCount = 0;
level thread monitorOverflow();
}
}

// strings cache serverside -- all string entries are shared by every player
monitorOverflow()
{
level endon("disconnect");

for(;:wink:
{
if(level.stringCount >= 60)
{
level.anchorText clearAllTextAfterHudElem();
level.stringCount = 0;

foreach(player in level.players)
{
player purgeTextTable();
player purgeStringTable();
player recreateText();
}
}

wait 0.05;
}
}

setSafeText(player, text)
{
stringId = player getStringId(text);

// if the string doesn't exist add it and get its id
if(stringId == -1)
{
player addStringTableEntry(text);
stringId = player getStringId(text);
}

// update the entry for this text element
player editTextTableEntry(self.textTableIndex, stringId);

self setText(text);
}

recreateText()
{
foreach(entry in self.textTable)
entry.element setSafeText(self, lookUpStringById(entry.stringId));
}

addStringTableEntry(string)
{
// create new entry
entry = spawnStruct();
entry.id = self.stringTableEntryCount;
entry.string = string;

self.stringTable[self.stringTable.size] = entry; // add new entry
self.stringTableEntryCount++;
level.stringCount++;
}

lookUpStringById(id)
{
string = "";

foreach(entry in self.stringTable)
{
if(entry.id == id)
{
string = entry.string;
break;
}
}

return string;
}

getStringId(string)
{
id = -1;

foreach(entry in self.stringTable)
{
if(entry.string == string)
{
id = entry.id;
break;
}
}

return id;
}

getStringTableEntry(id)
{
stringTableEntry = -1;

foreach(entry in self.stringTable)
{
if(entry.id == id)
{
stringTableEntry = entry;
break;
}
}

return stringTableEntry;
}

purgeStringTable()
{
stringTable = [];

// store all used strings
foreach(entry in self.textTable)
stringTable[stringTable.size] = getStringTableEntry(entry.stringId);

self.stringTable = stringTable; // empty array
}

purgeTextTable()
{
textTable = [];

foreach(entry in self.textTable)
{
if(entry.id != -1)
textTable[textTable.size] = entry;
}

self.textTable = textTable;
}

addTextTableEntry(element, stringId)
{
entry = spawnStruct();
entry.id = self.textTableEntryCount;
entry.element = element;
entry.stringId = stringId;

element.textTableIndex = entry.id;

self.textTable[self.textTable.size] = entry;
self.textTableEntryCount++;
}

editTextTableEntry(id, stringId)
{
foreach(entry in self.textTable)
{
if(entry.id == id)
{
entry.stringId = stringId;
break;
}
}
}

deleteTextTableEntry(id)
{
foreach(entry in self.textTable)
{
if(entry.id == id)
{
entry.id = -1;
entry.stringId = -1;
}
}
}

clear(player)
{
if(self.type == "text")
player deleteTextTableEntry(self.textTableIndex);

self destroy();
}
 

Top