Raised This Month: $ Target: $400
 0% 

[REQ] !Tagme


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GriMz
Senior Member
Join Date: Jul 2007
Old 07-26-2008 , 16:15   [REQ] !Tagme
Reply With Quote #1

can someone do a plug in that changes a players name to add a cvar (tag) to the begining of someones name if they say "!tagme" in chat? neds to accept unicode tags and all and run off a tagme.cfg as unicode in a server.cfg can cause issues.
__________________
GriMz is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 07-26-2008 , 16:32   Re: [REQ] !Tagme
Reply With Quote #2

What mod?
bl4nk is offline
DarkEnergy
SourceMod Donor
Join Date: Apr 2008
Location: Georgia Tech, MSECE
Old 07-26-2008 , 17:26   Re: [REQ] !Tagme
Reply With Quote #3

i think he is saying when a player says !tagme, server adds a tag to their name, that tag can be controlled with a cvar
DarkEnergy is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 07-26-2008 , 19:12   Re: [REQ] !Tagme
Reply With Quote #4

I think bl4nk is asking what mod he wants it for. Even though changing names should work in all mods, either with the name command (EP1) or with SetClientInfo (EP2).
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
GriMz
Senior Member
Join Date: Jul 2007
Old 07-26-2008 , 20:20   Re: [REQ] !Tagme
Reply With Quote #5

Quote:
Originally Posted by bl4nk View Post
What mod?
cs:s is what were using.
__________________
GriMz is offline
Extreme_One
Veteran Member
Join Date: Nov 2006
Old 07-27-2008 , 13:58   Re: [REQ] !Tagme
Reply With Quote #6

Requested something like this ages ago
__________________
Extreme_One is offline
siosios
SourceMod Donor
Join Date: Jan 2008
Old 07-27-2008 , 18:23   Re: [REQ] !Tagme
Reply With Quote #7

i have the ES version i wrote but would prefer it moved over to SM for use.
__________________
siosios is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 07-27-2008 , 20:19   Re: [REQ] !Tagme
Reply With Quote #8

This should work with non-OB mods (TF2/DOD:S); I'll add them in later on.

PHP Code:
#pragma semicolon 1

#include <sourcemod>

// Global Definitions
#define PLUGIN_VERSION "1.0.0"

new Handle:cvarTag;
new 
Handle:cvarLoc;

// Functions
public Plugin:myinfo =
{
    
name "TagMe",
    
author "bl4nk",
    
description "Adds a tag to the beginning of a player's name when they say '!tagme'",
    
version PLUGIN_VERSION,
    
url "http://forums.alliedmods.net"
};

public 
OnPluginStart()
{
    
CreateConVar("sm_tagme_version"PLUGIN_VERSION"TagMe Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
cvarTag CreateConVar("sm_tagme_tag""[TAG] ""The tag that will be added to the player's name"FCVAR_PLUGIN);
    
cvarLoc CreateConVar("sm_tagme_loc""1""Where in the name to place the tag (1 = Beginning, 2 = End)"FCVAR_PLUGINtrue1.0true2.0);

    
RegConsoleCmd("say"Command_Say);
    
RegConsoleCmd("say_team"Command_Say);
}

public 
Action:Command_Say(clientargs)
{
    
decl String:text[192];
    
GetCmdArgString(textsizeof(text));

    new 
startidx 0;
    if (
text[0] == '"')
    {
        
startidx 1;

        new 
len strlen(text);
        if (
text[len-1] == '"')
        {
            
text[len-1] = '\0';
        }
    }

    if (
strcmp(text[startidx], "!tagme") == 0)
    {
        
decl String:name[32], String:tag[16], String:buffer[48];
        
GetClientName(clientnamesizeof(name));
        
GetConVarString(cvarTagtagsizeof(tag));

        switch (
GetConVarInt(cvarLoc))
        {
            case 
1:
            {
                
Format(buffersizeof(buffer), "%s%s"tagname);
            }
            case 
2:
            {
                
Format(buffersizeof(buffer), "%s%s"nametag);
            }
        }

        
ClientCommand(client"name %s"buffer);
        
PrintToChat(client"[SM] You have been tagged!");

        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;

bl4nk is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 07-27-2008 , 21:11   Re: [REQ] !Tagme
Reply With Quote #9

This should work for TF2, DoD:S and all non-OB games. It's a slight modification of bl4nk's code.

Just a side note, my version of the plugin requires the 1.1.0 snapshots.

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

// Global Definitions
#define PLUGIN_VERSION "1.0.0"

new Handle:cvarTag;
new 
Handle:cvarLoc;
new 
bool:CanName;

// Functions
public Plugin:myinfo =
{
    
name "TagMe",
    
author "bl4nk",
    
description "Adds a tag to the beginning of a player's name when they say '!tagme'",
    
version PLUGIN_VERSION,
    
url "http://forums.alliedmods.net"
};

public 
OnPluginStart()
{
    
CreateConVar("sm_tagme_version"PLUGIN_VERSION"TagMe Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
cvarTag CreateConVar("sm_tagme_tag""[TAG] ""The tag that will be added to the player's name"FCVAR_PLUGIN);
    
cvarLoc CreateConVar("sm_tagme_loc""1""Where in the name to place the tag (1 = Beginning, 2 = End)"FCVAR_PLUGINtrue1.0true2.0);

    
RegConsoleCmd("say"Command_Say);
    
RegConsoleCmd("say_team"Command_Say);

    new 
String:gamename[31];
    
GetGameFolderName(gamenamesizeof(gamename));
    
CanName = !(StrEqual(gamename,"tf",false) || StrEqual(gamename,"dod",false));
}

public 
Action:Command_Say(clientargs)
{
    
decl String:text[192];
    
GetCmdArgString(textsizeof(text));

    new 
startidx 0;
    if (
text[0] == '"')
    {
        
startidx 1;

        new 
len strlen(text);
        if (
text[len-1] == '"')
        {
            
text[len-1] = '\0';
        }
    }

    if (
strcmp(text[startidx], "!tagme") == 0)
    {
        
decl String:name[32], String:tag[16], String:buffer[48];
        
GetClientName(clientnamesizeof(name));
        
GetConVarString(cvarTagtagsizeof(tag));

        switch (
GetConVarInt(cvarLoc))
        {
            case 
1:
            {
                
Format(buffersizeof(buffer), "%s%s"tagname);
            }
            case 
2:
            {
                
Format(buffersizeof(buffer), "%s%s"nametag);
            }
        }

        if(
CanName)
        {
            
ClientCommand(client"name \"%s\""buffer);
        }
        else
        {
            
SetClientInfo(client"name"buffer);
        }

        
PrintToChat(client"[SM] You have been tagged!");

        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;


Last edited by Lebson506th; 07-28-2008 at 09:04.
Lebson506th is offline
deovindice
New Member
Join Date: Aug 2008
Old 08-16-2008 , 12:23   Re: [REQ] !Tagme
Reply With Quote #10

thanks guys.

but theres a problem still, we cant use anything but normal characters, is there a way to use UTF-8 or something?

if you set the tag in its characters into the sp file and try to compile it as utf-8 or unicode you get errors, if you try to draw on a seperate cfg from the server.cfg (which cant be utf-8 or unicode) then it gives the tag as [TAG].

there has to be a way around this somehow.

Last edited by deovindice; 08-16-2008 at 12:44.
deovindice 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 19:02.


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