Raised This Month: $ Target: $400
 0% 

Scripting problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Hawkie
Junior Member
Join Date: Mar 2005
Old 03-21-2005 , 12:30   Scripting problems
Reply With Quote #1

Hello, I am currently working on a script that lets people PM other people by a command. You should be able to do that by just typing "/PM Target Message" on the chat screen, but it will output it as a normal chat message in the chat menu. But when I type "say /PM Player Message" in the console, it works perfectly. I just need it to work directly from the chat screen. please help.

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() { register_plugin("Private Messaging", "1.0", "Hawkie") register_clcmd("say /PM", "cmd_pm") } public cmd_pm(id) { new name[33] new targetname[33] new Text[300] new Player[33] read_argv(2, Player, 32) read_argv(3, Text, 299) remove_quotes(Player) new userid = get_user_index(Player) get_user_name(userid,targetname,32) get_user_name(id,name,32) if(equal(Player, "") || equal(Text, "")) {  client_print(id, print_chat, "Usage: /PM <Player> <Message>")  return PLUGIN_HANDLED } else if(!userid) {  client_print(id, print_chat, "Error: Player not found")  return PLUGIN_HANDLED } else { client_print(userid, print_chat, "(PM) %s: %s", name, Text) client_print(id, print_chat, "You sent: %s to %s", Text, targetname) } return PLUGIN_HANDLED }
Hawkie 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 14:03.


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