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, 05:44 PM #20
Don't you mean
if( level.string["count"] >= 350 )
:carling:
02-07-2012, 05:57 PM #21
Originally posted by Badman.
Why don't you share it with us Mr.Know-it-all.

Also you never finished your reply, you said I should know something?
because last time i tried to correct an error in one of correy's posts it lead to a big row, even though i was right. I can't be bothered anymore..

The following user thanked x_DaftVader_x for this useful post:

Blackstorm
02-07-2012, 06:46 PM #22
Originally posted by Correy View Post
but that will mean they can only open the menu a certain amount of times :whistle:
you can set the same string as much as you want lolz, it still only counts as 1 string.
02-07-2012, 06:53 PM #23
xRaW
xI2aW-
Originally posted by x. View Post
because last time i tried to correct an error in one of correy's posts it lead to a big row, even though i was right. I can't be bothered anymore..


Your always right :fa:.
02-08-2012, 12:16 AM #24
Blackstorm
Veni. Vidi. Vici.
You can only set 25 unique strings. :p

---------- Post added at 05:16 PM ---------- Previous post was at 05:14 PM ----------

Originally posted by x. View Post
because last time i tried to correct an error in one of correy's posts it lead to a big row, even though i was right. I can't be bothered anymore..



Correy and SatanicHispanic are quite egotastical, don't worry, it's just a phase. :p
02-11-2012, 05:09 PM #25
Blackstorm
Veni. Vidi. Vici.
Uh oh, I spot a scripting error. It's a pretty obvious one too lol
02-11-2012, 05:31 PM #26
Originally posted by Blackstorm View Post
You can only set 25 unique strings. :p

---------- Post added at 05:16 PM ---------- Previous post was at 05:14 PM ----------




Correy and SatanicHispanic are quite egotastical, don't worry, it's just a phase. :p
its not 25 unique strings lol its much more then that Happy
02-11-2012, 05:33 PM #27
Originally posted by Blackstorm View Post
Uh oh, I spot a scripting error. It's a pretty obvious one too lol

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 ----------

Originally posted by IELIITEMODZX View Post
its not 25 unique strings lol its much more then that Happy
Good luck arguing with Blackstorm on this one Happy
02-11-2012, 05:49 PM #28
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by IELIITEMODZX View Post
its not 25 unique strings lol its much more then that Happy


After 25 Different text strings the game will get string overflow (on PS3 anyway).

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo