Raised This Month: $32 Target: $400
 8% 

[REQ] PM


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 01-06-2018 , 14:19   [REQ] PM
Reply With Quote #1

Hi, I want a plugin when an admin types /pm it opens list of players for sending private message using amx_psay.

Last edited by khashayar007; 01-07-2018 at 13:08.
khashayar007 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-06-2018 , 14:50   Re: [REQ] PM
Reply With Quote #2

https://forums.alliedmods.net/showpo...54&postcount=9
I can recommand you this.
https://forums.alliedmods.net/showpo...54&postcount=9
The script file is using a colorchat stock which isn't included. Fix it or switch to client_print()
__________________
Relaxing is offline
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 01-07-2018 , 13:08   Re: [REQ] PM
Reply With Quote #3

That doesnt show players who are spectator. Can you fix it?
khashayar007 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-07-2018 , 13:53   Re: [REQ] PM
Reply With Quote #4

Quote:
Originally Posted by Amine Belokda View Post
PHP Code:
#include <amxmodx>
#include <colorchat>

new g_iTarget[33]

public 
plugin_init() 
{
    
register_plugin("PM - Private Message""1.0""EaGle/Flicker-rewriten")
    
    
register_clcmd("say /pm""cmdPMMenu")
    
register_clcmd("say_team /pm""cmdPMMenu")
    
    
register_clcmd("PrivateMessage""cmd_player");
}

public 
cmdPMMenu(id)
{
    new 
menu menu_create("\r[PG] \yPrivate Message \wMenu""handlePMMEnu")
    
    new 
players[32], num
    
new szName[32], szTempid[32]
    
    
get_players(playersnum"ch")
    
    for(new 
inumi++)
    {
        
get_user_name(players[i], szNamecharsmax(szName))
        
        
num_to_str(get_user_userid(players[i]), szTempidcharsmax(szTempid))
        
        
menu_additem(menuszNameszTempid0)
    }
    
    
menu_display(idmenu)
}

public 
handlePMMEnu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
szData[6], szName[64], iAccessiCallback
    menu_item_getinfo
(menuitemiAccessszDatacharsmax(szData), szNamecharsmax(szName), iCallback)
    
    
g_iTarget[id] = find_player("k"str_to_num(szData))
    
    
client_cmd(id"messagemode PrivateMessage")
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}

public 
cmd_player(id)
{
    new 
say[300]
    
read_args(saycharsmax(say))
    
remove_quotes(say)
    
    if(!
strlen(say))
        return 
PLUGIN_HANDLED
    
    
new szSenderName[32], szReceiverName[32]
    
get_user_name(idszSenderNamecharsmax(szSenderName))
    
get_user_name(g_iTarget[id], szReceiverNamecharsmax(szReceiverName))
    
    
client_print(idprint_chat"[PG] Private Message To %s: %s"szReceiverNamesay)
    
client_print(g_iTarget[id], print_chat"[PG] Private Message From %s: %s"szSenderNamesay)
    
    return 
PLUGIN_CONTINUE

Removed "a" from get_players()
"a" - do not include dead clients
For more follow this: http://amxmodx.org/api/amxmodx/get_players
__________________
Relaxing is offline
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 01-07-2018 , 16:06   Re: [REQ] PM
Reply With Quote #5

Thanks
khashayar007 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 18:45.


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