Aşağıda açık kaynak kodları verilmiş olan eklentiyi yazarken, yardıma ihtiyacım oldu.
Eklentiden istediğim mantık çok basit.
1-) 15. round itibariyle TAKIM DEĞİŞTİRİLMELİ
Eklenti hali hazırda bunu yapıyor.
2-) 15. round itibariyle TAKIM SKORLARI değiştirilmeli. Bu Final Skoru düşünülerek istiyorum (CSGO mod kullanan arkadaşlar için)
Örneğin TE:8 CT:7 takımlar değiştiğinde TE:7 CT:8 olmalı, var mıdır imkanı?
3-) 29. round itibariyle HARITA OYLAMASI yapacak bir chooser istiyorum. Forumdaki Harita Değişim Sistemlerini entegre ettim fakat çalışmadı.
Herhangi bir hata kaydıda bırakmadığı için sorun nerde anlaşılmıyor.
Bu eklenti yapılabilirse, FORUM adresimizde paylaşılacaktır. CSGO mod kullanan arkadaşlar bilhassa, çok yararlı olacak onlar için.
Kod: Tümünü seç
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
new
PLUGIN_NAME[] = "Competitive",
PLUGIN_AUTHOR[] = "OneTap",
PLUGIN_VERSION[] = "0.0.1",
SERVER_NAME[] = "OneTap",
plugin_on_off,
round_sayisi;
public plugin_init()
{
// Eklenti Kayit
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
// CVAR Kayit
plugin_on_off = register_cvar("competitive","1"); // 1 -Aktif 0 -KAPALI
// Event
register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
register_event("TextMsg", "event_game_restart", "a", "2&#Game_C", "2&#Game_W","2=#Game_will_restart_in");
register_event("SendAudio", "event_round_end", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw");
// Oylama Menusu
}
public event_game_restart()
{
if (get_pcvar_num(plugin_on_off) != 0)
{
set_cvar_num("mp_timelimit", 0);
round_sayisi = 0;
}
else
set_cvar_num("mp_timelimit", 25);
}
public event_round_start()
{
if (get_pcvar_num(plugin_on_off) == 1)
{
if (round_sayisi >= 1)
{
ChatColor(0,"!y[%s %s]: !nTur: !y%d!n/!y30 !n| Final Skoru: !y16",SERVER_NAME,PLUGIN_NAME,round_sayisi);
}
if (round_sayisi == 29)
{
//OylamaYaptir();
}
}
}
public event_round_end()
{
if (get_pcvar_num(plugin_on_off) == 1)
{
round_sayisi +=1;
if (round_sayisi == 15)
{
teamchange_halftime();
set_hudmessage(0, 255, 0, -1.0, -1.0);
show_hudmessage(0, "TAKIMLAR YER DEGISTIRILDI!");
ChatColor(0,"!y[%s %s]: !tTAKIMLAR YER DEGISTIRILDI!",SERVER_NAME,PLUGIN_NAME);
}
if (round_sayisi == 30)
{
//OylamaSonucuylaMapDegistir();
}
}
}
public teamchange_halftime()
{
new players[32], inum;
get_players(players,inum)
for(new i; i < inum; i++)
{
switch(i)
{
case 0..6: set_task(0.1,"team_change",players[i])
case 7..14: set_task(0.2,"team_change",players[i])
case 15..22: set_task(0.3,"team_change",players[i])
case 23..31: set_task(0.4,"team_change",players[i])
}
}
}
public team_change(id)
{
switch(cs_get_user_team(id))
{
case CS_TEAM_T: cs_set_user_team(id,CS_TEAM_CT);
case CS_TEAM_CT: cs_set_user_team(id,CS_TEAM_T);
case CS_TEAM_SPECTATOR: cs_set_user_team(id,CS_TEAM_SPECTATOR);
}
}
/* ==== HARITA DEGISTIRME SISTEMI ==== */
/* ==== HARITA DEGISTIRME SISTEMI ==== */
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!n", "^x01"); // Default Renk
replace_all(msg, 190, "!y", "^x04"); // Yesil Renk Yazi
replace_all(msg, 190, "!t", "^x03"); // Takim Renk Yazi
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();
}
}
}
}