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

Trying to add ViP Tag to this script.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tamadrums92
Junior Member
Join Date: Jul 2012
Old 09-02-2012 , 08:21   Trying to add ViP Tag to this script.
Reply With Quote #1

So... Yeah, I'm completely lost.

Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>
#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()
{
    RegConsoleCmd("sm_vipsay", CmdsayV);

}

public Action:CmdsayV(client, args)
    if(CheckCommandAcess(client, "Vip", ADMFLAG_RESERVATION)
    {
    
    new Sting:name[MAX_NAME_LENGTH]
    GetClientName(client, name, sizeof(name))
    PrinttHintText(client "%s says hello", name);

    }

    else
    {
        PrintToChat(Client, "\x02 You do not have access to this command");

    }

    return Plugin_Handled;

}
tamadrums92 is offline
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
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-02-2012 , 11:23   Re: Trying to add ViP Tag to this script.
Reply With Quote #3

why there two threads about same
Attached Thumbnails
Click image for larger version

Name:	Untitled.jpg
Views:	550
Size:	18.4 KB
ID:	108949  
Bacardi is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 09-02-2012 , 11:26   Re: Trying to add ViP Tag to this script.
Reply With Quote #4

So we have more room to waste our time..
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
tamadrums92
Junior Member
Join Date: Jul 2012
Old 09-02-2012 , 12:32   Re: Trying to add ViP Tag to this script.
Reply With Quote #5

This "Moron" posted in the wrong thread, deleted it and posted here under the post, VIP TAGs.
I appreciate the help guys, nonetheless. I'm very new to scripting I just couldn't figure out how to somehow to trigger the tag on the chat box. Thank you.

Last edited by tamadrums92; 09-02-2012 at 12:36.
tamadrums92 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 17:09.


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