Raised This Month: $12 Target: $400
 3% 

Rank pos. in chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Point
Junior Member
Join Date: Oct 2014
Old 06-18-2019 , 12:09   Rank pos. in chat
Reply With Quote #1

Hello!
PHP Code:
register_message(get_user_msgid("SayText"), "Message_SayText");

public 
Top10(id)
{
    new 
data[1]
    
data[0] = id
    
    menu_display
(idJumpMenu);
    
    
format(g_szQuerycharsmax(g_szQuery),"SELECT * FROM ranked ORDER BY xp DESC LIMIT 10")
    
SQL_ThreadQuery(g_hTuple"Top"g_szQuerydatasizeof(data))
}
public 
Top(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
{
    if(
FailState)
    {
        
log_amx("SQL Error: %s (%d)"ErrorErrcode)
        return 
PLUGIN_HANDLED
    
}
    
    new 
id Data[0]
    
    new 
title[64] = ""
    
format(titlecharsmax(title), "\yJumps???")
    
JumpMenu menu_create(title"JumpsMenu_Handler");
    
    new 
szData[128];
    new 
szPos[2];
    new 
Pos 1;
    
    new 
SteamID[32], Points
    
    
while(SQL_MoreResults(Query))
    {
        
num_to_str(PosszPoscharsmax(szPos));
        
        
SQL_ReadResult(Query,0SteamIDcharsmax(SteamID))
        
Points SQL_ReadResult(Query1)
    
        
formatex(szDatacharsmax(szData), "#%i - %s - \y%d"PosSteamIDPoints);
        
menu_additem(JumpMenuszDataszPos);
        
        ++
Pos;
        
        
SQL_NextRow(Query)
    
    }

    
menu_setprop(JumpMenuMPROP_NEXTNAME"Previous");
    
menu_setprop(JumpMenuMPROP_BACKNAME"Next");
    
menu_setprop(JumpMenuMPROP_EXITNAME"Exit");
    
    return 
PLUGIN_CONTINUE;
}

public 
Message_SayText(msgId,msgDest,msgEnt

    new 
id get_msg_arg_int(1); 
    if( 
is_user_connected(id) ) 
    {
            new 
flags get_user_flags(id)
            for(new 
ii<sizeof(AdminsDatas); i++) 
            { 
                if( 
flags AdminsDatas[i][m_iFlag] ) 
                { 
                    new 
szChannel[64]
                    
get_msg_arg_string(2szChannelcharsmax(szChannel))
        
                    if( 
equal(szChannel"#Cstrike_Chat_All") ) 
                    { 
                        
formatex(szChannelcharsmax(szChannel), "^3[%s](%s) ^3%%s1 ^1:  %%s2"Prefix[Level[id]], AdminsDatas[i][m_szName])
                        
set_msg_arg_string(2szChannel)
                    } 
                    else if( !
equal(szChannel"#Cstrike_Name_Change") ) 
                    { 
                        
format(szChannelcharsmax(szChannel), "^4[%s](%s) %s"Prefix[Level[id]], AdminsDatas[i][m_szName], szChannel)
                        
set_msg_arg_string(2szChannel)
                    } 
                    return
                } 
                else
                {
                    new 
szChannel[64]
                    
get_msg_arg_string(2szChannelcharsmax(szChannel))
        
                    if( 
equal(szChannel"#Cstrike_Chat_All") ) 
                    { 
                        
formatex(szChannelcharsmax(szChannel), "^2[%s] ^3%%s1 ^1:  %%s2"Prefix[Level[id]])
                        
set_msg_arg_string(2szChannel)
                    } 
                    else if( !
equal(szChannel"#Cstrike_Name_Change") ) 
                    { 
                        
format(szChannelcharsmax(szChannel), "^4[%s] %s"Prefix[Level[id]], szChannel)
                        
set_msg_arg_string(2szChannel)
                    } 
                    return 
                }
            } 
        }
        else
        {
            new 
szChannel[64]
            
get_msg_arg_string(2szChannelcharsmax(szChannel));
        
            if( 
equal(szChannel"#Cstrike_Chat_All") ) 
            { 
                
formatex(szChannelcharsmax(szChannel), "^4[%s] ^3%%s1 ^1:  %%s2"Prefix[Level[id]])
                
set_msg_arg_string(2szChannel)
            } 
            else if( !
equal(szChannel"#Cstrike_Name_Change") ) 
            { 
                
format(szChannelcharsmax(szChannel), "^4[%s] %s"Prefix[Level[id]], szChannel
                
set_msg_arg_string(2szChannel)
            } 
            return 
        }

My question is how can i put the positions from the top into the chat
example: [#2] Icebeam: hello
Just wondering if it's possible and how. Thanks in advance

Last edited by Point; 06-18-2019 at 12:10.
Point is offline
thEsp
BANNED
Join Date: Aug 2017
Old 06-18-2019 , 14:19   Re: Rank pos. in chat
Reply With Quote #2

Ask Ocixcrom to add a definition/format to his chat manager, so you can still add or remove any other chat text.

Last edited by thEsp; 06-18-2019 at 14:21.
thEsp is offline
Reply


Thread Tools
Display Modes

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 03:34.


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