This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

HUD Message problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stranged
Junior Member
Join Date: May 2015
Old 06-02-2015 , 14:15   HUD Message problem
Reply With Quote #1

Hello Guys,
Today I've decided to add another hud message showing the next rank that the player will get, I've made so much tests and finally I got it right, but then the other message above it just disappeared and started to not show up.
This is the code:
PHP Code:
public Info()
{
    for(new 
id 1id <= MaxPlayersid++)
    {
        if(!
is_user_bot(id) && is_user_connected(id))
        {
            if(
get_pcvar_num(gHideRadar))
                
set_hudmessage(02552550.010.0101.01.0__, -1);
            else
                
set_hudmessage(02552550.010.1901.01.0__, -1)
            
            static 
buffer[384], len;
            
len format(buffercharsmax(buffer), "%L",LANG_PLAYER,"ZVANIE");
            
len += format(buffer[len], charsmax(buffer) - len" [%L]",LANG_PLAYER,gRankNames[UserData[id][gLevel]]);
            
len format(buffercharsmax(buffer), "%L",LANG_PLAYER,"NEXT_RANK");
            
len += format(buffer[len], charsmax(buffer) - len" [%L]",LANG_PLAYER,gRankNames[UserData[id][gLevel]+1]);
            if(
UserData[id][gLevel] <= 19)
            {
                
len += format(buffer[len], charsmax(buffer) - len"^n%L",LANG_PLAYER,"PL_XP",UserData[id][gExp],gLevels[UserData[id][gLevel]]);
            } else {
                
len += format(buffer[len], charsmax(buffer) - len"^n%L",LANG_PLAYER,"PL_MAX");
            }
            
ShowSyncHudMsg(idg_MsgHud"%s"buffer);
        }
    }
    return 
PLUGIN_CONTINUE

Stranged is offline
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 06-03-2015 , 08:06   Re: HUD Message problem
Reply With Quote #2

Just use other channel
__________________
I Hate people who can hate me !
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
Stranged
Junior Member
Join Date: May 2015
Old 06-03-2015 , 16:55   Re: HUD Message problem
Reply With Quote #3

Quote:
Originally Posted by K1d0x View Post
Just use other channel
-1 = Finding next available channel for use.
By the way the problem occurs only when I add the next hud message in the code after Current Rank:
So whenever I add - len = format(buffer, charsmax(buffer), "%L",LANG_PLAYER,"NEXTRANK");
It doesn't show, I tried putting it everywhere but no success.

----------
ERROR LOG:
Run time error 4: index out of bounds
L 06/04/2015 - 00:286: [AMXX] [0] army_ranks.sma::Info (line 841)

Last edited by Stranged; 06-03-2015 at 17:29.
Stranged is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 06-04-2015 , 09:39   Re: HUD Message problem
Reply With Quote #4

see anything wrong?

len = format(buffer, charsmax(buffer), "%L",LANG_PLAYER,"ZVANIE");
len += format(buffer[len], charsmax(buffer) - len, " [%L]",LANG_PLAYER,gRankNames[UserData[id][gLevel]]);
len = format(buffer, charsmax(buffer), "%L",LANG_PLAYER,"NEXT_RANK");
len += format(buffer[len], charsmax(buffer) - len, " [%L]",LANG_PLAYER,gRankNames[UserData[id][gLevel]+1]);
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
Stranged
Junior Member
Join Date: May 2015
Old 06-05-2015 , 13:10   Re: HUD Message problem
Reply With Quote #5

Fixed it already thanks!
Stranged is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:49.


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