Raised This Month: $ Target: $400
 0% 

open chat after clicking menu item


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 07-19-2018 , 16:30   Re: open chat after clicking menu item
Reply With Quote #10

Try
PHP Code:
public SendMessage(id)
{
    new 
szText[128], String[32];
    new 
menu menu_create("\ySelect a person to send message to""sendmessage_handler");

    new 
players[32], pnumtempidcount;

    
get_playersplayerspnum"ch" ); 

    for ( new 
ipnumi++ )
    {
        
tempid players[i];
        if(
tempid == id)
            continue;
        
count++;
        
formatex(String31"%d"tempid);
        
formatex(szTextsizeof(szText), "%s"user_name(tempid));
        
menu_additemmenuszTextString0);
    }
    
menu_displayidmenu);
    
}

public 
sendmessage_handler(idmenuitem)
{
    if(
item == MENU_EXIT) {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }

    new 
data[9], name[64], userid;
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), namecharsmax(name), callback);

    
userid str_to_num(data);

    new 
szName[32];
    
get_user_name(useridszNamecharsmax(szName))

    
client_print(idprint_center"Selected Player: %s"szName//To see if name from menu matches
    
client_cmd(id"messagemode PM");
    
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;

Airkish is offline
 



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 12:18.


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