Raised This Month: $ Target: $400
 0% 

Trying to add ViP Tag to this script.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 09-02-2012 , 10:07   Re: Trying to add ViP Tag to this script.
Reply With Quote #2

You posted twice. Going with this one.
PHP Code:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.0.0"

public Plugin:myinfo 
{
     
name "VIP Tag",
     
author "-{RPG}- DoM",
     
description "Adds [VIP] to specified players.",
     
version PLUGIN_VERSION,
     
url "http://www.RisingPhoenixGaming.net"
}

public 
OnPluginStart()
{
     
RegAdminCmd("sm_vipsay"CmdsayVADMFLAG_RESERVATION);
}

public 
Action:CmdsayV(clientargs)
{
    
PrintHintTextToAll("[VIP] %N says hello"client);
    return 
Plugin_Handled;

  • Watch out for those includes. You didn't need cstrike or sdkhooks. (In this case you probably also don't need sdktools, but it's good to include it just in case)
  • You can just use RegAdminCmd instead of RegConsoleCmd+checking their access.
  • %N will print the client's name if you specify their client index, do that instead of GetClientName (which can take up three whole lines)
  • PrintHintText prints hint text to one player, PrintHintTextToAll prints to all.
Now, assuming you want them to be able to specify what to say:

PHP Code:
public Action:CmdsayV(clientargs)
{
    new 
String:message[192];
    
GetCmdArgString(messagesizeof(message));
    
PrintHintTextToAll("[VIP] %N says: %s"clientmessage);
    return 
Plugin_Handled;

__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

Last edited by MasterOfTheXP; 09-02-2012 at 10:08.
MasterOfTheXP is offline
 


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:42.


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