Raised This Month: $ Target: $400
 0% 

Need a plugin for Scramble Teams.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ish12321
Veteran Member
Join Date: May 2016
Old 10-27-2016 , 10:14   Re: Need a plugin for Scramble Teams.
Reply With Quote #1

Made in a bit hurry but you can check out ...
PHP Code:
/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
// #include <amxmisc>
#include <cstrike>
// #include <engine>
// #include <fakemeta>
// #include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "New Plug-In"
#define VERSION "1.0"
#define AUTHOR  "Author"

new PvOTES;
new 
NvOTES;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("/scramble""scramble");
    
// Add your code here...
}

public 
scramble()
{
    
PvOTES 0;
    
NvOTES 0;

    new 
iMenu menu_create("Scramble Teams?""iMenu_Handler");
    
menu_additem(iMenu"Yes");
    
menu_additem(iMenu"No");

    new 
players[32], numplayer;
    
get_players(playersnum);
    for(new 
inumi++)
    {
        
player players[i]
        
menu_display(playeriMenu);
    }

    
set_task(20.0"Scramble_Start");
}
public 
iMenu_Hadler(idmenuitem)
{
    switch(
item)
    {
        case 
0:
        {
            
PvOTES++
        }
        case 
1:
        {
            
NvOTES++
        }
    }
}

public 
Scramble_Start()
{
    if(!(
PvOTES NvOTES))
    {
        return;
    }

    new 
players[32], numplayer;
    
get_players(playersnum);
    for(new 
inumi++)
    {
        
player players[i]
        new 
team random_num(01);
        switch(
team)
        {
            case 
cs_set_user_team(playerCS_TEAM_CT);
            case 
cs_set_user_team(playerCS_TEAM_T);
        }
    }

__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here

Last edited by ish12321; 10-27-2016 at 10:54.
ish12321 is offline
ish12321
Veteran Member
Join Date: May 2016
Old 10-28-2016 , 07:46   Re: Need a plugin for Scramble Teams.
Reply With Quote #2

HELP NEEDED !
This sends sometimes all users to CT or T
Any way to scramble but make team equal, i.e., the team of 7x7 should remain 7x7 even after scramble
PHP Code:
public Scramble_Start()
{
    if(!(
PvOTES NvOTES))
    {
        return;
    }

    
ChatPrint(0"%L"LANG_PLAYER"SCRAMBLING"TAG,  PvOTESNvOTES);

    new 
players[32], numplayer;
    
get_players(playersnum);

    for(new 
inumi++)
    {
        
player players[i]
        new 
team random_num(01);
        switch(
team)
        {
            case 
:
            {
                
cs_set_user_team(playerCS_TEAM_CT);
            }
            case 
:
            {
                
cs_set_user_team(playerCS_TEAM_T);
            }
        }
    }

__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 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 09:37.


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