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

VERY quick and simple plugin [ANY]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gecko
SourceMod Donor
Join Date: Nov 2010
Location: Vancouver, Canada
Old 04-13-2011 , 17:51   VERY quick and simple plugin [ANY]
Reply With Quote #1

Hey forum, I'm trying to learn PAWN, and the best way that I learn coding languages is by looking at a simple script and building from there. So what I ask is that someone write a quick plugin that merely sends a message in the chatbox to the person who inputs a command, but that person is the only one who can see the message. I don't know how I can describe it any simpler. Also if you decide to take the two minutes required to do this, could you post the .sp file please? (Sorry but I've had multiple instances where people don't post it, so I'm just taking precautions.)
Thank you
Gecko is offline
Nomarky
SourceMod Donor
Join Date: Sep 2007
Old 04-13-2011 , 18:18   Re: VERY quick and simple plugin [ANY]
Reply With Quote #2

I think this will do what you want. I used it to test for working chat colour codes in mods

PHP Code:
#pragma semicolon 1

#include <sourcemod>


public OnPluginStart()
{
    
RegConsoleCmd("sm_test"Command_Test"Displays text colours in chat."FCVAR_PLUGIN);
}

public 
Action:Command_Test(clientargs) {
    
PrintToChat(client"\x01 This Is Text Colour 1");
    
PrintToChat(client"\x02 This Is Text Colour 2");
    
PrintToChat(client"\x03 This Is Text Colour 3");    
    
PrintToChat(client"\x04 This Is Text Colour 4");
    
PrintToChat(client"\x05 This Is Text Colour 5");
    
PrintToChat(client"\x06 This Is Text Colour 6");                                

There may be better ways of doing it, but I don't know them
Nomarky is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 04-13-2011 , 18:24   Re: VERY quick and simple plugin [ANY]
Reply With Quote #3

You have to return Plugin_Handled; in command callbacks to prevent "unknown command" spam in client console.
__________________
Peace-Maker is offline
Nomarky
SourceMod Donor
Join Date: Sep 2007
Old 04-13-2011 , 18:41   Re: VERY quick and simple plugin [ANY]
Reply With Quote #4

Quote:
Originally Posted by Peace-Maker View Post
You have to return Plugin_Handled; in command callbacks to prevent "unknown command" spam in client console.
So thats why that happens, thank you!
Nomarky is offline
Gecko
SourceMod Donor
Join Date: Nov 2010
Location: Vancouver, Canada
Old 04-13-2011 , 19:01   Re: VERY quick and simple plugin [ANY]
Reply With Quote #5

Thanks for the help I appreciate it.
Gecko 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 14:49.


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