AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   slow % in hud [solved] (https://forums.alliedmods.net/showthread.php?t=61670)

kp_uparrow 10-07-2007 01:07

slow % in hud [solved]
 
im trying to show the % sign in hud, i tried %% and it still doent show

M249-M4A1 10-07-2007 01:42

Re: slow % in hud
 
Try ^%

kp_uparrow 10-07-2007 14:33

Re: slow % in hud
 
^% didnt work
\% didnt work

M249-M4A1 10-07-2007 14:38

Re: slow % in hud
 
Show code

kp_uparrow 10-07-2007 14:55

Re: slow % in hud
 
Code:
new szSkillName[64], iSkillLevel;         new szMsg[256], szUltimate[256],    szPassive[256];         new pos = 0,            posU = 0,           posP = 0;                 new iSkillLevel2         // Loop through all available skills to find the trainable options...         for ( new iSkillID = 0; iSkillID < MAX_SKILLS; iSkillID++ )         {             // Get the skill's level             iSkillLevel = SM_GetSkillLevel( id, iSkillID, 8 );             iSkillLevel2=iSkillLevel-1             // If the skill level is > 0 then the user has this skill!             if ( iSkillLevel > 0 )             {                 // Get the skill's name                 LANG_GetSkillName( iSkillID , id, szSkillName, 63, 19 );                 // Trainable skill                 if ( SM_GetSkillType( iSkillID ) == SKILL_TYPE_TRAINABLE )                 {                     pos += formatex( szMsg[pos], 256-pos, "^n%s %L %d", szSkillName, id, "WORD_LEVEL", iSkillLevel );                                                             switch(iSkillID){                         case 0:pos += formatex( szMsg[pos], 256-pos, " (%d^%)",floatround(p_vampiric[iSkillLevel2]*100))                         case 1:pos += formatex( szMsg[pos], 256-pos, " (%d speed)",floatround(p_unholy[iSkillLevel2]))                         case 2:pos += formatex( szMsg[pos], 256-pos, " (%d\%)",floatround(p_levitation[iSkillLevel2]*100))                                                 case 4:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(float(p_invisibility[iSkillLevel2])/255.0*100.0))                         case 5:pos += formatex( szMsg[pos], 256-pos, " (+%dhp)", p_devotion*(iSkillLevel2+1))                         case 6:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_bash[iSkillLevel2]*100))                                                 case 8:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_critical[iSkillLevel2]*100))                         case 9:pos += formatex( szMsg[pos], 256-pos, " (%fX)",p_grenade[iSkillLevel2])                         case 10:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_ankh[iSkillLevel2]*100))                                                 case 12:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_evasion[iSkillLevel2]*100))                         case 13:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_thorns[iSkillLevel2]*100))                         case 14:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_trueshot[iSkillLevel2]*100))                                                 case 16:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_phoenix[iSkillLevel2]*100))                         case 17:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_banish[iSkillLevel2]*100))                         case 18:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_mana[iSkillLevel2]*100))                                                 case 21:pos += formatex( szMsg[pos], 256-pos, " (%f sec)",p_heal[iSkillLevel2])                         case 22:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_hex[iSkillLevel2]*100))                         case 23:pos += formatex( szMsg[pos], 256-pos, " (%d)",p_serpent[iSkillLevel2])                                                 case 26:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_fan[iSkillLevel2]*100))                         case 27:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_blink[iSkillLevel2]*100))                         case 28:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_shadow[iSkillLevel2]*100))                                                 case 31:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_impale[iSkillLevel2]*100))                         case 32:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_spiked[iSkillLevel2]*100))                         case 33:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",floatround(p_carrion[iSkillLevel2]*100))                         //default:pos += formatex( szMsg[pos], 256-pos, " (%d%%)",pp);                     }                 }                 // Skill is an ultimate                 else if ( SM_GetSkillType( iSkillID ) == SKILL_TYPE_ULTIMATE && iSkillLevel > 0 )                 {                     posU += formatex( szUltimate[posU], 255-posU, "^n%L: %s", id, "WORD_ULTIMATE", szSkillName );                 }                 // Skill is passive                 else if ( SM_GetSkillType( iSkillID ) == SKILL_TYPE_PASSIVE )                 {                     posP += formatex( szPassive[posP], 255-posP, "^n%s", szSkillName );                 }             }         }
^% shows nothing and \% shows \

M249-M4A1 10-07-2007 15:00

Re: slow % in hud
 
What line am I looking at?

kp_uparrow 10-07-2007 20:28

Re: slow % in hud
 
switch(iSkillID){
case 0:pos += formatex( szMsg[pos], 256-pos, " (%d^%)",floatround(p_vampiric[iSkillLevel2]*100))
case 1:pos += formatex( szMsg[pos], 256-pos, " (%d speed)",floatround(p_unholy[iSkillLevel2]))
case 2:pos += formatex( szMsg[pos], 256-pos, " (%d\%)

purple_pixie 10-08-2007 06:41

Re: slow % in hud
 
I assume it's an HL thing ...

You can't say it.

The only option would be to try:

"^^^%" which should pass "^%" to HL, which it *might* translate into the % sign.

vittu 10-08-2007 13:40

Re: slow % in hud
 
That's just stupid, it should work. %% is the correct useage, however you could always do format(..., ..., "%s", "%").

pRED* 10-08-2007 16:26

Re: slow % in hud
 
Where are you trying to display this string?

%% formats the string to have a % char, but if you are trying to print it to chat it still won't work because I don't think the hl1 chat supports the '%' character. Printing it to a hud message should be fine


All times are GMT -4. The time now is 07:58.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.