Raised This Month: $ Target: $400
 0% 

[ANY] Move Players Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author
cristian20042
AlliedModders Donor
Join Date: Jun 2016
Location: Romania
Plugin ID:
5421
Plugin Version:
1.0.3
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Move a player to any team.
    Old 11-20-2016 , 08:10   [ANY] Move Players Plugin
    Reply With Quote #1

    I made a simple plugin that move players to a specific team !

    Plugin Description :

    Move a player to a specific team and the players can join automaticaly a team.

    Plugin Commands :

    sm_t - Move player to terrorist team.
    sm_ct - Move player to counter-terrorist team.
    sm_spec - Move player to spec team.

    sm_joint - Move player to terrorist team.
    sm_joinct - Move player to counter-terrorist team.
    sm_joinspec - Move player to spec team.

    Changelogs :
    Code:
    - 1.0.3 - Rewrite of plugin (Helping with rewrite Grey83)
    - 1.0.2 - Updated the code again :D (Thanks Grey83 for help :))
    - 1.0.1 - A little change of script (Thanks shanapu for helping)
    - 1.0.0 - RELEASE.
    NOTE : The admins needs flag ADMFLAG_SLAY to move players.

    AND ALSO MAKE A REPLY IF THERE IS A BUG OR WHAT CAN I ADD !
    Attached Files
    File Type: sp Get Plugin or Get Source (moveplayers 1.0.3.sp - 2366 views - 4.1 KB)

    Last edited by cristian20042; 07-31-2018 at 17:57. Reason: Updated Script (1.0.3)
    cristian20042 is offline
    shanapu
    Veteran Member
    Join Date: Apr 2015
    Location: .de
    Old 11-20-2016 , 09:20   Re: [ANY] Move Players Plugin
    Reply With Quote #2

    Quote:
    Originally Posted by cristian20042 View Post
    AND ALSO MAKE A REPLY IF THERE IS A BUG OR WHAT CAN I ADD !
    first fast look, you dont need this:
    PHP Code:
    #define T_TEAM    2
    #define CT_TEAM   3
    #define SPEC_TEAM 1
    #define NONE_TEAM 0 
    cause it's already defined in #include <cstrike>
    https://github.com/alliedmodders/sou...ke.inc#L38-L41

    And you mixing old with new syntax. That's not good.
    Take a look here:
    https://wiki.alliedmods.net/SourcePa...itional_Syntax & https://forums.alliedmods.net/showthread.php?t=244092
    __________________
    coding & free software
    shanapu is offline
    cristian20042
    AlliedModders Donor
    Join Date: Jun 2016
    Location: Romania
    Old 11-20-2016 , 09:39   Re: [ANY] Move Players Plugin
    Reply With Quote #3

    Quote:
    Originally Posted by shanapu View Post
    first fast look, you dont need this:
    PHP Code:
    #define T_TEAM    2
    #define CT_TEAM   3
    #define SPEC_TEAM 1
    #define NONE_TEAM 0 
    cause it's already defined in #include <cstrike>
    https://github.com/alliedmodders/sou...ke.inc#L38-L41

    And you mixing old with new syntax. That's not good.
    Take a look here:
    https://wiki.alliedmods.net/SourcePa...itional_Syntax & https://forums.alliedmods.net/showthread.php?t=244092
    Thanks for helping !
    cristian20042 is offline
    Grey83
    Veteran Member
    Join Date: Dec 2014
    Location: Ukraine
    Old 11-20-2016 , 10:09  
    Reply With Quote #4

    Maybe will be better make it in this way?
    Attached Files
    File Type: sp Get Plugin or Get Source (moveplayers.sp - 1022 views - 3.8 KB)
    __________________
    Grey83 is offline
    Divin12
    Senior Member
    Join Date: Nov 2011
    Old 11-20-2016 , 15:48   Re: [ANY] Move Players Plugin
    Reply With Quote #5

    Your plugin need edit, this is good(tested): Public commands in chat !ct !t !spec and admin commands sm_movect name sm_movet name sm_movespec name
    PHP Code:
    #pragma semicolon 1
    #pragma newdecls required

    #include <cstrike>

    static const char TAG[] = "\x04[SM]";

    public 
    Plugin myinfo = {
        
    name        "Move players",
        
    author        "SniperHero",
        
    description    "Move players to specific team.",
        
    version        "1.0.1",
        
    url            "https://forums.alliedmods.net/showthread.php?t=290675"
    };

    public 
    void OnPluginStart()
    {
        
    RegConsoleCmd("sm_t"Command_joint"You are going to terrorist team.");
        
    RegConsoleCmd("sm_ct"Command_joinct"You are going to counter-terrorist team.");
        
    RegConsoleCmd("sm_spec"Command_joinspec"You are going to counter-terrorist team.");
        
    RegAdminCmd("sm_movespec"Command_specADMFLAG_SLAY"Move a player to the spectators team.");
        
    RegAdminCmd("sm_movet"Command_tADMFLAG_SLAY"Move a player to the terrorist team.");
        
    RegAdminCmd("sm_movect"Command_ctADMFLAG_SLAY"Move a player to the counter-terrorist team.");
    }

    public 
    Action Command_t(int clientint args)
    {
        if(
    args 1)
        {
            
    ReplyToCommand(client"%s \x01Usage: sm_movet <target>"TAG);
            return 
    Plugin_Handled;
        }

        
    char arg1[64];
        
    GetCmdArg(1arg1sizeof(arg1));
        
    int target FindTarget(clientarg1true); //Find the target(no bots, immunity check)

        
    if(GetClientTeam(target) == CS_TEAM_T)
        {
            
    ReplyToCommand(client"%s %N it's already at terrorist team!"TAGtarget);
        }
        else
        {
            
    ShowActivity2(clientTAG"Admin \x02%N \x01moved player \x02%N \x01to the \x03terrorist \x01team."clienttarget);
            
    ChangeClientTeam(targetCS_TEAM_T);
        }
        return 
    Plugin_Handled;
    }

    public 
    Action Command_ct(int clientint args)
    {
        if(
    args 1)
        {
            
    ReplyToCommand(client"%s \x01Usage: sm_movect <target>"TAG);
            return 
    Plugin_Handled;
        }

        
    char arg1[64];
        
    GetCmdArg(1arg1sizeof(arg1));
        
    int target FindTarget(clientarg1truefalse); //Find the target(no bots, no immunity check)

        
    if(GetClientTeam(target) == CS_TEAM_CT)
        {
            
    ReplyToCommand(client"%s %N it's already at counter-terrorist team !"TAGtarget);
        }
        else
        {
            
    ShowActivity2(clientTAG"Admin \x01%N \x01moved player \x02%N \x01to the \x03counter-terrorist \x01team."clienttarget);
            
    ChangeClientTeam(targetCS_TEAM_CT);
        }
        return 
    Plugin_Handled;
    }

    public 
    Action Command_spec(int clientint args)
    {
        if(
    args != 1)
        {
            
    ReplyToCommand(client"%s \x01Usage: sm_movespec <target>"TAG);
            return 
    Plugin_Handled;
        }

        
    char arg1[64];
        
    GetCmdArg(1arg1sizeof(arg1));
        
    int target FindTarget(clientarg1truefalse); //Find the target(no bots, no immunity check)
        
    if(GetClientTeam(target) == CS_TEAM_SPECTATOR)
        {
            
    ReplyToCommand(client"%s %N it's already at spectators team !"TAGtarget);
        }
        else
        {
            
    ShowActivity2(clientTAG"Admin \x02%N \x01moved player \x02%N \x01to the \x03spectators \x01team."clienttarget);
            
    ChangeClientTeam(targetCS_TEAM_SPECTATOR);
        }
        return 
    Plugin_Handled;
    }

    public 
    Action Command_joint(int clientint args)
    {
        if(
    GetClientTeam(client) == CS_TEAM_T)
        {
            
    ReplyToCommand(client"%s \x01You are already at terrorist team !"TAG);
        }
        else
        {
            
    ReplyToCommand(client"%s \x01You have entred the terrorist team !"TAG);
            
    ChangeClientTeam(clientCS_TEAM_T);
        }
        return 
    Plugin_Handled;
    }

    public 
    Action Command_joinct(int clientint args)
    {
        if(
    GetClientTeam(client) == CS_TEAM_CT)
        {
            
    ReplyToCommand(client"%s \x01You are already at counter-terrorist team !"TAG);
        }
        else
        {
            
    ReplyToCommand(client"%s \x01You have entred the counter-terrorist team !"TAG);
            
    ChangeClientTeam(clientCS_TEAM_CT);
        }
        return 
    Plugin_Handled;
    }

    public 
    Action Command_joinspec(int clientint args)
    {
        if(
    GetClientTeam(client) == CS_TEAM_SPECTATOR)
        {
            
    ReplyToCommand(client"%s \x01You are already at spectators team !"TAG);
        }
        else
        {
            
    ReplyToCommand(client"%s \x01You have entred the spectators team !"TAG);
            
    ChangeClientTeam(clientCS_TEAM_SPECTATOR);
        }
        return 
    Plugin_Handled;

    Sorry!
    __________________

    Last edited by Divin12; 11-21-2016 at 06:53.
    Divin12 is offline
    Grey83
    Veteran Member
    Join Date: Dec 2014
    Location: Ukraine
    Old 11-20-2016 , 17:29   Re: [ANY] Move Players Plugin
    Reply With Quote #6

    Divin12, don't use tags
    HTML Code:
    [QUOTE][/QUOTE]
    for code, better use tags
    HTML Code:
    [PHP][/PHP]
    __________________
    Grey83 is offline
    luki1412
    Veteran Member
    Join Date: Oct 2008
    Location: OnPluginStart()
    Old 11-20-2016 , 18:00   Re: [ANY] Move Players Plugin
    Reply With Quote #7

    Any - in the title
    Csgo - plugin game
    Cstrike - include
    Css/csgo - commands

    Yet if properly coded, it can work on almost any game.
    __________________
    luki1412 is offline
    Divin12
    Senior Member
    Join Date: Nov 2011
    Old 11-21-2016 , 07:27   Re: [ANY] Move Players Plugin
    Reply With Quote #8

    Grey can you edit my plugin for public comands !t !ct !spec to work only with team differente. Let me explain:
    10(terro) vs 12(ct) in this case ct can use !t but t can't use !ct to go to CT
    __________________
    Divin12 is offline
    cristian20042
    AlliedModders Donor
    Join Date: Jun 2016
    Location: Romania
    Old 11-21-2016 , 08:36   Re: [ANY] Move Players Plugin
    Reply With Quote #9

    Quote:
    Originally Posted by Divin12 View Post
    Grey can you edit my plugin for public comands !t !ct !spec to work only with team differente. Let me explain:
    10(terro) vs 12(ct) in this case ct can use !t but t can't use !ct to go to CT
    1. There isn't the Gamplay/Plugin ideas or requests section.
    2. That is not your plugin if you edited 2 or 3 lines.

    EDIT : 3. If you want that you can get team count like this :
    Code:
    new tcount = GetTeamClientCount(CS_TEAM_T);
    new ctcount = GetTeamClientCount(CS_TEAM_CT);
    And after that you can make something like this :
    Code:
    if (tcount < ctcount)
    {
    }
    And here at the
    {
    }
    You can add the command like this :

    Code:
        if (tcount < ctcount) 
        { 
             
        char arg1[64]; 
        GetCmdArg(1, arg1, sizeof(arg1)); 
        int target = FindTarget(client, arg1, true); //Find the target(no bots, immunity check) 
    
        if(GetClientTeam(target) == CS_TEAM_T) 
        { 
            ReplyToCommand(client, "%s %N it's already at terrorist team!", TAG, target); 
        } 
        else 
        { 
            ShowActivity2(client, TAG, "Admin \x02%N \x01moved player \x02%N \x01to the \x03terrorist \x01team.", client, target); 
            ChangeClientTeam(target, CS_TEAM_T); 
        } 
        
        }
        return Plugin_Handled;

    Last edited by cristian20042; 11-21-2016 at 08:41.
    cristian20042 is offline
    Divin12
    Senior Member
    Join Date: Nov 2011
    Old 11-21-2016 , 09:01   Re: [ANY] Move Players Plugin
    Reply With Quote #10

    "That is not your plugin if you edited 2 or 3 lines."
    Who said this plugin is mine if I edit 2-3 lines? ))
    __________________
    Divin12 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 11:28.


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