Raised This Month: $193 Target: $400
 48% 

PunkServer Easy Mix - REWRITEN


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management        Approver:   Hawk552 (427)
OffspringBR
Junior Member
Join Date: Jul 2008
Location: Brazil
Old 10-12-2008 , 20:57   PunkServer Easy Mix - REWRITEN
Reply With Quote #1

I've rewriten this plugin, the old one was bugged and got unapproved, this one works 100%!
WORKS ONLY WITH COUNTER-STRIKE MOD!

Plugin: PunkServer - MIX ®
Lang Suport: English ,Brazilian Portguese and Español(Special Thx to
AntiBots )
Created by: OffspringBR [ Ricardo de Lima Thomaz ]
Join: punk-server.servegame.com:27015

PunkServer Addons v1.3 : www.punk-server.vai.la
What the Plugin does?

You can SET Tags for the Teams
You can send EVERYONE to SPECTATE
You can SORT the Players TEAM
You can Start a MIX


This is my first plugin! I had this Idea after looking for some plugin that helps me making
a Mix on my server. I don't know if MIX is Known in the whole world, so I'm going to explain
it!

MIX: Is a gameplay just like a CF, a CPL but with random Players and a sorted team. It is
played with 5 Players on wich team.
The Configs are down here. . .

Commands:
you can just use /mix on the Chat [ say and say_team ]
or you can do it manual,
Execute TAG: punkserver_tag
Execute MIX: punkserver_mix
All To Spec: punkserver_allspec
Sort Team: punkserver_sortteam

The configs CVAR are:
Define the Counter-Terrorist TEAM TAG: amx_mix_tagCT <tag>
Define the Terrorist TEAM TAG: amx_mix_tagTR <tag>
Define the Side of the TAG: amx_lado_tag 0/1 [ for LEFT/RIGHT ]

Fell Free for translating for your own lang. EDIT the punkserver_lang.txt

READ THIS:
Now the configs of Mix can be changed by a .cfg file.

How to set the configs?
Create a file named mix.cfg at you counter-strike server Folder, in the same place of server.cfg

in this file you have to put the Config you want to.

Here is the cfg I use.

Code:
mp_autokick 0
mp_autocrosshair 0
mp_autoteambalance 0
mp_buytime 0.25
mp_consistency 1
mp_c4timer 35
mp_fadetoblack 0
mp_falldamage 0
mp_flashlight 1
mp_forcecamera 3
mp_friendlyfire 1
mp_freezetime 6
mp_fraglimit 0
mp_hostagepenalty 0
mp_limitteams 6
mp_logfile 1
mp_logmessages 1
mp_logdetail 3
mp_maxrounds 15
mp_playerid 0
mp_roundtime 1.75
mp_startmoney 800
mp_timelimit 999
mp_tkpunish 0
mp_winlimit 0
sv_aim 0
sv_airaccelerate 10
sv_airmove 1
sv_allowdownload 0
sv_clienttrace 1.0
sv_clipmode 0
sv_allowupload 0
sv_maxspeed 320
sv_maxupdaterate 101
sys_ticrate 10000
decalfrequency 60
pausable 0
log on
decalfrequency 60
edgefriction 2
host_framerate 0
exec listip.cfg
exec banned.cfg

Sorry if there is any English error


If there is any bug report them to: [email protected]


Code:
//
//    DO NOT CHANGE THE plugin_register
//
//    Plugin: PunkServer - MIX ®
//    Lang Suport: English and Brazilian Portguese
//    Created by: OffspringBR [ Ricardo de Lima Thomaz ]
//    Join: punk-server.servegame.com:27015
//    
//    What the Plugin does?
//    
//    You can SET Tags for the Teams
//    You can send EVERYONE to SPECTATE
//    You can SORT the Players TEAM
//    You can Start a MIX
//    
//    
//    This is my first plugin! I had this Idea after looking for some plugin that helps me making 
//    a Mix on my server. I don't know if MIX is Known in the whole world, so I'm going to explain
//    it!
//    
//    MIX: Is a gameplay just like a CF, a CPL but with random Players and a sorted team. It is 
//    played with 5 Players on wich team.
//    The Configs are down here. . . 
//    
//    Commands:
//    you can just use /mix on the Chat [ say and say_team ]
//    or you can do manual, 
//    Execute TAG: punkserver_tag
//    Execute MIX: punkserver_mix
//    All To Spec: punkserver_allspec
//    Sort Team:   punkserver_sortteam
//    
//    The configs CVAR are:
//    Define the Counter-Terrorist TEAM TAG: amx_mix_tagCT <tag>
//    Define the Terrorist TEAM TAG: amx_mix_tagTR <tag>
//    Define the Side of the TAG: amx_lado_tag 0/1 [ for LEFT/RIGHT ]
//    
//    Fell Free for translating for your own lang. EDIT the punkserver_lang.txt
//    
//    Sorry if there is any English error = X
//
//
//    If there is any bug report them to: [email protected]
//
//    

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new mmixmenu // Menu

new a = 0
new b = 0
new pcvar
new CTpcvar
new TRpcvar
new contador
new contar

public plugin_init() {
    
    register_plugin("Mix TAG", "1.0", "OffspringBR")
    CTpcvar = register_cvar("amx_mix_tagCT", "mIx # ") 
    TRpcvar = register_cvar("amx_mix_tagTR", ">MiX< | ") 
    pcvar = register_cvar("amx_lado_tag", "0")
    register_concmd("punkserver_tag","Tag") 
    register_concmd("punkserver_mix","Mix")
    register_concmd("punkserver_allspec","AllSpec")
    register_concmd("punkserver_sortteam","SortTeam")
    register_concmd("say /mix","MixMenu")
    register_concmd("say_team /mix","MixMenu")
    register_dictionary("punkserver_lang.txt")

    return PLUGIN_CONTINUE
}

public MixMenu(id)
{
    /* Menu Menu - PunkServer Mix */
    /* Use menu_display(id, mMenu-PunkServerMix, 0) to show the menu to an user. */
    
    
    new all_spec[32]
    format(all_spec, 31,"%L", id, "ALL_SPEC")
    new sort_team[32]
    format(sort_team, 31,"%L", id, "SORT_TEAM")
    new turn_on[32]
    if( contador == 1 )
    {
        format(turn_on, 31,"%L [TURNED ON]", id, "TURN_ON")
    }
    else 
    {
        format(turn_on, 31,"%L [TURNED OFF]", id, "TURN_ON")
    }
    new tag_on[32]
    format(tag_on, 32,"%L", id, "TAG_ON")
    /* Menu mixmenu */
    /* Use menu_display(id, mmixmenu, 0) to show the menu to an user. */
    mmixmenu = menu_create("mixmenu", "mh_mixmenu")
    menu_additem(mmixmenu, all_spec, "ma_mixmenu", ADMIN_MENU)
    menu_additem(mmixmenu, sort_team, "ma_mixmenu", ADMIN_MENU)
    menu_additem(mmixmenu, turn_on, "ma_mixmenu", ADMIN_MENU)
    menu_additem(mmixmenu, tag_on, "ma_mixmenu", ADMIN_MENU)
    /* Menu End */

    menu_display(id, mmixmenu, 0)
    

    
    return PLUGIN_HANDLED
}

public Tag(id)
{
    if( is_user_admin(id) )
    {
        return PLUGIN_CONTINUE
    }

    new tagTR[32] 
    new tagCT[32]
    new team[32]
    new nick[32]
    new newnick[32]
    get_pcvar_string(CTpcvar, tagCT, 31)
    get_pcvar_string(TRpcvar, tagTR, 31)
    get_user_team(id,team,31)
    get_user_name(id,nick,31) 

    if( strcmp(team,"@terrorist") == 0 || strcmp(team,"TERRORIST") == 0)
    {
        
    
    if (containi(nick,tagTR) != -1 )
        return PLUGIN_HANDLED 
    if(get_pcvar_num(pcvar))
    {
        format(newnick, 31, "%s%s", nick, tagTR)
        set_user_info(id, "name", newnick)
    }
    else
    {
        format(newnick, 31, "%s%s", tagTR, nick)
        set_user_info(id, "name", newnick)
    }
    server_print("%L",id,"TR_NICK" , nick) 
    client_print(id,print_center,"%L", id, "NICK_CHANGE")

    return PLUGIN_HANDLED
    
    }

    if( strcmp(team,"@counter") == 0 || strcmp(team,"CT") == 0)
    {
        
    
    if (containi(nick,tagCT) != -1 )
        return PLUGIN_HANDLED 
    if(get_pcvar_num(pcvar))
    {
        format(newnick, 31, "%s%s", nick, tagCT)
        set_user_info(id, "name", newnick)
    }
    else
    {
        format(newnick, 31, "%s%s", tagCT, nick)
        set_user_info(id, "name", newnick)
    }
        

    server_print("%L",id,"CT_NICK", nick) 
    client_print(id,print_center,"%L",id,"NICK_CHANGE")

    return PLUGIN_HANDLED
    
    }
    return PLUGIN_HANDLED

}

public Mix(id)
{
    if(contador != 1 && contador != 0)
    {
        server_cmd("exec mix.cfg")
        contador = 1
    }
    else if( contar == 1)
    {
        server_cmd("exec mix.cfg")
        contador = 1    
    }
    else
    {
        server_cmd("exec server.cfg")
        contador = 2
    }
    return PLUGIN_HANDLED
}

public AllSpec(id)
{
    set_hudmessage(255, 0, 0, -1.0, -1.0)
    show_hudmessage(id, "[ %L ]",id, "ALL_SPEC")
    user_silentkill(id)
    cs_set_user_team(id ,CS_TEAM_SPECTATOR,CS_DONTCHANGE)
    return PLUGIN_HANDLED
}

public SortTeam(id)
{
    
    set_hudmessage(0, 255, 0, -1.0, -1.0)
    show_hudmessage(id, "%L", id, "BEING_SORT")

    if(random_num(0,1) == 0)
    {
        if( 2*a <= get_playersnum(0) )
        {
        user_silentkill(id)
        cs_set_user_team(id,CS_TEAM_T,CS_T_LEET)
        a++
        client_print(id,print_chat,"%L",id,"TR_NUM", a)
        }
        else
        {
        user_silentkill(id)
        cs_set_user_team(id,CS_TEAM_CT,CS_CT_URBAN)    
        }
    }
    if(random_num(0,1) == 1)
    {
        if( 2*b <= get_playersnum() )
        {
        user_silentkill(id)
        cs_set_user_team(id,CS_TEAM_CT,CS_CT_URBAN)
        b++
        client_print(id,print_chat,"%L",id,"CT_NUM", b)
        }
        else
        {
        user_silentkill(id)
        cs_set_user_team(id,CS_TEAM_T,CS_T_LEET)    
        }
        
    }
    return PLUGIN_HANDLED
}

public mh_mixmenu(id, menu, item) {
    
    if( item == 0 )
    {
        for(new i = 1; i <= get_maxplayers(); i ++)
        {
            server_print("%d", i)
            if(is_user_connected(i))
            AllSpec(i)
        }
    }
    if( item == 1 )
    {
        for(new i = 1; i <= get_maxplayers(); i ++)
        {
            server_print("%d", i)
            if(is_user_connected(i))
            SortTeam(i)
        }
    }
    if( item == 2 )
    {
        contar++
        Mix(id)
    }
    if( item == 3 )
    {
        for(new i = 1; i <= get_maxplayers(); i ++)
        {
            server_print("%d", i)
            if(is_user_connected(i))
            Tag(i)
        }
    }
}

public ma_mixmenu(id) {
    
    
}
Code:
//"Save it to "/addons/amxmodx/data/lang"" [ save as punkserver_lang.txt ]
[en]
ALL_SPEC     = All Spec
SORT_TEAM     = Sort Teams
TURN_ON        = Turn Mix On
TAG_ON        = Use tag on Teams
TR_NICK        = The nick name of the TERROR ^"%s^" was changed
CT_NICK        = The nick name of the C-T ^"%s^" was changed
NICK_CHANGE    = Your nickname was changed by the Administrator
BEING_SORT    = The Teams are Being Sorted!
TR_NUM        = There are %d Terrorists
CT_NUM        = There are %d Counter-Terrorists



[bp]
ALL_SPEC     = Todos para Spec
SORT_TEAM     = Sortear Times
TURN_ON        = Ligar modo MIX
TAG_ON        = Colocar TAG nos times
TR_NICK        = O Nick do TR ^"%s^" foi mudado
CT_NICK        = O Nick do CT ^"%s^" foi mudado
NICK_CHANGE    = Seu Nick foi mudado pelo administrador!
BEING_SORT    = Os times estao sendo sorteados!
TR_NUM        = Existem %d Terroristas
CT_NUM        = Existem %d Contra-Terroristas

[es]
ALL_SPEC = Todos para Spec
SORT_TEAM = Sortear Equipos
TURN_ON    = Modo MIX Activado
TAG_ON    = Colocar TAG en los Equipos
TR_NICK    = El nick de los TERROR ^"%s^" fue cambiado
CT_NICK    = El nick de los CT ^"%s^" fue cambiado
NICK_CHANGE = Tu nick fue cambiado por el Administrador
BEING_SORT = Sorteo en progreso!
TR_NUM = Existen %d Terrorists
CT_NUM = Existen %d Counter-Terrorists
Thx for everybody!

I hope that you like the plugin!

REWRITEN



Attached Files
File Type: sma Get Plugin or Get Source (punkserver_mix.sma - 2466 views - 6.3 KB)
File Type: txt punkserver_lang.txt (1.2 KB, 1233 views)

Last edited by OffspringBR; 10-13-2008 at 12:02. Reason: Config File.
OffspringBR is offline
Send a message via MSN to OffspringBR
mando127
Veteran Member
Join Date: Dec 2006
Location: virginia
Old 10-12-2008 , 22:23   Re: PunkServer Easy Mix - REWRITEN
Reply With Quote #2

it works gj
__________________
mando127 is offline
Send a message via Skype™ to mando127
xPaw
AMX Mod X Moderator
Join Date: Jul 2008
Old 10-13-2008 , 01:30   Re: PunkServer Easy Mix - REWRITEN
Reply With Quote #3

Quote:
DO NOT CHANGE THE register_plugin
like a kid...
__________________
xPaw is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 10-13-2008 , 09:24   Re: PunkServer Easy Mix - REWRITEN
Reply With Quote #4

Quote:
Originally Posted by xPaw View Post
like a kid...
haha Good Job on the plugin
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
OffspringBR
Junior Member
Join Date: Jul 2008
Location: Brazil
Old 10-13-2008 , 11:47   Re: PunkServer Easy Mix - REWRITEN
Reply With Quote #5

Quote:
Originally Posted by xPaw View Post
like a kid...
Lol!

Sorry about this, but in the others forums I have posted they always get the .sma code and change the name to their name!

It just suck.


Anyway, Thank you guys for the comments.
OffspringBR is offline
Send a message via MSN to OffspringBR
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 10-13-2008 , 11:50   Re: PunkServer Easy Mix - REWRITEN
Reply With Quote #6

Quote:
Originally Posted by OffspringBR View Post

WORKS ONLY WITH COUNTER-STRIKE MOD!
Quote:
Originally Posted by Top of the thread
Modification : ALL
U should probly change this
__________________
minimiller is offline
Send a message via MSN to minimiller
OffspringBR
Junior Member
Join Date: Jul 2008
Location: Brazil
Old 10-13-2008 , 12:02   Re: PunkServer Easy Mix - REWRITEN
Reply With Quote #7

Quote:
Originally Posted by minimiller View Post
U should probly change this
I've changed!

Sorry I was editing and I forgot to put it the MOD back!

thx for reporting.
OffspringBR is offline
Send a message via MSN to OffspringBR
thicomico
Junior Member
Join Date: Aug 2008
Old 10-13-2008 , 15:08   Re: PunkServer Easy Mix - REWRITEN
Reply With Quote #8

Legal ver um BR por aqui, pena que não jogo com arma , jogo outro mod.
Abraço
thicomico is offline
Old 10-13-2008, 17:33
Churchboy587
This message has been deleted by YamiKaitou. Reason: stop doing this
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 10-14-2008 , 17:27   Re: PunkServer Easy Mix - REWRITEN
Reply With Quote #9

Quote:
Originally Posted by thicomico View Post
Legal ver um BR por aqui, pena que não jogo com arma , jogo outro mod.
Abraço
Tem eu tambem. Offspring, melhorou muito, mas ainda axo que voce nao entendeu muito bem a coisa. Por exemplo,voce declarou todas as funcoes como 'public'. Voce so precisa fazer isso para aquelas que sao chamadas por uma string, com em 'set_task', por exemplo. Tomara que seja aprovado, melhorou bem, mas pode melhorar mais.
danielkza is offline
tmen_13
BANNED
Join Date: Sep 2008
Old 10-15-2008 , 15:43   Re: PunkServer Easy Mix - REWRITEN
Reply With Quote #10

tem bug o plugin, quando faço sortear equipas, nao sorteia equilibrado (5vs5), sorteia 7v3 por exemplo.

podia adicionar a opçao para desactivar o am, exepto o este plugin
tmen_13 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 01:30.


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