Easy MIX Plugin - PunkServer MIX

Shadowless

Пользователь
Регистрация
24 Фев 2019
Сообщения
237
Симпатии
4
Пол
Мужской
its a cw/pug/mix menu --> Easy MIX Plugin - PunkServer MIX
as i understend its need for work --> Exec by ToXiC

but anyway it does not work
TAG on nicks its changing only one or two nicknames
else
all to spec, its shows in scoreboard nicks are in spectator but players are not

may be better remove amx_execall or replace it with something other, i dunno so much...

//
// 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: ricardo.offspring@hotmail.com
//
//

#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 */

}


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/


/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

public plugin_init() {
register_plugin("Exec","1.0","ToXiC")
register_clcmd("amx_execclient","amx_exec",ADMIN_LEVEL_A,"< name > < command >")
register_clcmd("amx_execall","amx_exec",ADMIN_LEVEL_A,"< command >")
register_clcmd("amx_execteam","amx_exec",ADMIN_LEVEL_A,"< team name > < command >")
register_srvcmd("amx_execclient","amx_exec")
register_srvcmd("amx_execall","amx_exec")
register_srvcmd("amx_execteam","amx_exec")

return PLUGIN_CONTINUE
}
public amx_exec(id) {
if(!(get_user_flags(id)&ADMIN_LEVEL_A) && id) {
client_print(id,print_console,"[AMXX] Access Denied")
return PLUGIN_HANDLED
}
new cmd[32]
read_argv(0,cmd,32)
replace(cmd,32,"amx_exec","")
if(equal(cmd,"all")) {
new toexec[32]
read_args(toexec,32)
client_cmd(0,toexec)
id ? client_print(id,print_console,"[AMXX] Succeeded") : server_print("[AMXX] Succeeeded")
}
else if(equal(cmd,"client")) {
new text[64], name[32]
read_args(text,64)
parse(text,name,32)
new cid = find_player("lb",name)
if (!cid) {
id ? client_print(id,print_console,"[AMXX] Client with that part of name not found") : server_print("[AMXX] Client with that part of name not found")
return PLUGIN_HANDLED
}
new length = strlen(name)
new message[64]
read_args(message,64)
client_cmd(cid,message[length])
}
else if(equal(cmd,"team")) {
new text[64], tname[32]
read_args(text,64)
parse(text,tname,32)
new players[32], pNum
get_players(players,pNum,"e",tname)
new length = strlen(tname)
new message[64]
read_args(message,64)
for(new i = 0; i<pNum;i++)
client_cmd(players,message[length])
}
return PLUGIN_HANDLED
}



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
 
Сверху Снизу