Post: [Release] - String Check, Prevents Future Overflows!
02-07-2012, 01:05 AM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); this it a very quick script i made, very usefull to.
basically what it does, it checks every player for every time a SetText is set and counts it.

the maximum strings to be set is something like 374, but i made it 350 just incase.
you will need to do some tweeks to your menu, but they are very simple.

add this to your open menu code & sub menus.
    
self notify( "menu_open" );


add this to any of your welcome messages, only custom oldNotifyMessage's.
    
self notify( "oldNotify" );


and also add this to any custom text you have, such as doHearts.
    
self notify( "custom_text" );


now you want to thread this on spawn, thread it once.. so above the for statement onPlayerSpawned.
here's an example incase you get confused.
    
onPlayerSpawned()
{
[COLOR="#FF0000"]level thread StringCheck();[/COLOR]
for(;Winky Winky
{
self waittill( "spawned_player" );
// DO NOT THREAD IT HERE!
if(!isdefined(self.hud_rankscroreupdate))
{
self.hud_rankscroreupdate = newClientHudElem(self);
self.hud_rankscroreupdate.horzAlign = "center";
self.hud_rankscroreupdate.vertAlign = "middle";
self.hud_rankscroreupdate.alignX = "center";
self.hud_rankscroreupdate.alignY = "middle";
self.hud_rankscroreupdate.x = 0;
self.hud_rankscroreupdate.y = -60;
self.hud_rankscroreupdate.font = "default";
self.hud_rankscroreupdate.fontscale = 2.0;
self.hud_rankscroreupdate.archived = false;
self.hud_rankscroreupdate.color = ( randomFloat(1), randomFloat(1), randomFloat(1));
self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
}
}
}


if you dont know what ive done there i've added
    
[COLOR="#FF0000"]level thread StringCheck();[/COLOR]


and now you want to add this somewhere.
    
StringCheck()
{
for( level.string["count"] = 0;; )
{
for( x=0; x<level.players.size; x++ )
{
level.players[x] waittill_any( "menu_open", "oldNotify", "custom_text" );
level.string["count"]++;
if( level.string >= 350 )
{
level.players[x] iPrintln( "^1Game is restarting due to a high string count!" );
level.players[x] freezeControls( true );
wait 1;
map_restart( false );
}
}
wait .5;
}
}


this is very useful, although you may think you menu's dont overflow.. they actually will after so long.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 7 users say thank you to Correy for this useful post:

Woof, DlBSY993, iPROFamily, Jeremy, Cmd-X, Taylor
02-07-2012, 01:09 AM #2
DlBSY993
There's 0nly 1..
Originally posted by Correy View Post
this it a very quick script i made, very usefull to.
basically what it does, it checks every player for every time a SetText is set and counts it.

the maximum strings to be set is something like 374, but i made it 350 just incase.
you will need to do some tweeks to your menu, but they are very simple.

add this to your open menu code.
    
self notify( "menu_open" );


add this to any of your welcome messages, only custom oldNotifyMessage's.
    
self notify( "oldNotify" );


and also add this to any custom text you have, such as doHearts.
    
self notify( "custom_text" );


now you want to thread this on spawn, thread it once.. so above the for statement onPlayerSpawned.
here's an example incase you get confused.
    
onPlayerSpawned()
{
[COLOR="#FF0000"]level thread StringCheck();[/COLOR]
for(;Winky Winky
{
self waittill( "spawned_player" );
// DO NOT THREAD IT HERE!
if(!isdefined(self.hud_rankscroreupdate))
{
self.hud_rankscroreupdate = newClientHudElem(self);
self.hud_rankscroreupdate.horzAlign = "center";
self.hud_rankscroreupdate.vertAlign = "middle";
self.hud_rankscroreupdate.alignX = "center";
self.hud_rankscroreupdate.alignY = "middle";
self.hud_rankscroreupdate.x = 0;
self.hud_rankscroreupdate.y = -60;
self.hud_rankscroreupdate.font = "default";
self.hud_rankscroreupdate.fontscale = 2.0;
self.hud_rankscroreupdate.archived = false;
self.hud_rankscroreupdate.color = ( randomFloat(1), randomFloat(1), randomFloat(1));
self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
}
}
}


if you dont know what ive done there i've added
    
[COLOR="#FF0000"]level thread StringCheck();[/COLOR]


and now you want to add this somewhere.
    
StringCheck()
{
for( level.string = 0;; )
{
for( x=0; x<level.players.size; x++ )
{
level.players[x] waittill_any( "menu_open", "oldNotify", "custom_text" );
level.string++;
if( level.string >= 350 )
{
level.players[x] iPrintln( "^1Game is restarting due to a high string count!" );
level.players[x] freezeControls( true );
wait 1;
map_restart( false );
}
}
wait .5;
}
}


this is very useful, although you may think you menu's dont overflow.. they actually will after so long.


Nice Job curry Winky Winky This is simple but clever .. as soon as it hits 350 strings it restarts .. Didn't the unkn0wn's patch have something like this from mw2?
02-07-2012, 01:11 AM #3
Correy
I'm the Original
Originally posted by DlBSY993 View Post
Nice Job curry Winky Winky This is simple but clever .. as soon as it hits 350 strings it restarts .. Didn't the unkn0wn's patch have something like this from mw2?


im not sure, never really looked at his patch.. i was a 'nooob' as everyone calls it when MW2 modding was popular :p
02-07-2012, 01:13 AM #4
DlBSY993
There's 0nly 1..
Originally posted by Correy View Post
im not sure, never really looked at his patch.. i was a 'nooob' as everyone calls it when MW2 modding was popular :p


Haha you are a "noooob" :derp: But when i tested his patch a few times it randomly restarted .. Maybe had something similar in his patch to stop a crash. But it's very useful Smile
02-07-2012, 01:15 AM #5
Choco
Respect my authoritah!!
Nice, I never manage to overflow my patch unless I have 2+ people verified :p I might use this :y:
02-07-2012, 01:17 AM #6
Correy
I'm the Original
Originally posted by DlBSY993 View Post
Haha you are a "noooob" :derp: But when i tested his patch a few times it randomly restarted .. Maybe had something similar in his patch to stop a crash. But it's very useful Smile


i dont know why anyone thought of this anyway aha, but at least your menu's wont overflow..

---------- Post added at 01:17 AM ---------- Previous post was at 01:15 AM ----------

Originally posted by .Choco View Post
Nice, I never manage to overflow my patch unless I have 2+ people verified :p I might use this :y:


i got something else aswell, but i'm testing that.. its a much more advanced way, it gives each player which is verified a string limit.. but that will mean they can only open the menu a certain amount of times :whistle:
02-07-2012, 01:17 AM #7
Correy
I'm the Original
stupid double postings.
02-07-2012, 01:17 AM #8
DlBSY993
There's 0nly 1..
Originally posted by Correy View Post
i dont know why anyone thought of this anyway aha, but at least your menu's wont overflow..


Better speak to vader about overflow .. Dont tell him but i was in his lobby the over day on district and HIS MENU OVERFLOWED !! :shh: I was like "NOOOOOOB!"
02-07-2012, 01:19 AM #9
Correy
I'm the Original
Originally posted by DlBSY993 View Post
Better speak to vader about overflow .. Dont tell him but i was in his lobby the over day on district and HIS MENU OVERFLOWED !! :shh: I was like "NOOOOOOB!"


well this script will be useful for him Happy
02-07-2012, 01:44 AM #10
oG-Modder
Do a barrel roll!
Good Job "Curry" lol i will be using this

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo