Raised This Month: $51 Target: $400
 12% 

Solved [CSGO] DangerZone Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-25-2018 , 01:18   [CSGO] DangerZone Manager
Reply With Quote #1

hi guys!
i need team manager for danger zone!
example menu:
HTML Code:
Select Team:
1.Green Team: Dr.mohammad, empty
2.Gray Team: empty, empty
and
.
.
.
example cod:
PHP Code:
char Name[17][64]={};

void TeamMenu(int client)
{
    
Menu menu = new Menu(Menu_HandlerMENU_ACTIONS_ALL);
    
    
menu.SetTitle("Select Team:");
    
menu.AddItem("green""Green Team: %s , %s"Name[0], Name[1]);
    
menu.AddItem("gray""Gray Team: %s , %s"Name[2], Name[3]);
    
menu.AddItem("blue""Blue Team: %s , %s"Name[4], Name[5]);
    
menu.AddItem("purple""Purple Team: %s , %s"Name[6], Name[7]);
    
menu.AddItem("pink""Pink Team: %s , %s"Name[8], Name[9]);
    
menu.AddItem("orange""Orange Team: %s , %s"Name[10], Name[11]);
    
menu.AddItem("yellow""Yellow Team: %s , %s"Name[12], Name[13]);
    
menu.AddItem("red""Red Team: %s , %s"Name[14], Name[15]);
    
menu.AddItem("aqua""Aqua Team: %s , %s"Name[16], Name[17]);
    
menu.ExitButton true;
    
menu.Display(clientMENU_TIME_FOREVER);
}



public 
int Menu_Handler(Menu menuMenuAction actionint clientint item)
{
    
char choice_item[32];
    
menu.GetItem(itemchoice_itemsizeof(choice_item));
    if (
action == MenuAction_Select)
    {
        if (
StrEqual(choice_item"green"))
        {
            
FakeClientCommand(client"dz_jointeam 1");
            
TeamMenu(client);
        }
        if (
StrEqual(choice_item"gray"))
        {
            
FakeClientCommand(client"dz_jointeam 2");
            
TeamMenu(client);
        }
        if (
StrEqual(choice_item"blue"))
        {
            
FakeClientCommand(client"dz_jointeam 3");
            
TeamMenu(client);
        }
        if (
StrEqual(choice_item"purple"))
        {
            
FakeClientCommand(client"dz_jointeam 4");
            
TeamMenu(client);
        }
        if (
StrEqual(choice_item"pink"))
        {
            
FakeClientCommand(client"dz_jointeam 5");
            
TeamMenu(client);
        }
        if (
StrEqual(choice_item"orange"))
        {
            
FakeClientCommand(client"dz_jointeam 6");
            
TeamMenu(client);
        }
        if (
StrEqual(choice_item"yellow"))
        {
            
FakeClientCommand(client"dz_jointeam 7");
            
TeamMenu(client);
        }
        if (
StrEqual(choice_item"red"))
        {
            
FakeClientCommand(client"dz_jointeam 8");
            
TeamMenu(client);
        }
        if (
StrEqual(choice_item"aqua"))
        {
            
FakeClientCommand(client"dz_jointeam 9");
            
TeamMenu(client);
        }
        else
        {
            
TeamMenu(client);
        }
    }

please help!

Last edited by Dr.Mohammad; 12-25-2018 at 15:53.
Dr.Mohammad is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-25-2018 , 05:15   Re: [CSGO] DangerZone Manager
Reply With Quote #2

ok, you do the rest.

PHP Code:
char colors[][] = {
    
"green",
    
"grey",
    
"blue",
    
"purple",
    
"pink",
    
"orange",
    
"yellow",
    
"red",
    
"aqua",
    
"beige"
};

#include <sdktools>



public void OnPluginStart()
{
    
RegConsoleCmd("sm_test"test);
}

public 
Action test(int clientint args)
{

    
ConVar sv_dz_team_count FindConVar("sv_dz_team_count");
    if(
sv_dz_team_count == nullSetFailState("No such Cvar 'sv_dz_team_count'");

    
int team_count sv_dz_team_count.IntValue;


    
delete sv_dz_team_count;




    
int[] m_nSurvivalTeam = new int[MaxClients+1];


    for(
int i 1<= MaxClientsi++)
    {
        
m_nSurvivalTeam[i] = -1// erase

        
if(!IsClientInGame(i)) continue;

        
m_nSurvivalTeam[i] = GetEntProp(iProp_Send"m_nSurvivalTeam"); // update
    
}



    
Menu menu = new Menu(handlerMENU_ACTIONS_DEFAULT);
    
menu.SetTitle("Join Survival Team");

    
int counter// for loop int team_count size
    
char buffer[PLATFORM_MAX_PATH];

    for(
int x 0sizeof(colors); x++)
    {
        
Format(buffersizeof(buffer), "%s:"colors[x]);
        
counter 0;

        for(
int i 1<= MaxClientsi++)
        {
            if(
m_nSurvivalTeam[i] != x) continue;

            
Format(buffersizeof(buffer), "%s (%N)"bufferi);
            
counter++;
        }

        for(; 
counter team_countcounter++) Format(buffersizeof(buffer), "%s ( )"buffer);

        
menu.AddItem(""buffer);
    }


    
menu.Display(client20);
    
PrintToServer("Show menu");


    return 
Plugin_Handled;
}


public 
int handler(Menu menuMenuAction actionint param1int param2)
{
    if(
action == MenuAction_Enddelete menu;

    if(
action == MenuAction_Select)
    {
        
//PrintToServer("param1 %i - param2 %i", param1, param2);
        
FakeClientCommand(param1"dz_jointeam %i"param2+1);
        
test(param10); // dirty re-open menu
    
}

__________________
Do not Private Message @me

Last edited by Bacardi; 12-25-2018 at 05:20. Reason: added re-open menu
Bacardi is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-25-2018 , 06:08   Re: [CSGO] DangerZone Manager
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
ok, you do the rest.

PHP Code:
char colors[][] = {
    
"green",
    
"grey",
    
"blue",
    
"purple",
    
"pink",
    
"orange",
    
"yellow",
    
"red",
    
"aqua",
    
"beige"
};

#include <sdktools>



public void OnPluginStart()
{
    
RegConsoleCmd("sm_test"test);
}

public 
Action test(int clientint args)
{

    
ConVar sv_dz_team_count FindConVar("sv_dz_team_count");
    if(
sv_dz_team_count == nullSetFailState("No such Cvar 'sv_dz_team_count'");

    
int team_count sv_dz_team_count.IntValue;


    
delete sv_dz_team_count;




    
int[] m_nSurvivalTeam = new int[MaxClients+1];


    for(
int i 1<= MaxClientsi++)
    {
        
m_nSurvivalTeam[i] = -1// erase

        
if(!IsClientInGame(i)) continue;

        
m_nSurvivalTeam[i] = GetEntProp(iProp_Send"m_nSurvivalTeam"); // update
    
}



    
Menu menu = new Menu(handlerMENU_ACTIONS_DEFAULT);
    
menu.SetTitle("Join Survival Team");

    
int counter// for loop int team_count size
    
char buffer[PLATFORM_MAX_PATH];

    for(
int x 0sizeof(colors); x++)
    {
        
Format(buffersizeof(buffer), "%s:"colors[x]);
        
counter 0;

        for(
int i 1<= MaxClientsi++)
        {
            if(
m_nSurvivalTeam[i] != x) continue;

            
Format(buffersizeof(buffer), "%s (%N)"bufferi);
            
counter++;
        }

        for(; 
counter team_countcounter++) Format(buffersizeof(buffer), "%s ( )"buffer);

        
menu.AddItem(""buffer);
    }


    
menu.Display(client20);
    
PrintToServer("Show menu");


    return 
Plugin_Handled;
}


public 
int handler(Menu menuMenuAction actionint param1int param2)
{
    if(
action == MenuAction_Enddelete menu;

    if(
action == MenuAction_Select)
    {
        
//PrintToServer("param1 %i - param2 %i", param1, param2);
        
FakeClientCommand(param1"dz_jointeam %i"param2+1);
        
test(param10); // dirty re-open menu
    
}

nice work. nice way

can you show all players online with team name on game? Please add this :X

Last edited by Dr.Mohammad; 12-25-2018 at 06:09.
Dr.Mohammad is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-25-2018 , 06:25   Re: [CSGO] DangerZone Manager
Reply With Quote #4

I'm not sure I have time... but can you tell, show team name where ??
Menu ? Chat ? In names ?? Where ?
Bacardi is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-25-2018 , 06:48   Re: [CSGO] DangerZone Manager
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
I'm not sure I have time... but can you tell, show team name where ??
Menu ? Chat ? In names ?? Where ?
i am very sorry,
example:
HTML Code:
Menu:
1-green:dr.mohammad,bacardi
2-blue:hitman
3-pink:noobplayer

or

chat:
Online players:
[green:dr.mohammad,bacardi][blue:hitman][pink:noobplayer]

Last edited by Dr.Mohammad; 12-25-2018 at 06:48.
Dr.Mohammad is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-25-2018 , 07:53   Re: [CSGO] DangerZone Manager
Reply With Quote #6

ok, you do the rest, again.
PHP Code:
int hexcolors[][] = {
    
4,
    
8,
    
12,
    
3,
    
14,
    
7,
    
9,
    
2,
    
11,
    
16
};

char colors[][] = {
    
"green",
    
"grey",
    
"blue",
    
"purple",
    
"pink",
    
"orange",
    
"yellow",
    
"red",
    
"aqua",
    
"beige"
};

#include <sdktools>



public void OnPluginStart()
{
    
RegConsoleCmd("sm_test"test);
}

public 
Action test(int clientint args)
{
    
char buffer2[254];
    
bool bHavePlayers;

    for(
int x 0sizeof(colors); x++)
    {
        
bHavePlayers false;
        
Format(buffer2sizeof(buffer2), "%02c%s [ "hexcolors[x], colors[x]);

        
//PrintToChatAll(" %02c %s", hexcolors[x], colors[x]);

        
for(int i 1<= MaxClientsi++)
        {
            if(!
IsClientInGame(i)) continue;

            if(
!= GetEntProp(iProp_Send"m_nSurvivalTeam")) continue;

            
Format(buffer2sizeof(buffer2), "%s%N "buffer2i);
            
bHavePlayers true;
        }

        if(
bHavePlayersPrintToChatAll(" \x01TEAM %s ]"buffer2);

    }


    
bHavePlayers false;
    
Format(buffer2sizeof(buffer2), "[ ");

    
//PrintToChatAll(" %02c %s", hexcolors[x], colors[x]);

    
for(int i 1<= MaxClientsi++)
    {
        if(!
IsClientInGame(i)) continue;

        if(-
!= GetEntProp(iProp_Send"m_nSurvivalTeam")) continue;

        
Format(buffer2sizeof(buffer2), "%s%N "buffer2i);
        
bHavePlayers true;
    }

    if(
bHavePlayersPrintToChatAll(" \x01NON-TEAM %s ]"buffer2);




    return 
Plugin_Handled;

__________________
Do not Private Message @me

Last edited by Bacardi; 12-25-2018 at 13:57. Reason: update non-team
Bacardi is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-25-2018 , 12:58   Re: [CSGO] DangerZone Manager
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
ok, you do the rest, again.
PHP Code:
int hexcolors[][] = {
    
4,
    
8,
    
12,
    
3,
    
14,
    
7,
    
9,
    
2,
    
11,
    
16
};

char colors[][] = {
    
"green",
    
"grey",
    
"blue",
    
"purple",
    
"pink",
    
"orange",
    
"yellow",
    
"red",
    
"aqua",
    
"beige"
};

#include <sdktools>



public void OnPluginStart()
{
    
RegConsoleCmd("sm_test"test);
}

public 
Action test(int clientint args)
{
    
char buffer2[254];
    
bool bHavePlayers;

    for(
int x 0sizeof(colors); x++)
    {
        
bHavePlayers false;
        
Format(buffer2sizeof(buffer2), "%02c%s [ "hexcolors[x], colors[x]);

        
//PrintToChatAll(" %02c %s", hexcolors[x], colors[x]);

        
for(int i 1<= MaxClientsi++)
        {
            if(!
IsClientInGame(i)) continue;

            if(
!= GetEntProp(iProp_Send"m_nSurvivalTeam")) continue;

            
Format(buffer2sizeof(buffer2), "%s%N "buffer2i);
            
bHavePlayers true;
        }
        
        if(
bHavePlayersPrintToChatAll(" \x01TEAM %s ]"buffer2);

    }



    return 
Plugin_Handled;

thank you for your time :X

i tested but this not worked.

edit:
this not working??
HTML Code:
] mp_endwarmup_player_count
"mp_endwarmup_player_count" = "6" ( def. "0" ) client replicated                 - Number of players required to be connected to end warmup early. 0 to require max

Last edited by Dr.Mohammad; 12-25-2018 at 13:03.
Dr.Mohammad is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-25-2018 , 13:13   Re: [CSGO] DangerZone Manager
Reply With Quote #8

What are your settings ? Type cvar withouth value.

sm_cvar sv_dz_team_count
sm_cvar sv_dz_jointeam_allowed
Bacardi is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-25-2018 , 13:15   Re: [CSGO] DangerZone Manager
Reply With Quote #9

Quote:
Originally Posted by Bacardi View Post
What are your settings ? Type cvar withouth value.

sm_cvar sv_dz_team_count
sm_cvar sv_dz_jointeam_allowed
sv_dz_team_count "2"
sv_dz_jointeam_allowed "1"
Dr.Mohammad is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-25-2018 , 13:58   Re: [CSGO] DangerZone Manager
Reply With Quote #10

I added non-team printout in chat

https://forums.alliedmods.net/showpo...96&postcount=6
__________________
Do not Private Message @me
Bacardi 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 20:07.


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