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-11-2012, 06:58 PM #38
Originally posted by Blackstorm View Post
In CoD4? I know Mw2 you can set 400 unique strings..


yes cod4 :p its alot more than 25 its more like 150 or somthing
02-11-2012, 07:14 PM #39
Originally posted by IELIITEMODZX View Post
yes cod4 :p its alot more than 25 its more like 150 or somthing
Use a menu in search and destroy online. It overflows with a lot less than that..
02-11-2012, 07:32 PM #40
Originally posted by x. View Post
Use a menu in search and destroy online. It overflows with a lot less than that..


well on ffa and td its more than 25 defo Happy
02-23-2012, 12:36 PM #41
LightModz
League Champion
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 & 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.


does this work for cod6 aswel? :L
02-23-2012, 12:43 PM #42
Originally posted by LightModz View Post
does this work for cod6 aswel? :L
lol, it doesn't work for any cod. Read all the posts...

The following 2 users say thank you to x_DaftVader_x for this useful post:

Blackstorm, little_legz

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo