Junior Member
Join Date: Jul 2008
Location: Brazil
|
07-31-2008
, 14:35
Easy MIX Plugin - PunkServer MIX
|
#1
|
DO NOT CHANGE THE register_plugin
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
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 <cstrike>
new mmixmenu // Menu
new a = 0
new b = 0
new pcvar
public plugin_init() {
register_plugin("Mix TAG", "1.0", "OffspringBR")
register_cvar("amx_mix_tagCT", "mIx # ")
register_cvar("amx_mix_tagTR", ">MiX< | ")
pcvar = register_cvar("amx_lado_tag", "0")
register_srvcmd("punkserver_tag","TagExec")
register_srvcmd("punkserver_mix","MixExec")
register_srvcmd("punkserver_allspec","AllSpecExec")
register_srvcmd("punkserver_sortteam","SortTeamExec")
register_clcmd("amx_sv_mix","Mix")
register_clcmd("amx_sv_tag","Tag")
register_clcmd("amx_sv_sort","SortTeam")
register_clcmd("amx_sv_spec","AllSpec")
register_clcmd("say /mix","MixMenu")
register_clcmd("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, 32,"%L", id, "ALL_SPEC")
new sort_team[32]
format(sort_team, 32,"%L", id, "SORT_TEAM")
new turn_on[32]
format(turn_on, 32,"%L", 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 TagExec()
{
server_cmd("amx_execall amx_sv_tag")
}
public MixExec()
{
server_cmd("amx_execall amx_sv_mix")
}
public AllSpecExec()
{
server_cmd("amx_execall amx_sv_spec")
}
public SortTeamExec()
{
server_cmd("amx_execall amx_sv_sort")
}
public Tag(id)
{
new tagTR[32]
new tagCT[32]
new team[32]
new nick[32]
get_cvar_string("amx_mix_tagCT",tagCT,31)
get_cvar_string("amx_mix_tagTR",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))
client_cmd(id, "name ^"%s%s^"", nick, tagTR)
else
client_cmd(id, "name ^"%s%s^"", tagTR, nick)
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_cvar_num("amx_lado_tag"))
client_cmd(id, "name ^"%s%s^"", nick, tagCT)
else
client_cmd(id, "name ^"%s%s^"", tagCT, nick)
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)
{
set_hudmessage(255, 0, 0, -1.0, 0.01)
show_hudmessage(id, "MIX [ON]")
set_hudmessage(255, 0, 0, -1.0, 0.01)
show_hudmessage(id, "MIX [ON]")
server_cmd("mp_autokick 0")
server_cmd("mp_autocrosshair 0")
server_cmd("mp_autoteambalance 0")
server_cmd("mp_buytime 0.25")
server_cmd("mp_consistency 1")
server_cmd("mp_c4timer 35")
server_cmd("mp_fadetoblack 0")
server_cmd("mp_falldamage 0")
server_cmd("mp_flashlight 1")
server_cmd("mp_forcecamera 3")
server_cmd("mp_friendlyfire 1")
server_cmd("mp_freezetime 6")
server_cmd("mp_fraglimit 0")
server_cmd("mp_hostagepenalty 0")
server_cmd("mp_limitteams 6")
server_cmd("mp_logfile 1")
server_cmd("mp_logmessages 1")
server_cmd("mp_logdetail 3")
server_cmd("mp_maxrounds 15")
server_cmd("mp_playerid 0")
server_cmd("mp_roundtime 1.75")
server_cmd("mp_startmoney 800")
server_cmd("mp_timelimit 999")
server_cmd("mp_tkpunish 0")
server_cmd("mp_winlimit 0")
server_cmd("sys_ticrate 10000")
client_cmd(id,"kill")
client_print(id,print_center,"Punk-Server MIX [ ON ]")
client_print(id,print_chat,"Punk-Server MIX [ ON ]")
client_print(id,print_center,"Punk-Server MIX [ ON ]")
return PLUGIN_HANDLED
}
public AllSpec(id)
{
set_hudmessage(255, 0, 0, -1.0, -1.0)
show_hudmessage(id, "[ %L ]",id, "ALL_SPEC")
client_cmd(id,"kill")
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) )
{
client_cmd(id,"kill")
cs_set_user_team(id,CS_TEAM_T,CS_T_LEET)
a++
client_print(id,print_chat,"%L",id,"TR_NUM", a)
}
else
{
client_cmd(id,"kill")
cs_set_user_team(id,CS_TEAM_CT,CS_CT_URBAN)
}
}
if(random_num(0,1) == 1)
{
if( 2*b <= get_playersnum(0) )
{
client_cmd(id,"kill")
cs_set_user_team(id,CS_TEAM_CT,CS_CT_URBAN)
b++
client_print(id,print_chat,"%L",id,"CT_NUM", b)
}
else
{
client_cmd(id,"kill")
cs_set_user_team(id,CS_TEAM_T,CS_T_LEET)
}
}
return PLUGIN_HANDLED
}
public mh_mixmenu(id, menu, item) {
/* This event is called when someone presses a key on this menu */
server_print("Botao selecionado %d", item)
if( item == 0 )
{
server_print("Passo no Item 0")
server_cmd("amx_execall amx_sv_spec")
}
if( item == 1 )
{
server_print("Passo no Item 1")
server_cmd("amx_execall amx_sv_sort")
}
if( item == 2 )
{
server_print("Passo no Item 2")
server_cmd("amx_execall amx_sv_mix")
}
if( item == 3 )
{
new team[32]
get_user_team(id,team,31)
server_print("Time %s", team)
server_cmd("amx_execall amx_sv_tag")
}
}
public ma_mixmenu(id) {
/* This event is called when an item was selected */
}
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!
Plz send me suggestions! [ My First plugin! ]
Last edited by OffspringBR; 08-02-2008 at 20:10.
Reason: PCVARS WORKING 100%
|
|