Plugin Cerut: Plugin mix
Descriere (adica ce face el mai exact): Competitie intre 10 jucatori
Serverul impune conditii strict HLDS/REHLDS?: HLDS
Ai cautat pluginul?(daca da, precizeaza cum): Da,dar ce am gasit cu .sma numai merg compilate,da eroare la colorchat si altul mixmenu care l-am gasit nu imi place.
Necesita mod special?: Nu cred
Salut,am nevoie de un plugin de mix cu urmatoarele comenzi:
/start
/stop
/rr
/warm
/knife
/specall
/swap
/extra
/demo player
/stopdemo player
/ct nume
/t nume
/kick
/ban
/map
La acest plugin mai vreau 4 optiuni in plus:
1. Cand se aplica comanda /warm sa fie mod respawn activat iar cand se da /start sa intre in modul de mix.
2. Comanda /stop sa opreasca si mix-ul si functia de /warm
3. Cand scorul ajunge 15-15 sa intre in modul de prelungire 3 din 5 runde cu startmoney de 10000$ si sa inverseze echipele.
Pot oferii 5E daca este functional,tot ce am gasit pana acum numai merg compilate.
Cerere plugin Plugin mix nou
Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com
Forum rules
Accesează link-ul pentru a putea vedea regulile forumului
Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Accesează link-ul pentru a putea vedea regulile forumului
Daca doriti sa vi se modifice un plugin, va rugam postati aici .
- WHOAMI?
- eXtream Mod
- Posts: 999
- Joined: 17 Dec 2013, 19:51
- Detinator Steam: Da
- Reputatie: eXtream Mod
Fost Membru Club eXtreamCS (o luna) - Location: US
- Has thanked: 30 times
- Been thanked: 20 times
Subiect mutat in categoria corespunzatoare, editeaza subiectul dupa urmatorul model sau ajunge la cos. cereri-pluginuri/cererea-unui-plugin-t360605.html
- mr.franta
- Membru, skill +1
- Posts: 277
- Joined: 25 Apr 2015, 18:33
- Detinator Steam: Da
- CS Status: online 24/24 cateodata si noaptea
- Detinator server CS: nu
- SteamID: frantacsgo
- Fond eXtream: 0
- Has thanked: 4 times
- Been thanked: 7 times
- Contact:
Am pus fisierele
- .sma in scriptings
- .amxx in plugins
In config plugins.ini am adaugat
cs_teams_api.amxx;
gather-core.amxx;
Le-am pus fara acele foldere,pentru ca nu vad in cstrike unde anume sunt bin si src si le-am adaugat in plugins/scriptings si config.
- .sma in scriptings
- .amxx in plugins
In config plugins.ini am adaugat
cs_teams_api.amxx;
gather-core.amxx;
Le-am pus fara acele foldere,pentru ca nu vad in cstrike unde anume sunt bin si src si le-am adaugat in plugins/scriptings si config.
- WHOAMI?
- eXtream Mod
- Posts: 999
- Joined: 17 Dec 2013, 19:51
- Detinator Steam: Da
- Reputatie: eXtream Mod
Fost Membru Club eXtreamCS (o luna) - Location: US
- Has thanked: 30 times
- Been thanked: 20 times
Editeaza sursa cu baza de date a ta dupa compileaza.
Code: Select all
new const
HOST[] = "164.132.220.110",
USER[] = "areagame_*** Reclama ***",
PASS[] = "aNK04$c7",
DB[] = "areagame_*** Reclama ***";
- mr.franta
- Membru, skill +1
- Posts: 277
- Joined: 25 Apr 2015, 18:33
- Detinator Steam: Da
- CS Status: online 24/24 cateodata si noaptea
- Detinator server CS: nu
- SteamID: frantacsgo
- Fond eXtream: 0
- Has thanked: 4 times
- Been thanked: 7 times
- Contact:
Nu merge sa il sterg?
Imi eroare la compilare si daca il modific si daca il las asa cum este
Imi eroare la compilare si daca il modific si daca il las asa cum este
- mr.franta
- Membru, skill +1
- Posts: 277
- Joined: 25 Apr 2015, 18:33
- Detinator Steam: Da
- CS Status: online 24/24 cateodata si noaptea
- Detinator server CS: nu
- SteamID: frantacsgo
- Fond eXtream: 0
- Has thanked: 4 times
- Been thanked: 7 times
- Contact:
Nu merge,sunt sigur ca am gresit eu cu ceva.Se poate rezolva cu teamviewer ceva ?
- 1TAP GOD
- Membru, skill +1
- Posts: 152
- Joined: 03 Sep 2018, 00:20
- Detinator Steam: Da
- SteamID: /id/assasinssmdfk
- Fond eXtream: 0
- Has thanked: 16 times
- Been thanked: 16 times
#define MIX_HOST ""
#define MIX_USER ""
#define MIX_PASSWORD ""
#define MIX_DATABASE ""
#define MIX_USER ""
#define MIX_PASSWORD ""
#define MIX_DATABASE ""
Code: Select all
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <engine>
#include <fakemeta_util>
#include <csx>
#include <sqlx>
#if AMXX_VERSION_NUM < 183
#assert AMX Mod X v1.8.3 or later library required!
#endif
#define HOSTNAME "MIX.NAME.RO"
#define PREFIX "MIX"
// Flagul care are acces sa administreze mix-ul
#define FLAG ADMIN_KICK
#define MIX_HOST ""
#define MIX_USER ""
#define MIX_PASSWORD ""
#define MIX_DATABASE ""
#define POINTS_KILL 1
#define POINTS_DEATH -1
#define POINTS_ACE 10
#define POINTS_HS 1
#define POINTS_MINI_ACE 5
#define POINTS_MIX_PLAYED 20
#define POINTS_MIX_LOST -10
#define POINTS_MIX_WON 20
#define POINTS_MIX_DRAW 5
new const g_szInterpCommands[ ][ ] = {
"ex_interp 0.01",
"cl_cmdrate 105",
"rate 25000",
"cl_updaterate 100"
};
new Handle:g_hTuple;
new const szTables[][] =
{
"CREATE TABLE IF NOT EXISTS `mix_players` ( `player_id` varchar(32) NOT NULL, `player_name` varchar(64), `kills` int(16) NOT NULL, `deaths` int(16) NOT NULL, `headshots` int(16), `m_aces` int(16), `aces` int(16), `mix_played` int(16) NOT NULL, `mix_won` int(16) NOT NULL, `mix_lost` int(16) NOT NULL, `mix_draw` int(16) NOT NULL, `points` int(16) NOT NULL, `last_online` varchar(64), PRIMARY KEY (`player_id`) )",
"CREATE TABLE IF NOT EXISTS `mix_guns` ( `gun_id` int(32) NOT NULL, `kills` int(16), PRIMARY KEY (`gun_id`) )",
"CREATE TABLE IF NOT EXISTS `mix_games` ( `id` int(32) NOT NULL AUTO_INCREMENT, `map_name` varchar(64) NOT NULL, `date` varchar(64), `rez_ct` int(16), `rez_t` int(16), PRIMARY KEY (`id`) )"
}
new pKills[33], pDeaths[33], pHeadshots[33], pAces[33], pMiniAces[33], pMixPlayed[33], pMixLost[33], pMixDraw[33], pMixWon[33], pPoints[33], bool:pLoaded[33]
#define isAdmin(%1) (get_user_flags(%1) & FLAG)
new scoreT, scoreCT, serverPassword[64], tempCT, tempT, tempCount
new bool:WarmUp = true, bool:KnifeRound, bool:passwordStatus, bool:canChat = true,bool:PrepareRound
new Kills[33]
new const BlockCmds[][] = {
"amx_unban",
"amx_rcon",
"amx_cvar",
"amxmodmenu"
}
new const Commands[][][] = {
{"menu", "mainMenu"},
{"mixmenu", "mainMenu"},
{"live", "setLive"},
{"rr", "restartRound"},
{"restart", "restartRound"},
{"warm", "warmUP"},
{"warmup", "warmUP"},
{"gg", "endGame"},
{"stop", "endGame"},
{"knife", "setKnife"},
{"knf", "setKnife"},
{"scor", "getScore"},
{"sc", "getScore"},
{"pw", "infoPassword"},
{"prepare", "setPrepare"},
{"setings", "set"},
{"set", "set"}
}
public plugin_init()
{
new szFmt[64]
for(new i = 0; i < sizeof(BlockCmds); i++) {
register_concmd(BlockCmds[i], "BlockConsole")
}
for(new i = 0; i < sizeof(Commands); i++) {
format(szFmt, 63, "say .%s", Commands[i][0])
register_clcmd(szFmt, Commands[i][1])
format(szFmt, 63, "say /%s", Commands[i][0])
register_clcmd(szFmt, Commands[i][1])
format(szFmt, 63, "say !%s", Commands[i][0])
register_clcmd(szFmt, Commands[i][1])
format(szFmt, 63, "say_team .%s", Commands[i][0])
register_clcmd(szFmt, Commands[i][1])
format(szFmt, 63, "say_team /%s", Commands[i][0])
register_clcmd(szFmt, Commands[i][1])
format(szFmt, 63, "say_team !%s", Commands[i][0])
register_clcmd(szFmt, Commands[i][1])
}
register_clcmd("say .choose", "choosePlayers")
register_clcmd("say /choose", "choosePlayers")
register_concmd ( "amx_t", "swap_team", FLAG, "<name> - move player to t" );
register_concmd ( "amx_ct", "swap_team", FLAG, "<name> - move player to ct" );
register_concmd ( "amx_spec", "swap_team", FLAG, "<name> - move player to spec" );
register_clcmd("say .kick", "KickMenu")
register_clcmd("say .maps", "MapsMenu")
register_clcmd("say .leave", "LeaveMenu")
register_clcmd("say .chat", "ChatMenu")
register_clcmd("say .chaton", "ChatMenuNew")
register_clcmd("SetPassword", "_SetPassword")
register_clcmd("say", "hookSay")
server_cmd("sv_password ^"^"")
//register_event( "CurWeapon", "event_CurWeapon", "be","1=1" );
register_event("DeathMsg", "DeathEvent", "a");
RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1 );
register_logevent("RoundEnd", 2, "1=Round_End")
register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")
register_forward(FM_Voice_SetClientListening, "ClientListen");
server_cmd("hostname ^"%s^"", HOSTNAME);
}
public Points(id)
{
client_printcolor(id, "/y[/c%s/y] You have /c%i!",pPoints[id])
}
public BanMenu(id)
{
client_cmd(id, "amx_banmenu");
}
public KickMenu(id)
{
client_cmd(id, "amx_kickmenu");
}
public MapsMenu(id)
{
client_cmd(id, "amx_mapmenu");
}
public ChatMenu(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
canChat = false;
client_printcolor(id, "/y[/c%s/y] Chat is off!", PREFIX)
return PLUGIN_HANDLED
}
public ChatMenuNew(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
canChat = true;
client_printcolor(id, "/y[/c%s/y] Chat is on!", PREFIX)
return PLUGIN_HANDLED
}
public plugin_cfg()
{
set_task(0.5, "MySQLx_Init");
}
public MySQLx_Init()
{
g_hTuple = SQL_MakeDbTuple( MIX_HOST, MIX_USER, MIX_PASSWORD, MIX_DATABASE );
for ( new i = 0; i < sizeof szTables; i++ )
{
SQL_ThreadQuery( g_hTuple, "QuerySetData", szTables[i]);
}
}
public QuerySetData( iFailState, Handle:hQuery, szError[ ], iError, iData[ ], iDataSize, Float:fQueueTime )
{
if( iFailState == TQUERY_CONNECT_FAILED
|| iFailState == TQUERY_QUERY_FAILED )
{
log_amx( "%s", szError );
return;
}
}
public ClientListen(pid /*receiver*/, id /*sender*/) {
if(pid == id) return 1;
if(is_user_connected(id)) {
new szTeam[2];
szTeam[0] = get_pdata_int(id, 114);
szTeam[1] = get_pdata_int(pid, 114);
if(szTeam[0] == szTeam[1] || WarmUp || KnifeRound || PrepareRound) {
engfunc(EngFunc_SetClientListening, pid, id, 1);
return 4;
}
engfunc(EngFunc_SetClientListening, pid, id, 0);
return 4;
}
return 1;
}
public client_connect(id)
{
pKills[id] = 0;
pDeaths[id] = 0;
pHeadshots[id] = 0;
pAces[id] = 0;
pMiniAces[id] = 0;
pMixPlayed[id] = 0;
pMixLost[id] = 0;
pMixDraw[id] = 0;
pMixWon[id] = 0;
pPoints[id] = 0;
pLoaded[id] = false;
LoadPlayerData(id);
}
public InsertGame()
{
new szQuery[3800];
//new year, month, day, hour, minute, second, current_date[128]
new map_name[64];
get_mapname(map_name, 63)
//date(year, month, day);
//time(hour, minute, second);
//format(current_date, 127, "%i-%i-%i %i:%i:%i", year, month, day, hour, minute, second);
formatex( szQuery, 3799, "REPLACE INTO `mix_games` (`map_name`, `date`, `rez_ct`, `rez_t`) VALUES ('%s', NOW(), '%d', '%d');", map_name, scoreCT, scoreT);
SQL_ThreadQuery( g_hTuple, "QuerySetData", szQuery);
}
public InsertWeaponKill(wpnindex)
{
new szQuery[3800];
formatex( szQuery, 3799, "INSERT INTO `mix_guns` (`gun_id`, `kills`) VALUES (%d, 1) ON DUPLICATE KEY UPDATE `kills` = `kills` + 1;", wpnindex);
log_amx(szQuery)
SQL_ThreadQuery( g_hTuple, "QuerySetData", szQuery);
}
public SavePlayer(id)
{
if(!pLoaded[id]) return PLUGIN_HANDLED;
if (pPoints[id] < 0)
pPoints[id] = 0;
new Name[64], steam[64];
get_user_name(id, Name, 63);
get_user_authid(id, steam, 63);
static szQuery[3800];
formatex( szQuery, 3799, "REPLACE INTO `mix_players` (`player_id`, `player_name`, `kills`, `deaths`, `headshots`, `aces`, `m_aces`, `mix_played`, `mix_lost`, `mix_won`, `mix_draw`, `points`, `last_online`) VALUES ('%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', NOW());", steam, GetSecureName(Name), pKills[id], pDeaths[id], pHeadshots[id], pAces[id], pMiniAces[id], pMixPlayed[id], pMixLost[id], pMixWon[id], pMixDraw[id], pPoints[id]);
#if AMXX_VERSION_NUM >= 183
SQL_SetCharset(g_hTuple,"utf8");
#endif
SQL_ThreadQuery( g_hTuple, "QuerySetData", szQuery);
return PLUGIN_CONTINUE;
}
public LoadPlayerData(id)
{
new steam[64];
get_user_authid(id, steam, 63);
static szQuery[ 256 ], iData[ 1 ];
formatex( szQuery, 255, "SELECT * FROM `mix_players` WHERE ( `player_id` = '%s' );", steam );
iData[ 0 ] = id;
SQL_ThreadQuery( g_hTuple, "QuerySelectData", szQuery, iData, 1 );
return PLUGIN_CONTINUE;
}
public QuerySelectData( iFailState, Handle:hQuery, szError[ ], iError, iData[ ], iDataSize, Float:fQueueTime )
{
if( iFailState == TQUERY_CONNECT_FAILED
|| iFailState == TQUERY_QUERY_FAILED )
{
log_amx( "%s", szError );
return;
}
else
{
new id = iData[ 0 ];
new data_kills = SQL_FieldNameToNum(hQuery, "kills");
new data_deaths = SQL_FieldNameToNum(hQuery, "deaths");
new data_headshots = SQL_FieldNameToNum(hQuery, "headshots");
new data_aces = SQL_FieldNameToNum(hQuery, "aces");
new data_mini_aces = SQL_FieldNameToNum(hQuery, "m_aces");
new data_mix_played = SQL_FieldNameToNum(hQuery, "mix_played");
new data_mix_lost = SQL_FieldNameToNum(hQuery, "mix_lost");
new data_mix_draw = SQL_FieldNameToNum(hQuery, "mix_draw");
new data_mix_won = SQL_FieldNameToNum(hQuery, "mix_won");
new data_points = SQL_FieldNameToNum(hQuery, "points");
while (SQL_MoreResults(hQuery))
{
pKills[id] = SQL_ReadResult(hQuery, data_kills);
pDeaths[id] = SQL_ReadResult(hQuery, data_deaths);
pHeadshots[id] = SQL_ReadResult(hQuery, data_headshots);
pAces[id] = SQL_ReadResult(hQuery, data_aces);
pMiniAces[id] = SQL_ReadResult(hQuery, data_mini_aces);
pMixPlayed[id] = SQL_ReadResult(hQuery, data_mix_played);
pMixLost[id] = SQL_ReadResult(hQuery, data_mix_lost);
pMixDraw[id] = SQL_ReadResult(hQuery, data_mix_draw);
pMixWon[id] = SQL_ReadResult(hQuery, data_mix_won);
pPoints[id] = SQL_ReadResult(hQuery, data_points);
SQL_NextRow(hQuery);
}
pLoaded[id] = true;
}
}
public client_disconnected(id)
{
if(!WarmUp && !PrepareRound)
{
if(1 <= get_user_team(id) <= 2)
client_printcolor(0, "/y[/c%s/y] Player: /g%s /yleft the game!", PREFIX, get_admin_name(id))
}
}
public t_win(id)
{
if(!WarmUp && !KnifeRound && !PrepareRound) scoreT++
if(KnifeRound)
{
if(tempT)
{
showTeamMenu(tempT)
}
}
}
public ct_win(id)
{
if(!WarmUp && !KnifeRound && !PrepareRound) scoreCT++
if(KnifeRound)
{
if(tempCT)
{
showTeamMenu(tempCT)
}
}
}
public PlayerSpawn(id)
{
if(WarmUp && is_user_connected(id))
cs_set_user_money(id, 16000)
Kills[id] = 0
if(KnifeRound && is_user_connected(id))
{
strip_user_weapons(id);
give_item(id, "weapon_knife");
cs_set_user_money(id, 0)
}
return PLUGIN_HANDLED;
}
public RoundEnd()
{
if(WarmUp) server_cmd("hostname ^"%s [Warm-up]^"", HOSTNAME);
else if(KnifeRound) server_cmd("hostname ^"%s [Knife Round]^"", HOSTNAME);
else if(PrepareRound) server_cmd("hostname ^"%s [Choose Players]^"", HOSTNAME);
else
{
if(scoreT == 16 || scoreCT == 16)
{
server_cmd("hostname ^"[Game is over - CT: %i | T: %i] %s^"", scoreCT, scoreT, HOSTNAME);
}
else if(scoreT == 15 || scoreCT == 15)
{
server_cmd("hostname ^"[Live (MB) - CT: %i | T: %i] %s^"", scoreCT, scoreT, HOSTNAME);
}
else
{
if(scoreCT+scoreT == 15)
{
server_cmd("hostname ^"[Live - CT: %i | T: %i] %s^"", scoreCT, scoreT, HOSTNAME);
}
else
{
server_cmd("hostname ^"[Live - CT: %i | T: %i] %s^"", scoreCT, scoreT, HOSTNAME);
}
}
}
if(!WarmUp && !KnifeRound && !PrepareRound) {
for(new i = 1; i <= 32; i++)
{
if(is_user_connected(i))
{
if(Kills[i] == 4)
{
client_printcolor(0, "/y[/c%s/y] Player: /g%s /ymade a /cMINI ACE", PREFIX, get_admin_name(i))
client_printcolor(0, "/y[/c%s/y] Player: /g%s /made a MINI ACE and get /g%i points!", PREFIX, get_admin_name(i), POINTS_MINI_ACE)
if(!WarmUp && !PrepareRound)
pMiniAces[i]++;
pPoints[i] += POINTS_MINI_ACE
SavePlayer(i);
}
else if(Kills[i] == 5)
{
client_printcolor(0, "/y[/c%s/y] Player: /g%s /ymade a /cACE", PREFIX, get_admin_name(i))
client_printcolor(0, "/y[/c%s/y] Player: /g%s /ymade a ACE and get /g%i points!", PREFIX, get_admin_name(i), POINTS_ACE)
pAces[i]++;
pPoints[i] += POINTS_ACE
SavePlayer(i);
}
}
}
if(scoreCT + scoreT == 15)
{
new temp = scoreCT
scoreCT = scoreT
scoreT = temp
client_printcolor(0, "/y[/c%s/y] Changeable commands!", PREFIX)
changeTeams()
server_cmd("sv_restart 5")
}
client_printcolor(0, "/y[/c%s/y] CT's: /g%i /y|| T's: /g%i", PREFIX, scoreCT, scoreT)
if(scoreT == 15 && scoreCT == 15) {
client_printcolor(0, "/y[/c%s/y] /gThe play is over. / yNo team lost!", PREFIX)
client_printcolor(0, "/y[/c%s/y] /gPlayers in each team for a draw : /g%i points!", PREFIX, POINTS_MIX_DRAW)
client_printcolor(0, "/y[/c%s/y] /gThe players in each team for the fact that the player played: /g%i points!", PREFIX, POINTS_MIX_PLAYED)
drawGame();
setEndGame()
}
else if(scoreT == 15) client_printcolor(0, "/y[/c%s/y]Decisive round for the team: Counter-Terrorists", PREFIX)
else if(scoreCT == 15) client_printcolor(0, "/y[/c%s/y]Decisive round for the team: Terrorists", PREFIX)
else if(scoreT == 16)
{
TeamWon(1);
client_printcolor(0, "/y[/c%s/y] /gGame complete. Won: /yTerrorists team!", PREFIX)
client_printcolor(0, "/y[/c%s/y] /gPlayers on the terrorist team for victory /g%i points!", PREFIX, POINTS_MIX_WON)
client_printcolor(0, "/y[/c%s/y] /gThe players on each team for being a good player /g%i points!", PREFIX, POINTS_MIX_PLAYED)
setEndGame()
}
else if(scoreCT == 16)
{
TeamWon(2);
client_printcolor(0, "/y[/c%s/y] /gGame complete. Won: /yCounter-Terrorists team!", PREFIX)
client_printcolor(0, "/y[/c%s/y] /gCounter-Terrorists players on the team for victory : /g%i points!", PREFIX, POINTS_MIX_WON)
client_printcolor(0, "/y[/c%s/y] /gThe players on each team for being a good player : /g%i points!", PREFIX, POINTS_MIX_PLAYED)
setEndGame()
}
}
}
public changeTeams()
{
for(new i = 1; i <= 32; i++)
{
add_delay(i)
}
}
public changeTeam( id )
{
if(is_user_connected(id))
{
switch( get_user_team( id ) )
{
case 2: cs_set_user_team( id, CS_TEAM_T );
case 1: cs_set_user_team( id, CS_TEAM_CT );
}
}
}
add_delay( id )
{
switch( id )
{
case 1..5: set_task( 0.1, "changeTeam", id );
case 6..10: set_task( 0.2, "changeTeam", id );
case 11..15: set_task( 0.3, "changeTeam", id );
case 16..20: set_task( 0.4, "changeTeam", id );
case 21..25: set_task( 0.5, "changeTeam", id );
case 26..32: set_task( 0.6, "changeTeam", id );
}
}
public DeathEvent(victim, attacker, id)
{
new attacker = read_data(1);
new victim = read_data(2);
new hs = read_data(3)
if(WarmUp) {
set_task(1.0, "RespawnPlayer", victim)
}
else if(1 <= victim <= 32 && 1 <= attacker <= 32)
{
Kills[attacker]++
if(!WarmUp && !PrepareRound)
{
pKills[attacker]++;
pPoints[attacker] += POINTS_KILL
client_printcolor(id, "/y[/c%s/y] Win c%s/y points for killing a player !", PREFIX,POINTS_KILL)
if(hs)
{
pHeadshots[attacker]++;
pPoints[attacker] += POINTS_HS
client_printcolor(id, "/y[/c%s/y] Win c%s/y points for killing a player with headshot!", PREFIX,POINTS_HS)
}
pDeaths[victim]++;
pPoints[victim] += POINTS_DEATH
client_printcolor(id, "/y[/c%s/y] Lost c%s/y points for death !", PREFIX,POINTS_DEATH)
SavePlayer(victim);
SavePlayer(attacker);
new weapon_name[32]
read_data(4, weapon_name, 31)
if(containi(weapon_name, "ak47") != -1) InsertWeaponKill(CSW_AK47);
else if(containi(weapon_name, "m4a1") != -1) InsertWeaponKill(CSW_M4A1);
else if(containi(weapon_name, "deagle") != -1) InsertWeaponKill(CSW_DEAGLE);
else if(containi(weapon_name, "awp") != -1) InsertWeaponKill(CSW_AWP);
else if(containi(weapon_name, "usp") != -1) InsertWeaponKill(CSW_USP);
else if(containi(weapon_name, "glock") != -1) InsertWeaponKill(CSW_GLOCK18);
else if(containi(weapon_name, "he") != -1) InsertWeaponKill(CSW_HEGRENADE);
else if(containi(weapon_name, "knife") != -1) InsertWeaponKill(CSW_KNIFE);
else if(containi(weapon_name, "scout") != -1) InsertWeaponKill(CSW_SCOUT);
}
}
}
public RespawnPlayer(id)
{
if(!is_user_alive(id) && is_user_connected(id) && 1 <= get_user_team(id) <= 2)
ExecuteHamB(Ham_CS_RoundRespawn, id)
}
public event_CurWeapon(id)
{
if(KnifeRound && get_user_weapon(id) != CSW_KNIFE)
engclient_cmd(id, "weapon_knife")
}
public infoPassword(id)
{
if(passwordStatus)
client_printcolor(id, "/y[/c%s/y] Server password: /g%s", PREFIX, serverPassword)
else
client_printcolor(id, "/y[/c%s/y] Server password is off!", PREFIX, serverPassword)
return PLUGIN_HANDLED
}
public hookSay(id)
{
if(!canChat) {
client_printcolor(id, "/y[/c%s/y] Chat is currently off!", PREFIX)
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public BlockConsole(id) return PLUGIN_HANDLED
public mainMenu(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
new menu = menu_create("\w[\yMIX\w] \rHome menu", "onMainMenu")
new szMsg[64]
menu_additem(menu, "Management")
format(szMsg, 63, "\wChat \d[%s\d]", canChat ? "\yYes" : "\rNo")
menu_additem(menu, szMsg)
if(serverPassword[0]) format(szMsg, 63, "\wPassworld \d[\y%s\d]", serverPassword)
else format(szMsg, 63, "\wPassworld \d[\rNo\d]")
menu_additem(menu, szMsg)
menu_additem(menu, "Kick player")
menu_additem(menu, "Ban player")
menu_additem(menu, "Change the map")
menu_display(id, menu, 0)
return PLUGIN_HANDLED;
}
public onMainMenu(id, menu, item)
{
switch(item)
{
case 0: actMix(id)
case 1:
{
canChat = !canChat
mainMenu(id)
return PLUGIN_HANDLED
}
case 2: optionsPassword(id)
case 3: client_cmd(id, "amx_kickmenu")
case 4: client_cmd(id, "amx_banmenu")
case 5: client_cmd(id, "amx_mapmenu")
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public optionsPassword(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
new szText[64]
if(strlen(serverPassword) > 0) format(szText, 63, "\w[\y%s\w] \rPassword \d(\y%s\d)", PREFIX, serverPassword)
else format(szText, 63, "\w[\y%s\w] \rPassword \d(\rNo\d)", PREFIX)
new menu = menu_create(szText, "onOptionsPassword")
format(szText, 63, "\wPassword \d[%s\d]", passwordStatus ? "\yOn" : "\rOff")
menu_additem(menu, szText)
menu_additem(menu, "Change password")
menu_additem(menu, "Delete the password")
menu_display(id, menu, 0)
return PLUGIN_HANDLED;
}
public onOptionsPassword(id, menu, item)
{
switch(item)
{
case MENU_EXIT:
{
mainMenu(id)
return PLUGIN_HANDLED
}
case 0:
{
if(strlen(serverPassword) > 0) {
passwordStatus = !passwordStatus
if(passwordStatus) {
server_cmd("sv_password", serverPassword)
client_printcolor(0, "/y[/c%s/y] [/g%s/y] Server password: /g%s",PREFIX, get_admin_name(id), serverPassword)
}
else server_cmd("sv_password ^"^"")
}
else {
if(passwordStatus)
passwordStatus = false
client_printcolor(id, "/y[/c%s/y] No password set!", PREFIX)
//format(serverPassword, 63, "")
}
}
case 1: client_cmd(id, "messagemode SetPassword")
case 2: format(serverPassword, 63, "")
}
optionsPassword(id)
return PLUGIN_HANDLED
}
public _SetPassword(id) {
if(!isAdmin(id)) return
new szTemp[64]
read_args(szTemp, charsmax(szTemp))
remove_quotes(szTemp)
format(serverPassword, 63, szTemp)
optionsPassword(id)
if(passwordStatus)
{
server_cmd("sv_password %s", serverPassword)
client_printcolor(0, "/y[/c%s/y] [/g%s/y] Server password: /g%s",PREFIX, get_admin_name(id), szTemp)
}
}
public actMix(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
new menu = menu_create("\w[\yMIX\w] \rManagement", "onactMix")
menu_additem(menu, "Start Game")
menu_additem(menu, "Prepare round")
menu_additem(menu, "Warming up")
menu_additem(menu, "Knife round")
menu_additem(menu, "Reload round")
menu_additem(menu, "Finish the game…")
menu_display(id, menu, 0)
return PLUGIN_HANDLED;
}
public onactMix(id, menu, item)
{
switch(item)
{
case 0: setLive(id)
case 1: setPrepare(id)
case 2: warmUP(id)
case 3: setKnife(id)
case 4: restartRound(id)
case 5: endGame(id)
}
menu_destroy(menu)
}
public setPrepare(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
if(get_playersnum() >= 10) {
server_cmd("sv_restart 1")
KnifeRound = false;
PrepareRound = true;
WarmUp = false;
scoreCT = 0;
scoreT = 0;
tempCount = 0;
tempCT = 0;
tempT = 0;
for(new i = 1; i <= 32; i++)
{
if(is_user_connected(id) && (1 <= get_user_team(i) <= 2)) {
if(is_user_alive(i))
user_silentkill(i)
cs_set_user_team(i, CS_TEAM_SPECTATOR)
}
}
client_printcolor(0, "/y[/c%s/y] [/g%s/y] The preparation has begun! The administrator will select leaders soon!", PREFIX, get_admin_name(id))
showPrepareMenu(id)
}
else
client_printcolor(id, "/y[/c%s/y] Preparation can't be started because of a missing player!", PREFIX)
return PLUGIN_HANDLED
}
public showPrepareMenu(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
new menu = menu_create("\w[\yMIX\w] \rChoose who will go to CT", "onPrepareCT")
new players[32], num
get_players(players, num, "ch")
new ui[32]
for(new i; i < num; i++)
{
format(ui, 31, "%d",get_user_userid(players[i]))
menu_additem(menu, get_admin_name(players[i]), ui)
}
menu_display(id, menu, 0)
return PLUGIN_HANDLED;
}
public onPrepareCT(id, menu, item)
{
new szData[6], szName[64];
new _access, item_callback;
menu_item_getinfo( menu, item, _access, szData,charsmax( szData ), szName,charsmax( szName ), item_callback );
new userid = str_to_num( szData );
new player = find_player( "k", userid );
switch(item)
{
case MENU_EXIT: {
if(PrepareRound) showPrepareMenu(id)
return PLUGIN_HANDLED;
}
default: if(PrepareRound && is_user_connected(player)) cs_set_user_team(player, CS_TEAM_CT)
}
if(PrepareRound) {
tempCT = player;
client_printcolor(0, "/y[/c%s/y] CT leader will: /g%s", PREFIX, szName)
client_printcolor(0, "/y[/c%s/y] The administrator will immediately select the T leader!", PREFIX)
showPrepareMenuT(id)
}
return PLUGIN_HANDLED;
}
public showPrepareMenuT(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
new menu = menu_create("\w[\yMIX\w] \rChoose who will go to T", "onPrepareT")
new players[32], num
get_players(players, num, "ceh", "SPECTATOR")
new ui[32]
for(new i; i < num; i++)
{
format(ui, 31, "%d",get_user_userid(players[i]))
menu_additem(menu, get_admin_name(players[i]), ui)
}
menu_display(id, menu, 0)
return PLUGIN_HANDLED;
}
public onPrepareT(id, menu, item)
{
new szData[6], szName[64];
new _access, item_callback;
menu_item_getinfo( menu, item, _access, szData,charsmax( szData ), szName,charsmax( szName ), item_callback );
new userid = str_to_num( szData );
new player = find_player( "k", userid );
switch(item)
{
case MENU_EXIT: {
if(PrepareRound) showPrepareMenuT(id)
return PLUGIN_HANDLED;
}
default: if(PrepareRound && is_user_connected(player)) cs_set_user_team(player, CS_TEAM_T)
}
if(PrepareRound) {
tempT = player;
client_printcolor(0, "/y[/c%s/y] T leader will: /g%s", PREFIX, szName)
client_printcolor(0, "/y[/c%s/y] Leaders start choosing players!", PREFIX)
client_printcolor(0, "/y[/c%s/y] /gTip: /yIf the leaderboard menu disappears, enter in the chat /c/choose", PREFIX)
ShowList(tempCT)
}
return PLUGIN_HANDLED;
}
public choosePlayers(id)
{
/*new Where;*/
switch(tempCount)
{
// Ter
case 0,2,4,6: if(tempT == id) ShowList(id);
// CT
case 1,3,5,7: if(tempCT == id) ShowList(id);
}
return PLUGIN_HANDLED;
}
public showTeamMenu(id)
{
new menu = menu_create("\w[\yMIX\w] \rSelect team", "onTeamChange")
menu_additem(menu, "Stay")
menu_additem(menu, "ChangetTeams")
menu_display(id, menu, 0)
return PLUGIN_HANDLED;
}
public onTeamChange(id, menu, item)
{
switch(item)
{
case 0:
{
client_printcolor(0, "/y[/c%s/y] The solution: /gstay", PREFIX)
setServerLive(id)
}
case 1:
{
client_printcolor(0, "/y[/c%s/y] The solution: /gchange teams", PREFIX)
changeTeams()
set_task(2.0, "setServerLive", 1)
}
}
}
public ShowList(id)
{
new menu = menu_create("\w[\yMIX\w] \rChoose a teammate", "onShowList")
new players[32], num
get_players(players, num, "ceh", "SPECTATOR")
new ui[32]
for(new i; i < num; i++)
{
format(ui, 31, "%d",get_user_userid(players[i]))
menu_additem(menu, get_admin_name(players[i]), ui)
}
menu_display(id, menu, 0)
return PLUGIN_HANDLED;
}
public onShowList(id, menu, item)
{
new szData[6], szName[64];
new _access, item_callback;
new Where;
switch(tempCount)
{
case 0,2,4,6: Where = 0
case 1,3,5,7: Where = 1
default: Where = -1
}
menu_item_getinfo( menu, item, _access, szData,charsmax( szData ), szName,charsmax( szName ), item_callback );
new userid = str_to_num( szData );
new player = find_player( "k", userid );
switch(item)
{
case MENU_EXIT: {
if(PrepareRound) ShowList(id)
return PLUGIN_HANDLED;
}
default: if(PrepareRound && is_user_connected(player))
{
if(Where == 0) cs_set_user_team(player, CS_TEAM_CT)
else cs_set_user_team(player, CS_TEAM_T)
}
}
if(PrepareRound) {
tempCount++;
client_printcolor(0, "/y[/c%s/y] [/g%s /ychose /g%s", PREFIX, get_admin_name(id), szName)
if(tempCount < 8)
ShowList(Where == 1 ? tempCT : tempT)
else
{
KnifeRound = true;
PrepareRound = false;
WarmUp = false;
scoreCT = 0;
scoreT = 0;
server_cmd("mp_roundtime 2.0")
server_cmd("mp_buytime 0.30")
server_cmd("mp_startmoney 16000")
server_cmd("mp_freezetime 5")
server_cmd("sv_restart 1")
client_printcolor(0, "/y[/c%s/y] Team selection is complete! Knife round!", PREFIX)
setServerLive(id)
}
}
return PLUGIN_HANDLED;
}
public restartRound(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
server_cmd("sv_restart 1")
client_printcolor(0, "/y[/c%s/y] [/g%s/y] A reloaded round!", PREFIX, get_admin_name(id))
return PLUGIN_HANDLED
}
public setServerLive(id)
{
KnifeRound = false;
PrepareRound = false;
WarmUp = false;
scoreCT = 0;
scoreT = 0;
server_cmd("mp_roundtime 2.0")
server_cmd("mp_buytime 0.30")
server_cmd("mp_startmoney 800")
server_cmd("mp_freezetime 5")
server_cmd("sv_restart 1")
client_printcolor(0, "/y[/c%s/y] Game Started! Wish you a good game - Administration!", PREFIX)
return PLUGIN_HANDLED
}
public setLive(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
KnifeRound = false;
PrepareRound = false;
WarmUp = false;
scoreCT = 0;
scoreT = 0;
server_cmd("mp_roundtime 2.0")
server_cmd("mp_buytime 0.30")
server_cmd("mp_startmoney 800")
server_cmd("mp_freezetime 5")
server_cmd("sv_restart 1")
client_printcolor(0, "/y[/c%s /y] The game has started. I wish you a good game - Administration!", PREFIX, get_admin_name(id))
return PLUGIN_HANDLED
}
public warmUP(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
passwordStatus = false;
KnifeRound = false;
PrepareRound = false;
WarmUp = true;
scoreCT = 0;
scoreT = 0;
server_cmd("mp_roundtime 600")
server_cmd("mp_buytime -1")
server_cmd("mp_startmoney 16000")
server_cmd("mp_freezetime 0")
server_cmd("sv_password ^"^"")
server_cmd("sv_restart 1")
client_printcolor(0, "/y[/c%s /y] [/g%s /y] Start of heating!", PREFIX, get_admin_name(id))
return PLUGIN_HANDLED
}
public setKnife(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
KnifeRound = true;
PrepareRound = false;
WarmUp = false;
scoreCT = 0;
scoreT = 0;
server_cmd("mp_roundtime 2.0")
server_cmd("mp_buytime 0.30")
server_cmd("mp_startmoney 800")
server_cmd("mp_freezetime 5")
server_cmd("sv_restart 1")
client_printcolor(0, "/y[/c%s /y] [/g%s /y] The blades started! Good luck!", PREFIX, get_admin_name(id))
return PLUGIN_HANDLED
}
public drawGame()
{
for(new i = 1; i <= 32; i++)
{
if(is_user_connected(i) && (1 <= get_user_team(i) <= 2))
{
pMixPlayed[i]++;
pPoints[i] += POINTS_MIX_PLAYED
pMixDraw[i]++;
pPoints[i] += POINTS_MIX_DRAW
SavePlayer(i);
}
}
}
public TeamWon(team)
{
for(new i = 1; i <= 32; i++)
{
if(is_user_connected(i) && (1 <= get_user_team(i) <= 2))
{
pMixPlayed[i]++;
pPoints[i] += POINTS_MIX_PLAYED
if(get_user_team(i) == team)
{
pMixWon[i]++;
pPoints[i] += POINTS_MIX_WON
}
else
{
pMixLost[i]++;
pPoints[i] += POINTS_MIX_LOST
}
SavePlayer(i);
}
}
}
public setEndGame()
{
InsertGame();
passwordStatus = false;
KnifeRound = false;
PrepareRound = false;
WarmUp = true;
canChat = true;
scoreCT = 0;
scoreT = 0;
server_cmd("mp_roundtime 600")
server_cmd("mp_startmoney 16000")
server_cmd("mp_buytime -1")
server_cmd("mp_freezetime 0")
server_cmd("sv_password ^"^"")
server_cmd("sv_restart 1")
client_printcolor(0, "/y[/c%s/y] Warm-up is on! Wait for the map to change!", PREFIX)
return PLUGIN_HANDLED
}
public endGame(id)
{
if(!isAdmin(id)) return PLUGIN_HANDLED
passwordStatus = false;
KnifeRound = false;
PrepareRound = false;
WarmUp = true;
canChat = true;
scoreCT = 0;
scoreT = 0;
server_cmd("mp_roundtime 600")
server_cmd("mp_startmoney 16000")
server_cmd("mp_buytime -1")
server_cmd("mp_freezetime 0")
server_cmd("sv_password ^"^"")
server_cmd("sv_restart 1")
client_printcolor(0, "/y[/c%s/y] [/g%s/y] Game over! Warm-up is on!", PREFIX, get_admin_name(id))
return PLUGIN_HANDLED
}
public getScore(id) {
if(WarmUp || KnifeRound || PrepareRound)
client_printcolor(id, "/y[/c%s/y] Game is not playing right now!", PREFIX)
else client_printcolor(id, "/y[/c%s/y] CT's: /g%i /y|| T's: /g%i", PREFIX, scoreCT, scoreT)
return PLUGIN_HANDLED
}
public set( id )
{
if(!isAdmin(id))
{
static iSize = sizeof ( g_szInterpCommands );
for( new i = 0; i < iSize; i++ )
client_cmd( 0, g_szInterpCommands[ i ] );
new szName[ 32 ];
get_user_name( id, szName, sizeof ( szName ) -1 );
client_print ( 0, print_chat, "%s Admin %s set the mix settings for all players!", PREFIX, get_admin_name(id) );
client_print ( 0, print_console, "%s The following settings have been updated to you: ex_interp 0.01/cl_updaterate 100/cl_cmdrate 105/rate 25000", PREFIX);
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public swap_team ( id, level, cid ) {
if( ! cmd_access ( id, level, cid, 2 ) )
return PLUGIN_HANDLED;
new szArg[ 10 ], target[ 32 ], szPlayerName[ 32 ], szAdminName[ 32 ];
read_argv( 0, szArg, 9 );
read_argv( 1, target, 31 );
new player = cmd_target ( id, target, 11 );
if( ! player ) {
client_print ( id, print_chat, "%s The specified player does not exist.", PREFIX);
return PLUGIN_HANDLED;
}
get_user_name ( player, szPlayerName, 31 );
get_user_name ( id, szAdminName, 31 );
switch ( szArg[ 4 ] ) {
case 't':
{
user_silentkill ( player );
cs_set_user_team ( player, 1 );
client_print ( 0, print_chat, "%s Adminul %s move player %s to t.", PREFIX, szAdminName, szPlayerName );
}
case 'c':
{
user_silentkill ( player );
cs_set_user_team ( player, 2 );
client_print ( 0, print_chat, "%s Adminul %s move player %s to ct.", PREFIX, szAdminName, szPlayerName );
}
case 's':
{
if(is_user_alive(player))
{
user_silentkill ( player );
cs_set_user_team ( player, 3 );
client_print ( 0, print_chat, "%s Adminul %s move player %s to spec.", PREFIX, szAdminName, szPlayerName );
}
}
}
return PLUGIN_CONTINUE;
}
stock get_admin_name(id)
{
new name[64]
get_user_name(id, name, 63)
return name
}
stock client_printcolor(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg,190,input,3);
replace_all(msg,190,"/g","^4");// green txt
replace_all(msg,190,"/y","^1");// orange txt
replace_all(msg,190,"/c","^3");// team txt
replace_all(msg,190,"/w","^0");// team txt
if (id) players[0] = id; else get_players(players,count,"ch");
for (new i=0;i<count;i++)
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
GetSecureName(const name[])
{
static secureName[64];
copy(secureName, charsmax(secureName), name);
replace_all(secureName, charsmax(secureName), "\", "\\");
replace_all(secureName, charsmax(secureName), "'", "\'");
replace_all(secureName, charsmax(secureName), "`", "\`");
return secureName;
}
----------------Steam----------------
-----------------------------------------------------------
And she be actin' funny, probably think a nigga need her
I thought I was faithful, she say I'm a cheater
They thought I was taken, I'm ready to mingle
I thought I was faithful, she say I'm a cheater
They thought I was taken, I'm ready to mingle