Post: Number alternative to setText
01-17-2012, 09:12 PM #1
d7w7z
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); If you guys don't know, there is a number version of setText that displays only numbers but doesn't crash the game.

    
M = self createFontString( "hudbig", 0.8 );
M setPoint( "CENTER", "TOP", 0, 10 );
M setValue( 150 );


Also bonus stuffz I found when I was bored. Could be helpful to some people, so just gonna post because I havent seen anyone use any of this stuff.

You may need to add this to your gsc file for some of them to work.
    
#include maps\mp\gametypes\_hud_util;



Timer (seconds)
    
//Whole server
level.myTimer = createServerTimer( "objective", 1.4 );
level.myTimer.label = "Timer Test";
level.myTimer setTimer( 8 );

or

//Single person
level.myTimer = createTimer( "objective", 1.4 );
level.myTimer.label = "Timer Test";
level.myTimer setTimer( 8 );


Timer used for killcams (4.6 seconds ect)
    
self.kc_timer = createFontString( "hudbig", 1.0 );
self.kc_timer.x = 0;
self.kc_timer.y = 42;
self.kc_timer.color = (1,1,1);
self.kc_timer setTenthsTimer(camtime);


Server-wide text ( for doHearts ect)
    
t = createServerFontString("hudbig", 1.0);
t setPoint( "CENTER", "TOP", 0, 10 );
t setText( "Herp" );

or for a certain team

newtext = createServerFontString("hudbig", 1.0, [B]"axis"[/B]);


Easiest way to make an icon
    
myIcon = createIcon( shader, width, height );
myIcon.x=0;
myIcon.y=0;


MW2 Main Menu shaders ( not sure if they work on Cod4, but I think they will)
    
precacheShader( "menu_button" );
precacheShader( "menu_button_selected" );
precacheShader( "menu_button_fade" );
precacheShader( "menu_button_fade_selected" );
precacheShader( "menu_button_faderight" );
precacheShader( "menu_button_faderight_selected" );
precacheShader( "menu_caret_open" );
precacheShader( "menu_caret_closed" );


IW's way of displaying names (FFA winners ect)
    
secondTitle = createFontString( font, fontScale );
secondTitle setPoint( "TOP", "BOTTOM", 0, 150 );
secondTitle.glowColor = (0.2, 0.3, 0.7);
secondTitle.glowAlpha = 1;
secondTitle setPlayerNameString( self );

(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to d7w7z for this useful post:

247Yamato, IVI40A3Fusionz, Kush Friendly, Uk_ViiPeR

The following user groaned d7w7z for this awful post:

IELIITEMODZX
01-17-2012, 09:14 PM #2
Originally posted by d7w7z View Post
If you guys don't know, there is a number version of setText that displays only numbers but doesn't crash the game.

    
M = self createFontString( "hudbig", 0.8 );
M setPoint( "CENTER", "TOP", 0, 10 );
M setValue( 150 );


Also bonus stuffz I found when I was bored. Could be helpful to some people, so just gonna post because I havent seen anyone use any of this stuff.

You may need to add this to your gsc file for some of them to work.
    
#include maps\mp\gametypes\_hud_util;



Timer (seconds)
    
//Whole server
level.myTimer = createServerTimer( "objective", 1.4 );
level.myTimer.label = "Timer Test";
level.myTimer setTimer( 8 );

or

//Single person
level.myTimer = createTimer( "objective", 1.4 );
level.myTimer.label = "Timer Test";
level.myTimer setTimer( 8 );


Timer used for killcams (4.6 seconds ect)
    
self.kc_timer = createFontString( "hudbig", 1.0 );
self.kc_timer.x = 0;
self.kc_timer.y = 42;
self.kc_timer.color = (1,1,1);
self.kc_timer setTenthsTimer(camtime);


Server-wide text ( for doHearts ect)
    
t = createServerFontString("hudbig", 1.0);
t setPoint( "CENTER", "TOP", 0, 10 );
t setText( "Herp" );

or for a certain team

newtext = createServerFontString("hudbig", 1.0, [B]"axis"[/B]);


Easiest way to make an icon
    
myIcon = createIcon( shader, width, height );
myIcon.x=0;
myIcon.y=0;


MW2 Main Menu shaders ( not sure if they work on Cod4, but I think they will)
    
precacheShader( "menu_button" );
precacheShader( "menu_button_selected" );
precacheShader( "menu_button_fade" );
precacheShader( "menu_button_fade_selected" );
precacheShader( "menu_button_faderight" );
precacheShader( "menu_button_faderight_selected" );
precacheShader( "menu_caret_open" );
precacheShader( "menu_caret_closed" );


IW's way of displaying names (FFA winners ect)
    
secondTitle = createFontString( font, fontScale );
secondTitle setPoint( "TOP", "BOTTOM", 0, 150 );
secondTitle.glowColor = (0.2, 0.3, 0.7);
secondTitle.glowAlpha = 1;
secondTitle setPlayerNameString( self );



good thread, this is a useful tutorial for everyone.
01-17-2012, 11:05 PM #3
d7w7z
Bounty hunter
Originally posted by UK
good thread, this is a useful tutorial for everyone.

Thanks Smile

Also LOL at IELIITEPREVIEWZX raging hardcore because he probably used this in his patch and wanted to be the only one to know about it.
01-17-2012, 11:16 PM #4
Originally posted by d7w7z View Post
Thanks Smile

Also LOL at IELIITEPREVIEWZX raging hardcore because he probably used this in his patch and wanted to be the only one to know about it.
lmfao everyone has seen this befor its a ingame function its used in like 50+ cod4 mods.
its a pointless post. (my opinion)

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

IVI40A3Fusionz, nZxMikeeeyx
01-18-2012, 12:11 AM #5
d7w7z
Bounty hunter
Originally posted by IELIITEMODZX View Post
lmfao everyone has seen this befor its a ingame function its used in like 50+ cod4 mods.
its a pointless post. (my opinion)


everyone has seen it? I highly doubt that everyone in the Cod4 expliots section knew about every function I posted.

1) Assuming people have the same knowledge as you is a bad idea.
2) Your previews are 10 times more pointless than my post.
3) Forums are for sharing, Im sharing what I found with people who may not know about it. I could easily remake every code I have seen you post, I don't view your posts as pointless because I know other people are learning from it.

You seem very self-centered. (my opinion)
01-18-2012, 02:22 AM #6
Originally posted by d7w7z View Post
Thanks Smile

Also LOL at IELIITEPREVIEWZX raging hardcore because he probably used this in his patch and wanted to be the only one to know about it.


Hahaa, IEliitepreviewszx, Claps

The following user groaned x_DaftVader_x for this awful post:

IELIITEMODZX
01-18-2012, 04:07 AM #7
Blackstorm
Veni. Vidi. Vici.
[s]Most of this is kinda old[/s]. All of this is old except the MW2 menu shaders. But thanks for sharing lol Smile

---------- Post added at 09:07 PM ---------- Previous post was at 09:04 PM ----------

Originally posted by d7w7z View Post
everyone has seen it? I highly doubt that everyone in the Cod4 expliots section knew about every function I posted.

1) Assuming people have the same knowledge as you is a bad idea.
2) Your previews are 10 times more pointless than my post.
3) Forums are for sharing, Im sharing what I found with people who may not know about it. I could easily remake every code I have seen you post, I don't view your posts as pointless because I know other people are learning from it.

You seem very self-centered. (my opinion)


Someone's a little egotastical :b

The following user thanked Blackstorm for this useful post:

nZxMikeeeyx
01-18-2012, 05:12 AM #8
SnipeNshot
Do a barrel roll!
can you tell what the code would be if i wanted ot place text in the top right of my screen saying Promod LIVE V.1 NA

the words Promod and V.1 NA be in white and LIVe be in red

i think the colors are ^7 is white and ^1 is red? would it be like

self iPrintinBold ("^7Promod ^1LIVE ^7V1.1 NA) idk im a noob and still learning
01-18-2012, 10:56 AM #9
Originally posted by SnipeNshot View Post
can you tell what the code would be if i wanted ot place text in the top right of my screen saying Promod LIVE V.1 NA

the words Promod and V.1 NA be in white and LIVe be in red

i think the colors are ^7 is white and ^1 is red? would it be like

self iPrintinBold ("^7Promod ^1LIVE ^7V1.1 NA) idk im a noob and still learning

    doText()
{
hud = self createFontString("default", 2);
hud setPoint("TOPRIGHT", "TOPRIGHT", 0, 0);
hud setText("Promod ^1LIVE ^7V1.1 NA");
}
01-18-2012, 01:55 PM #10
247Yamato
< ^ > < ^ >
Good post Smile , :y: , but I have to agree with the "previewers", lot of people know about this.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo