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

amx_transfer <name or userid or steamid> HELP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SANTO37
Member
Join Date: Aug 2008
Old 06-09-2019 , 10:19   amx_transfer <name or userid or steamid> HELP
Reply With Quote #1

Hello,
I can only use this plugin with nick.
I want to add username and steam.
I'd appreciate it if you could help me.

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>


#define VERSION "1.1"

new amx_show_activity
new TEAM_INVALID[] = "TEAM_INVALID"


public plugin_init() 
{
    
/* Register plugin and author */
    
register_plugin("AMX Transfer"VERSION"Deviance")
    
    
/* Register plugin version by cvar */
    
register_cvar("transfer_version"VERSIONFCVAR_SERVER FCVAR_SPONLY);
    
set_cvar_string("transfer_version"VERSION);
    
    
/* Register admin commands */
    
register_concmd("amx_transfer""cmd_transfer"ADMIN_SLAY,"- <name> <CT/T/Spec> Transfers that player to the specified team")
    
/* Register plugin cvars */
    
amx_show_activity get_cvar_pointer("amx_show_activity");
    
    
/* Register language file */
    
register_dictionary("amx_transfer.txt")
    
}

public 
cmd_transfer(id,level,cid)
{
    
    if(!
cmd_access(idlevelcid2)) 
        return 
PLUGIN_HANDLED;
    
    new 
arg1[32], arg2[32]
    
    
read_argv(1arg131)
    
read_argv(2arg231)
    
    new 
player cmd_target(idarg12)
    
    if(!
player)
        return 
PLUGIN_HANDLED
    
    
new teamname[32]
    
    if(!
strlen(arg2))
    {
        
cs_set_user_team(playercs_get_user_team(player) == CS_TEAM_CT CS_TEAM_T:CS_TEAM_CT)
        
teamname cs_get_user_team(player) == CS_TEAM_CT "Counter-Terrorists":"Terrorists"
    
}
    else
    {
        if(
equali(arg2"T"))
        {
            
cs_set_user_team(playerCS_TEAM_T)
            
teamname "Terrorists"
        
}
        else if(
equali(arg2"CT"))
        {
            
cs_set_user_team(playerCS_TEAM_CT)
            
teamname "Counter-Terrorists"
        
}
        else if(
equali(arg2"SPEC"))
        {
            
user_silentkill(player)
            
cs_set_user_team(playerCS_TEAM_SPECTATOR)
            
teamname "Spectator"
        
}
        else
        {
            
client_print(idprint_console"%L"idTEAM_INVALID)
            return 
PLUGIN_HANDLED
        
}
    }
    
    new 
name[32], admin[32], authid[35]
    
    
get_user_name(idadmin31)
    
get_user_name(playername31)
    
get_user_authid(idauthid34)
    
    switch(
get_pcvar_num(amx_show_activity)) 
    {
        case 
2:    client_print(0print_chat"%L"LANG_PLAYER"TRANSFER_PLAYER_CASE2"adminnameteamname)
        case 
1:    client_print(0print_chat"%L"LANG_PLAYER"TRANSFER_PLAYER_CASE1"nameteamname)
    }
    
    
client_print(playerprint_chat"%L"LANG_PLAYER"TRANSFER_PLAYER_TEAM"teamname)
    
    
console_print(id"%L"id"TRANSFER_PLAYER_CONSOLE"nameteamname)
    
log_amx("%L"LANG_SERVER"TRANSFER_PLAYER_LOG"adminauthidnameteamname)
    return 
PLUGIN_HANDLED
    
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
SANTO37 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-09-2019 , 12:29   Re: amx_transfer <name or userid or steamid> HELP
Reply With Quote #2

AMXX commands can be used by name, userid and SteamID by default when using the cmd_target function. Did you write the SteamID in quotes?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SANTO37
Member
Join Date: Aug 2008
Old 06-09-2019 , 13:09   Re: amx_transfer <name or userid or steamid> HELP
Reply With Quote #3

I tried, but I can't.
SANTO37 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-10-2019 , 04:54   Re: amx_transfer <name or userid or steamid> HELP
Reply With Quote #4

Either you amxmisc include file is corrupted or cmd_access arguments doesn't match or you didn't use quotes as oxcicrom stated.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-10-2019 , 07:03   Re: amx_transfer <name or userid or steamid> HELP
Reply With Quote #5

Post the exact string you're typing in the console.
__________________

Last edited by OciXCrom; 06-10-2019 at 07:03.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SANTO37
Member
Join Date: Aug 2008
Old 06-10-2019 , 17:57   Re: amx_transfer <name or userid or steamid> HELP
Reply With Quote #6

amx_transfer "EDT #SANTO37"
amx_transfer 345 (user id)
amx_transfer STEAMID
SANTO37 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-10-2019 , 21:42   Re: amx_transfer <name or userid or steamid> HELP
Reply With Quote #7

Using the UserID requires the # to denote that it is a UserID (I think this works with or without quotes):

Code:
amx_transfer #345
Using the SteamID requires quotes:

Code:
amx_transfer "STEAM_0:0:1234"
__________________

Last edited by fysiks; 06-10-2019 at 21:43.
fysiks is offline
SANTO37
Member
Join Date: Aug 2008
Old 06-12-2019 , 11:38   Re: amx_transfer <name or userid or steamid> HELP
Reply With Quote #8

I will try this
SANTO37 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 16:31.


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