Raised This Month: $ Target: $400
 0% 

[Help] PM - PRivate Message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bloody806
Member
Join Date: Jun 2012
Location: Czech Republic
Old 03-08-2013 , 17:37   [Help] PM - PRivate Message
Reply With Quote #1

HI I have a plugin, but doent work.
Shows no error in log and console can normal compile.

PRoblem:
When I want to send a message, so the message doesnt comes a given player.
Please help

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "PM - Private Message"
#define VERSION "1.0"
#define AUTHOR "85filip58"

static const PREFIX[] = "[PM]"

new gidPlayer[33]; 

new const 
pm_sound[] = { "pm/pm_sound.wav" }

public 
plugin_init() 
{
   
register_plugin(PLUGINVERSIONAUTHOR)
   
   
register_clcmd("say /pm""cmd_privatemessage")
   
register_clcmd("say_team /pm""cmd_privatemessage")
   
   
register_clcmd("PM""cmd_player");
}

public 
cmd_privatemessage(id)
{
   static 
opcion[64]
   
   
formatex(opcioncharsmax(opcion),"Vyber Hraca")
   new 
iMenu menu_create(opcion"cmd_privatemessage_handler")
   
   new 
players[32], pnumtempid
   
new szName[32], szTempid[10]
   
   
get_players(playerspnum"a")
   
   for( new 
ii<pnumi++ )
   {
      
tempid players[i]
      
      
get_user_name(tempidszName31)
      
num_to_str(tempidszTempid9)
      
      
formatex(opcioncharsmax(opcion), "\w%s"szName)
      
menu_additem(iMenuopcionszTempid0)
   }
   
   
menu_display(idiMenu)
   return 
PLUGIN_HANDLED
}

public 
cmd_privatemessage_handler(idmenuitem)
{
   if( 
item == MENU_EXIT )
   {
      
menu_destroy(menu)
      return 
PLUGIN_HANDLED
   
}
   
   new 
Data[6], Name[64]
   new 
AccessCallback
   menu_item_getinfo
(menuitemAccessData,5Name63Callback)
   
   new 
tempid str_to_num(Data)
   
   
gidPlayer[id] = tempid
   client_cmd
(id"messagemode PM")
   
   
menu_destroy(menu)
   return 
PLUGIN_HANDLED
}

public 
cmd_player(id)
{
   new 
say[300]
   
read_args(saycharsmax(say))
   
   
remove_quotes(say)
   
   if(
equal(say""))
      return 
PLUGIN_HANDLED
      
   
cmd_send_pm(idsay)   
   return 
PLUGIN_CONTINUE;
}

public 
cmd_send_pm(idsay[])
{
   new 
player gidPlayer[id];
   
   
printMessage(playeridsay)
   return 
PLUGIN_HANDLED;
}
stock printMessage(recieversender, const message[])
{
   new 
name[32];
   
get_user_name(sendernamecharsmax(name))

   
ColorChat(reciever"!g%s !t%s !y: !g%s"PREFIXnamemessage)
   
client_cmd(reciever"spk ^"%s^""pm_sound)
}

stock ColorChat(const id, const input[], any:...) 
{
    new 
count 1players32 ]
   static 
msg191 ]
   
vformatmsg190input)
   
   
replace_allmsg190"!g""^4" )
   
replace_allmsg190"!y""^1" )
   
replace_allmsg190"!t""^3" )

   if(
idplayers] = id; else get_playersplayerscount"ch" )
   {
      for(new 
0counti++)
      {
         if( 
is_user_connectedplayers] ) )
         {
            
message_beginMSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players] )  
            
write_byteplayers] )
            
write_stringmsg )
            
message_end( )
         }
      }
   }


public 
plugin_precache()
{
   
precache_sound(pm_sound)

bloody806 is offline
Send a message via Skype™ to bloody806
FanatikSVK
Member
Join Date: Aug 2012
Location: Slovakia
Old 03-09-2013 , 07:58   Re: [Help] PM - PRivate Message
Reply With Quote #2

low code .. I have a better inscription PM
__________________
FanatikSVK is offline
Send a message via Skype™ to FanatikSVK
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 03-09-2013 , 08:10   Re: [Help] PM - PRivate Message
Reply With Quote #3

Why dont u share it with us? Or at least help him
Podarok is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-09-2013 , 08:39   Re: [Help] PM - PRivate Message
Reply With Quote #4

I will a create a new version of this, wait

EDIT:

First version, if you found a BUG send-me a PM in forum

In second, i will a add .reply command to respond a last recived message,.
Attached Files
File Type: sma Get Plugin or Get Source (pm.sma - 490 views - 3.1 KB)
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 03-09-2013 at 09:41.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
bloody806
Member
Join Date: Jun 2012
Location: Czech Republic
Old 03-09-2013 , 21:31   Re: [Help] PM - PRivate Message
Reply With Quote #5

Nice and Thanks
__________________
bloody806 is offline
Send a message via Skype™ to bloody806
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 21:45.


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