AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [REQ] !Tagme (https://forums.alliedmods.net/showthread.php?t=74884)

GriMz 07-26-2008 16:15

[REQ] !Tagme
 
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.

bl4nk 07-26-2008 16:32

Re: [REQ] !Tagme
 
What mod?

DarkEnergy 07-26-2008 17:26

Re: [REQ] !Tagme
 
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

DJ Tsunami 07-26-2008 19:12

Re: [REQ] !Tagme
 
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).

GriMz 07-26-2008 20:20

Re: [REQ] !Tagme
 
Quote:

Originally Posted by bl4nk (Post 659326)
What mod?

cs:s is what were using.

Extreme_One 07-27-2008 13:58

Re: [REQ] !Tagme
 
Requested something like this ages ago

siosios 07-27-2008 18:23

Re: [REQ] !Tagme
 
i have the ES version i wrote but would prefer it moved over to SM for use.

bl4nk 07-27-2008 20:19

Re: [REQ] !Tagme
 
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;



Lebson506th 07-27-2008 21:11

Re: [REQ] !Tagme
 
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;



deovindice 08-16-2008 12:23

Re: [REQ] !Tagme
 
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.


All times are GMT -4. The time now is 13:33.

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