This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Can Anyone pls edit this plugin? And Change Steamid to name?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
aashiriftikhar
BANNED
Join Date: Mar 2013
Location: Karachi
Old 03-12-2013 , 03:37   Can Anyone pls edit this plugin? And Change Steamid to name?
Reply With Quote #1

Please edit this plugin steamid system into the name system the tags.ini file contains steam ids "tag" then the tag but i want "Player Nick" "tag" in tags.ini pls help and work on it.....coz many peoples wants this type of plugin

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Tags"
#define VERSION "1.0"
#define AUTHOR "Khalid"

#define MAX_TAG_CHARACTERS    20

new Trie:gTrie

new g_szTag[33][MAX_TAG_CHARACTERS 1]

new const 
FILE[] = "addons/amxmodx/configs/tags.ini"



public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""HookSaid")
    
    
gTrie TrieCreate()
    
    
ReadFile()
    
    
register_concmd("amx_reload_tags""AdminReloadTags"ADMIN_RCON)
    
register_concmd("amx_add_tag""AdminAddTag"ADMIN_RCON"<name> <tag> - Adds a tag for a player")
}

public 
client_putinserver(id)
{
    new 
szAuthId[35]; get_user_authid(idszAuthIdcharsmax(szAuthId))
    
    if(
TrieKeyExists(gTrieszAuthId))
        
TrieGetString(gTrieszAuthIdg_szTag[id], charsmax(g_szTag[]))
}

public 
client_disconnect(id)
    
g_szTag[id][0] = '^0'

public AdminAddTag(idlevelcid)
{
    if(!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED
        
    
new szName[32], szAuthId[35], iPlayer
    read_argv
(1szName31); read_argv(2g_szTag[iPlayer], charsmax(g_szTag[]))
    
    if( !( 
iPlayer cmd_target(idszNameCMDTARGET_ALLOW_SELF) ) )
    {
        
console_print(id"Player must be connected")
        return 
PLUGIN_HANDLED
    
}
    
    if(
g_szTag[id][0])
    {
        
console_print(id"Player already have a tag")
        return 
PLUGIN_HANDLED
    
}
    
    
get_user_authid(iPlayerszAuthIdcharsmax(szAuthId))
    
get_user_name(iPlayerszNamecharsmax(szName))
    
    new 
fopen(FILE"w")
    
fseek(f0SEEK_END)
    
    
fprintf(f"^"%s^" ^"%s^""szAuthIdg_szTag[iPlayer])
    
fclose(f)
    
    
TrieSetString(gTrieszAuthIdg_szTag[iPlayer])
    
    
console_print(id"Successfully added tag %s for player %s"g_szTag[iPlayer], szName)
    return 
PLUGIN_HANDLED
}

public 
AdminReloadTags(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    TrieClear
(gTrie)
    
    for(new 
isizeof(g_szTag); i++)
    {
        
g_szTag[i][0] = '^0'
    
}
    
    
console_print(id"Successfully reloaded file")
    
ReadFile()
    
    new 
iPlayers[32], iNumszAuthId[35], iPlayer
    get_players
(iPlayersiNum"ch")
    
    for(new 
iiNumi++)
    {
        
iPlayer iPlayers[i]
        
get_user_authid(iPlayerszAuthIdcharsmax(szAuthId))
        if(
TrieKeyExists(gTrieszAuthId))
        {
            
TrieGetString(gTrieszAuthIdg_szTag[iPlayer], charsmax(g_szTag[]))
        }
    }
    
    return 
PLUGIN_HANDLED
}

ReadFile()
{
    new 
szLine[100]
    if(!
file_exists(FILE))
    {
        
write_file(FILE"; Tags File -> By Khalid :)")
        
write_file(FILE"; Any line starting with ; is a comment")
        
write_file(FILE"; How to put tags?")
        
write_file(FILE"; ^"STEAMID^"    ^"TAG^"")
        
formatex(szLinecharsmax(szLine), "; TAG CAN BE ONLY %d CHARACTERS!"MAX_TAG_CHARACTERS)
        
write_file(FILEszLine)
        
        return;
    }
    
    new 
fopen(FILE"r")
    new 
szAuthId[32], szTag[MAX_TAG_CHARACTERS 1]
    
    while(!
feof(f))
    {
        
fgets(fszLine99)
        
        
replace(szLinecharsmax(szLine), "^n""")
        
        if(!
szLine[0] || szLine[0] == ';')
            continue;
        
        
strbreak(szLineszAuthIdcharsmax(szAuthId), szTagcharsmax(szTag))
        
        
remove_quotes(szAuthId)
        
remove_quotes(szTag)
        
        
TrieSetString(gTrieszAuthIdszTag)
    }
    
    
fclose(f)
}

public 
HookSaid(id)
{
    if(!
g_szTag[id][0])
        return 
PLUGIN_CONTINUE
    
    
static szMessage[191], szLastFormat[200], szName[32]
    new 
iAlive
    
    read_argv
(1szMessagecharsmax(szMessage))
    
    if(!
szMessage[0])
        return 
PLUGIN_CONTINUE
    
    get_user_name
(idszName31)
    
formatex(szLastFormatcharsmax(szLastFormat), "%s^4%s ^3%s ^1: %s", ( ( iAlive is_user_alive(id) ) ? "" : ( get_user_team(id) == "^1*SPEC* " "^1*DEAD* ") ), g_szTag[id], szNameszMessage)

    
server_print("get_user_team(id) = %d"get_user_team(id))
    Print(
idszLastFormatiAlive)
    
    return 
PLUGIN_HANDLED_MAIN
}

Print(
idMessage[], iAlive)
{
    static 
SayText
    
    
if(!SayText)
        
SayText get_user_msgid("SayText")
        
    new 
players[32], iNum
    
    get_players
(playersiNumiAlive "ach" /* Skip Dead */ "bch" /* Skip Alive */)

    for(new 
iiNumi++)
    {
        
message_begin(MSG_ONESayText,_players[i])
        
write_byte(id)
        
write_string(Message)
        
message_end()
    }

aashiriftikhar is offline
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 03-12-2013 , 03:45   Re: Can Anyone pls edit this plugin? And Change Steamid to name?
Reply With Quote #2

No, because its non-steam. Non-steam is extremely bad for your life and health.
Podarok is offline
aashiriftikhar
BANNED
Join Date: Mar 2013
Location: Karachi
Old 03-12-2013 , 03:54   Re: Can Anyone pls edit this plugin? And Change Steamid to name?
Reply With Quote #3

Quote:
Originally Posted by Podarok View Post
No, because its non-steam. Non-steam is extremely bad for your life and health.
I Have Non Steam Cs PLs Help
aashiriftikhar is offline
xfirestorm
Member
Join Date: Mar 2012
Old 03-12-2013 , 04:09   Re: Can Anyone pls edit this plugin? And Change Steamid to name?
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?t=143137
xfirestorm is offline
aashiriftikhar
BANNED
Join Date: Mar 2013
Location: Karachi
Old 03-12-2013 , 05:31   Re: Can Anyone pls edit this plugin? And Change Steamid to name?
Reply With Quote #5

Quote:
Originally Posted by xfirestorm View Post
Thank You
aashiriftikhar is offline
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 03-12-2013 , 06:38   Re: Can Anyone pls edit this plugin? And Change Steamid to name?
Reply With Quote #6

I will remake it when i have free time…
Podarok 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 05:01.


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