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:05 PM #29
Blackstorm
Veni. Vidi. Vici.
Originally posted by x. View Post
There is a very obvious reason why this won't do what he thinks it will do as well... Cool Man (aka Tustin)

---------- Post added at 05:33 PM ---------- Previous post was at 05:32 PM ----------

Good luck arguing with Blackstorm on this one Happy



I think we're both thinking of the same one, it is one loopy error :lol:

Jk that was lame, but it has to do with a loop, yes? Winky Winky

---------- Post added at 11:05 AM ---------- Previous post was at 11:04 AM ----------

Originally posted by IELIITEMODZX View Post
its not 25 unique strings lol its much more then that Happy
Are you sure about that? :p
02-11-2012, 06:09 PM #30
Originally posted by Blackstorm View Post
I think we're both thinking of the same one, it is one loopy error :lol:

Jk that was lame, but it has to do with a loop, yes? Winky Winky

---------- Post added at 11:05 AM ---------- Previous post was at 11:04 AM ----------



Yes, Loops, waits and entity numbers... Winky Winky
02-11-2012, 06:11 PM #31
Blackstorm
Veni. Vidi. Vici.
Originally posted by x. View Post
Yes, Loops, waits and entity numbers... Winky Winky


Point is this function was not well thought out before posted lol :p

The following user thanked Blackstorm for this useful post:

02-11-2012, 06:14 PM #32
Default Avatar
Newelly
Guest
Originally posted by Blackstorm View Post
Point is this function was not well thought out before posted lol :p

Just because you know everything doesn't mean we do :fa:

































:carling:
02-11-2012, 06:24 PM #33
Blackstorm
Veni. Vidi. Vici.
Originally posted by Newelly View Post
Just because you know everything doesn't mean we do :fa:

































:carling:


I wish I knew everything, but if you're being confident that something is useful, or good, or that it works, you gotta make sure it actually does work the way it's suppose to :p

The following user thanked Blackstorm for this useful post:

02-11-2012, 06:27 PM #34
d7w7z
Bounty hunter
Originally posted by x. View Post
There is a very obvious reason why this won't do what he thinks it will do as well... Cool Man (aka Tustin)


The fact that he calls the thread when any person first spawns, when he really should only call it when the host first spawns. He will have like 10+ StringCheck functions running at once making level.string["count"] rise 10+ times faster than it should.

As above, by calling the thread multiple times, he resets level.string["count"] everytime a person connects and picks a class.

The iPrintln will only display to one player and only that player will have their controls frozen.


Just some I found looking at it Smile
I don't get why he doesn't just use level notify and level waittill_any even tho he knows the level can call functions... Moo
02-11-2012, 06:39 PM #35
Blackstorm
Veni. Vidi. Vici.
Originally posted by d7w7z View Post
The fact that he calls the thread when any person first spawns, when he really should only call it when the host first spawns. He will have like 10+ StringCheck functions running at once making level.string["count"] rise 10+ times faster than it should.

As above, by calling the thread multiple times, he resets level.string["count"] everytime a person connects and picks a class.

The iPrintln will only display to one player and only that player will have their controls frozen.


Just some I found looking at it Smile
I don't get why he doesn't just use level notify and level waittill_any even tho he knows the level can call functions... Moo


You also forgot some other things, like that using waittill completely puts the loop to a halt until that player would notify one of those strings. Also that he forgot the array ["count"] in the if statement, and since level.string is an array, it will return undefined and it will return true and thus making it restart the menu everytime the host would open the menu :O
02-11-2012, 06:44 PM #36
Originally posted by Blackstorm View Post
I think we're both thinking of the same one, it is one loopy error :lol:

Jk that was lame, but it has to do with a loop, yes? Winky Winky

---------- Post added at 11:05 AM ---------- Previous post was at 11:04 AM ----------

Are you sure about that? :p


emmm yes :p i use more then 25 and it still works :/
02-11-2012, 06:53 PM #37
Blackstorm
Veni. Vidi. Vici.
Originally posted by IELIITEMODZX View Post
emmm yes :p i use more then 25 and it still works :/


In CoD4? I know Mw2 you can set 400 unique strings..

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo