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

Solved [CS:GO] Request plugin move player ...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 06-22-2018 , 07:57   [CS:GO] Request plugin move player ...
Reply With Quote #1

hi guys!
i need plugin for move player by admins from spec to ct and tr !!

example:
!spec name
!ct name
!tr name

Last edited by Dr.Mohammad; 06-23-2018 at 16:22.
Dr.Mohammad is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-22-2018 , 08:12   Re: [CS:GO] Request plugin move player ...
Reply With Quote #2

PHP Code:
#include <sourcemod>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_spec"Cmd_Spec);
    
    
RegConsoleCmd("sm_ct"Cmd_Ct);
    
    
RegConsoleCmd("sm_t"Cmd_T);
}

public 
Action Cmd_Spec(int iClientint iArgs)
{
    
char sArg[256];
    
GetCmdArgString(sArgsizeof(sArg));
    
    
int iTarget FindTarget(iClientsArg);

    if (
IsClientInGame(iTarget))
    {
        if (
GetClientTeam(iTarget != 1))
            
ChangeClientTeam(iTarget1);
        
        else
            
PrintToChat(iClient"The target is already in the desired team!");
    }
}

public 
Action Cmd_Ct(int iClientint iArgs)
{
    
char sArg[256];
    
GetCmdArgString(sArgsizeof(sArg));
    
    
int iTarget FindTarget(iClientsArg);
    
    if (
IsClientInGame(iTarget))
    {
        if (
GetClientTeam(iTarget != 3))
            
ChangeClientTeam(iTarget3);
        
        else
            
PrintToChat(iClient"The target is already in the desired team!");
    }
}

public 
Action Cmd_T(int iClientint iArgs)
{
    
char sArg[256];
    
GetCmdArgString(sArgsizeof(sArg));
    
    
int iTarget FindTarget(iClientsArg);
    
    if (
IsClientInGame(iTarget))
    {
        if (
GetClientTeam(iTarget != 2))
            
ChangeClientTeam(iTarget2);
        
        else
            
PrintToChat(iClient"The target is already in the desired team!");
    }

mug1wara is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 06-22-2018 , 08:28   Re: [CS:GO] Request plugin move player ...
Reply With Quote #3

Quote:
Originally Posted by mug1wara View Post
PHP Code:
#include <sourcemod>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_spec"Cmd_Spec);
    
    
RegConsoleCmd("sm_ct"Cmd_Ct);
    
    
RegConsoleCmd("sm_t"Cmd_T);
}

public 
Action Cmd_Spec(int iClientint iArgs)
{
    
char sArg[256];
    
GetCmdArgString(sArgsizeof(sArg));
    
    
int iTarget FindTarget(iClientsArg);

    if (
IsClientInGame(iTarget))
    {
        if (
GetClientTeam(iTarget != 1))
            
ChangeClientTeam(iTarget1);
        
        else
            
PrintToChat(iClient"The target is already in the desired team!");
    }
}

public 
Action Cmd_Ct(int iClientint iArgs)
{
    
char sArg[256];
    
GetCmdArgString(sArgsizeof(sArg));
    
    
int iTarget FindTarget(iClientsArg);
    
    if (
IsClientInGame(iTarget))
    {
        if (
GetClientTeam(iTarget != 3))
            
ChangeClientTeam(iTarget3);
        
        else
            
PrintToChat(iClient"The target is already in the desired team!");
    }
}

public 
Action Cmd_T(int iClientint iArgs)
{
    
char sArg[256];
    
GetCmdArgString(sArgsizeof(sArg));
    
    
int iTarget FindTarget(iClientsArg);
    
    if (
IsClientInGame(iTarget))
    {
        if (
GetClientTeam(iTarget != 2))
            
ChangeClientTeam(iTarget2);
        
        else
            
PrintToChat(iClient"The target is already in the desired team!");
    }

thank you, but i need this command for admin:

PHP Code:
public void OnPluginStart()
{
    
RegAdminCmd("sm_spec"Cmd_SpecADMFLAG_ROOT"sm_spec <target>");
    
    
RegAdminCmd("sm_ct"Cmd_CtADMFLAG_ROOT"sm_ct <target>");
    
    
RegAdminCmd("sm_tr"Cmd_TADMFLAG_ROOT"sm_tr <target>");
}
.
.
..... 
also, can you create menu for move player from spec to ct and tr ؟؟
:X :X

Last edited by Dr.Mohammad; 06-22-2018 at 08:32.
Dr.Mohammad is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-22-2018 , 09:32   Re: [CS:GO] Request plugin move player ...
Reply With Quote #4

Ignore the other code I've sent. Not working.

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

int g_iTarget[MAXPLAYERS 1];

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_move"Cmd_MoveADMFLAG_ROOT);
    
    
LoadTranslations("common.phrases");
}

public 
Action Cmd_Move(int iClientint iArgs)
{
    
char sArgs[32]; 
    
GetCmdArg(1sArgssizeof(sArgs)); 
    
    
g_iTarget[iClient] = FindTarget(iClientsArgs);
    
    if (
IsClientInGame(iClient))
    {
        
Menu hMenu = new Menu(Menu_Handler);
        
        
hMenu.SetTitle("Select Your Action");
        
        
hMenu.AddItem("""Move to CT");
        
hMenu.AddItem("""Move to T");
        
hMenu.AddItem("""Move to Spec");
        
        
hMenu.Display(iClientMENU_TIME_FOREVER);
    }
    
    return 
Plugin_Continue;
}

public 
int Menu_Handler(Menu hMenuMenuAction hActionint iClientint iParam)
{
    switch (
hAction)
    {
        case 
MenuAction_Select:
        {
            if (
IsClientInGame(iClient))
            {
                switch (
iParam)
                {
                    case 
0ChangeClientTeam(g_iTarget[iClient], 3);
                    
                    case 
1ChangeClientTeam(g_iTarget[iClient], 2);
                    
                    case 
2ChangeClientTeam(g_iTarget[iClient], 1);
                }
            }
        }
        
        case 
MenuAction_End:
            
delete hMenu;
    }

mug1wara is offline
Zyten
Senior Member
Join Date: Jan 2018
Old 06-22-2018 , 10:09   Re: [CS:GO] Request plugin move player ...
Reply With Quote #5

https://forums.alliedmods.net/showthread.php?p=2041122
Zyten is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 06-22-2018 , 10:36   Re: [CS:GO] Request plugin move player ...
Reply With Quote #6

Quote:
Originally Posted by Zyten View Post
i used this plugin but only move to spec !!
i need move player from spec to ct and tr.
Dr.Mohammad is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 06-22-2018 , 10:40   Re: [CS:GO] Request plugin move player ...
Reply With Quote #7

Quote:
Originally Posted by mug1wara View Post
Ignore the other code I've sent. Not working.

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

int g_iTarget[MAXPLAYERS 1];

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_move"Cmd_MoveADMFLAG_ROOT);
    
    
LoadTranslations("common.phrases");
}

public 
Action Cmd_Move(int iClientint iArgs)
{
    
char sArgs[32]; 
    
GetCmdArg(1sArgssizeof(sArgs)); 
    
    
g_iTarget[iClient] = FindTarget(iClientsArgs);
    
    if (
IsClientInGame(iClient))
    {
        
Menu hMenu = new Menu(Menu_Handler);
        
        
hMenu.SetTitle("Select Your Action");
        
        
hMenu.AddItem("""Move to CT");
        
hMenu.AddItem("""Move to T");
        
hMenu.AddItem("""Move to Spec");
        
        
hMenu.Display(iClientMENU_TIME_FOREVER);
    }
    
    return 
Plugin_Continue;
}

public 
int Menu_Handler(Menu hMenuMenuAction hActionint iClientint iParam)
{
    switch (
hAction)
    {
        case 
MenuAction_Select:
        {
            if (
IsClientInGame(iClient))
            {
                switch (
iParam)
                {
                    case 
0ChangeClientTeam(g_iTarget[iClient], 3);
                    
                    case 
1ChangeClientTeam(g_iTarget[iClient], 2);
                    
                    case 
2ChangeClientTeam(g_iTarget[iClient], 1);
                }
            }
        }
        
        case 
MenuAction_End:
            
delete hMenu;
    }

thank you very much.
can you add to admin menu and create player list for select team??

Last edited by Dr.Mohammad; 06-22-2018 at 10:49.
Dr.Mohammad is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-22-2018 , 10:51   Re: [CS:GO] Request plugin move player ...
Reply With Quote #8

If so, tomorrow, celebrating midsummer at the moment.
mug1wara is offline
KlausLaw
AlliedModders Donor
Join Date: Feb 2018
Location: Israel
Old 06-22-2018 , 19:46   Re: [CS:GO] Request plugin move player ...
Reply With Quote #9

PHP Code:
#define PLUGIN_AUTHOR "Klaus"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>



public Plugin myinfo 
{
    
name "MoveTeam"
    
author PLUGIN_AUTHOR
    
description "Allows admins to change players team"
    
version PLUGIN_VERSION
    
url "https://steamcommunity.com/id/KlausLaw/"
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_move"SM_MoveADMFLAG_BAN);
}

public 
Action SM_Move(int clientint args)
{
    
Menu menu = new Menu(Menu_PlayersList);
    
menu.SetTitle("[MoveTeam] - Select a player\n \n");
    
char sInfo[12], sName[MAX_NAME_LENGTH];
    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i))continue;
        
IntToString(isInfosizeof(sInfo));
        
GetClientName(isNamesizeof(sName));
        
menu.AddItem(sInfosName);
    }
    
menu.Display(clientMENU_TIME_FOREVER);
    return 
Plugin_Handled;
}

public 
int Menu_PlayersList(Menu menuMenuAction actionint clientint Position)
{
    if (
action == MenuAction_Select)
    {
        
char item[12];
        
menu.GetItem(Positionitemsizeof(item));
        
int target StringToInt(item);
        
char sInfo[24];
        
Menu moveMenu = new Menu(Menu_MoveMenu);
        
moveMenu.SetTitle("[MoveTeam] - Select a team\n \n");
        
Format(sInfosizeof(sInfo), "%d-3"target);
        
moveMenu.AddItem(sInfo"CT Team");
        
Format(sInfosizeof(sInfo), "%d-2"target);
        
moveMenu.AddItem(sInfo"T Team");
        
Format(sInfosizeof(sInfo), "%d-1"target);
        
moveMenu.AddItem(sInfo"Spec Team");
        
moveMenu.Display(clientMENU_TIME_FOREVER);
        
    }
    if (
action == MenuAction_End)
    {
        
delete menu;
    }
}

public 
int Menu_MoveMenu(Menu menuMenuAction actionint clientint Position)
{
    if (
action == MenuAction_Select)
    {
        
char infoExploded[2][12];
        
char item[24];
        
menu.GetItem(Positionitemsizeof(item));
        
ExplodeString(item"-"infoExplodedsizeof(infoExploded), sizeof(infoExploded[]));
        
int target StringToInt(infoExploded[0]);
        
int team StringToInt(infoExploded[1]);
        
ChangeClientTeam(targetteam);
        
    }
    if (
action == MenuAction_End)
    {
        
delete menu;
    }

__________________
Taking private requests


Last edited by KlausLaw; 06-22-2018 at 19:47.
KlausLaw is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 06-22-2018 , 22:08   Re: [CS:GO] Request plugin move player ...
Reply With Quote #10

Quote:
Originally Posted by KlausLaw View Post
PHP Code:
#define PLUGIN_AUTHOR "Klaus"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>



public Plugin myinfo 
{
    
name "MoveTeam"
    
author PLUGIN_AUTHOR
    
description "Allows admins to change players team"
    
version PLUGIN_VERSION
    
url "https://steamcommunity.com/id/KlausLaw/"
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_move"SM_MoveADMFLAG_BAN);
}

public 
Action SM_Move(int clientint args)
{
    
Menu menu = new Menu(Menu_PlayersList);
    
menu.SetTitle("[MoveTeam] - Select a player\n \n");
    
char sInfo[12], sName[MAX_NAME_LENGTH];
    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i))continue;
        
IntToString(isInfosizeof(sInfo));
        
GetClientName(isNamesizeof(sName));
        
menu.AddItem(sInfosName);
    }
    
menu.Display(clientMENU_TIME_FOREVER);
    return 
Plugin_Handled;
}

public 
int Menu_PlayersList(Menu menuMenuAction actionint clientint Position)
{
    if (
action == MenuAction_Select)
    {
        
char item[12];
        
menu.GetItem(Positionitemsizeof(item));
        
int target StringToInt(item);
        
char sInfo[24];
        
Menu moveMenu = new Menu(Menu_MoveMenu);
        
moveMenu.SetTitle("[MoveTeam] - Select a team\n \n");
        
Format(sInfosizeof(sInfo), "%d-3"target);
        
moveMenu.AddItem(sInfo"CT Team");
        
Format(sInfosizeof(sInfo), "%d-2"target);
        
moveMenu.AddItem(sInfo"T Team");
        
Format(sInfosizeof(sInfo), "%d-1"target);
        
moveMenu.AddItem(sInfo"Spec Team");
        
moveMenu.Display(clientMENU_TIME_FOREVER);
        
    }
    if (
action == MenuAction_End)
    {
        
delete menu;
    }
}

public 
int Menu_MoveMenu(Menu menuMenuAction actionint clientint Position)
{
    if (
action == MenuAction_Select)
    {
        
char infoExploded[2][12];
        
char item[24];
        
menu.GetItem(Positionitemsizeof(item));
        
ExplodeString(item"-"infoExplodedsizeof(infoExploded), sizeof(infoExploded[]));
        
int target StringToInt(infoExploded[0]);
        
int team StringToInt(infoExploded[1]);
        
ChangeClientTeam(targetteam);
        
    }
    if (
action == MenuAction_End)
    {
        
delete menu;
    }

good job ,thank you !!

how to can i return menu to player list ?? after select player team ??
Dr.Mohammad is offline
Reply


Thread Tools
Display Modes

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:45.


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