⭐🚀 TkyNET | Blacklist ve Profesyonel DDoS Korumalı TeamSpeak 3 Sunucuları 🚀⭐
Sponsor Görsel
🔥 Netvay VDS – Daha Fazla Güç, Daha Fazla Performans, Daha Fazla Başarı!
Sponsor Görsel 2
SponsorSponsor

Konu

#1
Merhaba ben cs1.6 da sunucum için tur sistemi istiyorum bu tur sisteminde 15.elde restart ve takım değiştirdikten sonra 15 el bitince 16. elde herkes freezelenip map oylaması yapılması ve ardından map açılmasını istiyorum
iyi formlar teşekkürler.
#2
(27-04-2025, 20:32)MoonKnight382111 Adlı Kullanıcıdan Alıntı: Merhaba ben cs1.6 da sunucum için tur sistemi istiyorum bu tur sisteminde 15.elde restart ve takım değiştirdikten sonra 15 el bitince 16. elde herkes freezelenip map oylaması yapılması ve ardından map açılmasını istiyorum
iyi formlar teşekkürler.
yapan olmazsa yapardım ama son yaptığınız çok ayıp oldu hocam yapmayı düşünmüyorum.
| Return All Starz | Valorant Mod | 95.173.173.31 |
#3
(27-04-2025, 20:32)MoonKnight382111 Adlı Kullanıcıdan Alıntı: Merhaba ben cs1.6 da sunucum için tur sistemi istiyorum bu tur sisteminde 15.elde restart ve takım değiştirdikten sonra 15 el bitince 16. elde herkes freezelenip map oylaması yapılması ve ardından map açılmasını istiyorum
iyi formlar teşekkürler.

Anladığım kadarıyla şunu istiyorsunuz.

1- 15. elde restart atılsın.
2- Restart atıldıktan sonra T'ler CT, CT'ler T olsun.
3- 2. 15 el oynandıktan sonra oyuncular freezelensin.
4- 16. Elde harita oylaması yapılsın ve harita değişsin.

Doğru mudur?
Advanced Plug-in & Animated Model Tasarımı
#4
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>

#define MAX_MAPS 10
#define VOTE_DURATION 15 // Oy süresi (saniye)
#define REFRESH_INTERVAL 1.0 // Oylama durumunu güncelleme aralığı

new g_iRoundCount = 0
new bool:g_bTeamSwapped = false
new g_szMapList[MAX_MAPS][32]
new g_iMapCount = 0
new bool:g_bVoteStarted = false
new g_iVoteCount[MAX_MAPS]
new g_iTotalVotes = 0
new g_iVoteMenu[MAX_PLAYERS + 1]
new g_iVoteStatusMsg

public plugin_init() {
register_plugin("Tur Sistemi (Canlı Oylama)", "3.0", "SizinAdınız")
register_logevent("RoundEnd", 2, "1=Round_End")
register_event("HLTV", "NewRound", "a", "1=0", "2=0")

register_clcmd("say /oydurumu", "cmd_show_vote_status")

load_maplist()

g_iVoteStatusMsg = CreateHudSyncObj()
}

public load_maplist() {
new szFile[64]
get_configsdir(szFile, sizeof(szFile) - 1)
add(szFile, sizeof(szFile) - 1, "/maplist.ini")

if (!file_exists(szFile)) {
log_amx("Maplist dosyasi bulunamadi: %s", szFile)
return
}

new iFile = fopen(szFile, "rt")
if (!iFile) return

g_iMapCount = 0

while (!feof(iFile) && g_iMapCount < MAX_MAPS) {
fgets(iFile, g_szMapList[g_iMapCount], sizeof(g_szMapList[]) - 1)
trim(g_szMapList[g_iMapCount])

if (is_map_valid(g_szMapList[g_iMapCount])) {
g_iMapCount++
}
}

fclose(iFile)
}

public RoundEnd() {
g_iRoundCount++

if (g_iRoundCount == 15 && !g_bTeamSwapped) {
server_cmd("sv_restart 1")
swap_teams()
g_bTeamSwapped = true
}

if (g_iRoundCount == 30 && !g_bVoteStarted) {
freeze_all_players()
start_menu_vote()
g_bVoteStarted = true
}
}

public start_menu_vote() {
if (g_iMapCount < 2) return

reset_votes()

new players[32], num
get_players(players, num)

for (new i = 0; i < num; i++) {
show_vote_menu(players[i])
}

set_task(REFRESH_INTERVAL, "update_vote_status", _, _, _, "b")
set_task(float(VOTE_DURATION), "end_menu_vote")
}

public show_vote_menu(id) {
if (g_iVoteMenu[id]) {
menu_destroy(g_iVoteMenu[id])
}

new title[128]
formatex(title, sizeof(title) - 1, "\yHarita Oylaması^n\dKalan Süre: %d sn", VOTE_DURATION)

g_iVoteMenu[id] = menu_create(title, "vote_menu_handler")

for (new i = 0; i < g_iMapCount; i++) {
new item[64], percent
if (g_iTotalVotes > 0) {
percent = floatround((float(g_iVoteCount[i]) / float(g_iTotalVotes)) * 100.0)
} else {
percent = 0
}

formatex(item, sizeof(item) - 1, "%s \y(%d%%)", g_szMapList[i], percent)
menu_additem(g_iVoteMenu[id], item, "")
}

menu_setprop(g_iVoteMenu[id], MPROP_EXIT, MEXIT_NEVER)
menu_display(id, g_iVoteMenu[id])
}

public vote_menu_handler(id, menu, item) {
if (item == MENU_EXIT || !g_bVoteStarted) {
return PLUGIN_HANDLED
}

for (new i = 0; i < g_iMapCount; i++) {
if (g_iVoteCount[i] > 0) {
g_iVoteCount[i]--
g_iTotalVotes--
}
}

g_iVoteCount[item]++
g_iTotalVotes++

client_print(id, print_chat, "[SUNUCU] Oyunuz: %s", g_szMapList[item])

show_vote_menu(id)

return PLUGIN_HANDLED
}

public update_vote_status() {
if (!g_bVoteStarted) return

new status[512]
new len = formatex(status, sizeof(status) - 1, "Harita Oylaması Durumu:^n^n")

for (new i = 0; i < g_iMapCount; i++) {
new percent
if (g_iTotalVotes > 0) {
percent = floatround((float(g_iVoteCount[i]) / float(g_iTotalVotes)) * 100.0)
} else {
percent = 0
}

len += formatex(status[len], sizeof(status) - len - 1, "%s: %d%% (%d oy)^n", g_szMapList[i], percent, g_iVoteCount[i])
}


new players[32], num
get_players(players, num)

for (new i = 0; i < num; i++) {
set_hudmessage(0, 255, 0, 0.02, 0.25, 0, 0.0, REFRESH_INTERVAL + 0.1, 0.0, 0.0, -1)
ShowSyncHudMsg(players[i], g_iVoteStatusMsg, status)
}
}

public cmd_show_vote_status(id) {
if (g_bVoteStarted) {
update_vote_status()
} else {
client_print(id, print_chat, "[SUNUCU] Şu anda aktif bir oylama yok.")
}
}

public end_menu_vote() {
if (!g_bVoteStarted) return


remove_task()


new winner = 0
for (new i = 1; i < g_iMapCount; i++) {
if (g_iVoteCount[i] > g_iVoteCount[winner]) {
winner = i
}
}


new draw = 0
for (new i = 0; i < g_iMapCount; i++) {
if (i != winner && g_iVoteCount[i] == g_iVoteCount[winner]) {
draw = 1
}
}

if (draw) {
winner = random_num(0, g_iMapCount - 1)
client_print(0, print_chat, "[SUNUCU] Oylama berabere! Rastgele harita seçiliyor: %s", g_szMapList[winner])
} else {
new percent = floatround((float(g_iVoteCount[winner]) / float(g_iTotalVotes)) * 100.0)
client_print(0, print_chat, "[SUNUCU] Kazanan harita: %s (%d%%, %d oy)", g_szMapList[winner], percent, g_iVoteCount[winner])
}

// Menüleri kapat
new players[32], num
get_players(players, num)

for (new i = 0; i < num; i++) {
if (g_iVoteMenu[players[i]]) {
menu_destroy(g_iVoteMenu[players[i]])
g_iVoteMenu[players[i]] = 0
}
}


set_task(5.0, "change_map", winner)
}

public change_map(winner) {
server_cmd("changelevel %s", g_szMapList[winner])
}

public freeze_all_players() {
new players[32], num
get_players(players, num)

for (new i = 0; i < num; i++) {
new id = players[i]
set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
}

client_print(0, print_chat, "[SUNUCU] Harita oylaması başladı! Menü otomatik açılıyor...")
}

public swap_teams() {
new players[32], num
get_players(players, num)

for (new i = 0; i < num; i++) {
new id = players[i]
if (cs_get_user_team(id) == CS_TEAM_T) {
cs_set_user_team(id, CS_TEAM_CT)
} else if (cs_get_user_team(id) == CS_TEAM_CT) {
cs_set_user_team(id, CS_TEAM_T)
}
}

client_print(0, print_chat, "[SUNUCU] Takımlar değiştirildi!")
}

public reset_votes() {
for (new i = 0; i < MAX_MAPS; i++) {
g_iVoteCount[i] = 0
}
g_iTotalVotes = 0
}

public NewRound() {
if (g_iRoundCount >= 30) {
g_iRoundCount = 0
g_bTeamSwapped = false
g_bVoteStarted = false
reset_votes()
}
}

public client_disconnected(id) {
if (g_iVoteMenu[id]) {
menu_destroy(g_iVoteMenu[id])
g_iVoteMenu[id] = 0
}
} addons/amxmodx/configs/maplist.ini dosyasına harita ismi ekleyip denermisiniz
#5
(28-04-2025, 19:23)frurkqn Adlı Kullanıcıdan Alıntı: #include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>

#define MAX_MAPS 10
#define VOTE_DURATION 15 // Oy süresi (saniye)
#define REFRESH_INTERVAL 1.0 // Oylama durumunu güncelleme aralığı

new g_iRoundCount = 0
new bool:g_bTeamSwapped = false
new g_szMapList[MAX_MAPS][32]
new g_iMapCount = 0
new bool:g_bVoteStarted = false
new g_iVoteCount[MAX_MAPS]
new g_iTotalVotes = 0
new g_iVoteMenu[MAX_PLAYERS + 1]
new g_iVoteStatusMsg

public plugin_init() {
    register_plugin("Tur Sistemi (Canlı Oylama)", "3.0", "SizinAdınız")
    register_logevent("RoundEnd", 2, "1=Round_End")
    register_event("HLTV", "NewRound", "a", "1=0", "2=0")
   
    register_clcmd("say /oydurumu", "cmd_show_vote_status")
   
    load_maplist()
   
    g_iVoteStatusMsg = CreateHudSyncObj()
}

public load_maplist() {
    new szFile[64]
    get_configsdir(szFile, sizeof(szFile) - 1)
    add(szFile, sizeof(szFile) - 1, "/maplist.ini")
   
    if (!file_exists(szFile)) {
        log_amx("Maplist dosyasi bulunamadi: %s", szFile)
        return
    }
   
    new iFile = fopen(szFile, "rt")
    if (!iFile) return
   
    g_iMapCount = 0
   
    while (!feof(iFile) && g_iMapCount < MAX_MAPS) {
        fgets(iFile, g_szMapList[g_iMapCount], sizeof(g_szMapList[]) - 1)
        trim(g_szMapList[g_iMapCount])
       
        if (is_map_valid(g_szMapList[g_iMapCount])) {
            g_iMapCount++
        }
    }
   
    fclose(iFile)
}

public RoundEnd() {
    g_iRoundCount++
   
    if (g_iRoundCount == 15 && !g_bTeamSwapped) {
        server_cmd("sv_restart 1")
        swap_teams()
        g_bTeamSwapped = true
    }
   
    if (g_iRoundCount == 30 && !g_bVoteStarted) {
        freeze_all_players()
        start_menu_vote()
        g_bVoteStarted = true
    }
}

public start_menu_vote() {
    if (g_iMapCount < 2) return
   
    reset_votes()
   
    new players[32], num
    get_players(players, num)
   
    for (new i = 0; i < num; i++) {
        show_vote_menu(players[i])
    }
   
    set_task(REFRESH_INTERVAL, "update_vote_status", _, _, _, "b")
    set_task(float(VOTE_DURATION), "end_menu_vote")
}

public show_vote_menu(id) {
    if (g_iVoteMenu[id]) {
        menu_destroy(g_iVoteMenu[id])
    }
   
    new title[128]
    formatex(title, sizeof(title) - 1, "\yHarita Oylaması^n\dKalan Süre: %d sn", VOTE_DURATION)
   
    g_iVoteMenu[id] = menu_create(title, "vote_menu_handler")
   
    for (new i = 0; i < g_iMapCount; i++) {
        new item[64], percent
        if (g_iTotalVotes > 0) {
            percent = floatround((float(g_iVoteCount[i]) / float(g_iTotalVotes)) * 100.0)
        } else {
            percent = 0
        }
       
        formatex(item, sizeof(item) - 1, "%s \y(%d%%)", g_szMapList[i], percent)
        menu_additem(g_iVoteMenu[id], item, "")
    }
   
    menu_setprop(g_iVoteMenu[id], MPROP_EXIT, MEXIT_NEVER)
    menu_display(id, g_iVoteMenu[id])
}

public vote_menu_handler(id, menu, item) {
    if (item == MENU_EXIT || !g_bVoteStarted) {
        return PLUGIN_HANDLED
    }
   
    for (new i = 0; i < g_iMapCount; i++) {
        if (g_iVoteCount[i] > 0) {
            g_iVoteCount[i]--
            g_iTotalVotes--
        }
    }
   
    g_iVoteCount[item]++
    g_iTotalVotes++
   
    client_print(id, print_chat, "[SUNUCU] Oyunuz: %s", g_szMapList[item])
   
    show_vote_menu(id)
   
    return PLUGIN_HANDLED
}

public update_vote_status() {
    if (!g_bVoteStarted) return
   
    new status[512]
    new len = formatex(status, sizeof(status) - 1, "Harita Oylaması Durumu:^n^n")
   
    for (new i = 0; i < g_iMapCount; i++) {
        new percent
        if (g_iTotalVotes > 0) {
            percent = floatround((float(g_iVoteCount[i]) / float(g_iTotalVotes)) * 100.0)
        } else {
            percent = 0
        }
       
        len += formatex(status[len], sizeof(status) - len - 1, "%s: %d%% (%d oy)^n", g_szMapList[i], percent, g_iVoteCount[i])
    }
   

    new players[32], num
    get_players(players, num)
   
    for (new i = 0; i < num; i++) {
        set_hudmessage(0, 255, 0, 0.02, 0.25, 0, 0.0, REFRESH_INTERVAL + 0.1, 0.0, 0.0, -1)
        ShowSyncHudMsg(players[i], g_iVoteStatusMsg, status)
    }
}

public cmd_show_vote_status(id) {
    if (g_bVoteStarted) {
        update_vote_status()
    } else {
        client_print(id, print_chat, "[SUNUCU] Şu anda aktif bir oylama yok.")
    }
}

public end_menu_vote() {
    if (!g_bVoteStarted) return
   

    remove_task()
   

    new winner = 0
    for (new i = 1; i < g_iMapCount; i++) {
        if (g_iVoteCount[i] > g_iVoteCount[winner]) {
            winner = i
        }
    }
   

    new draw = 0
    for (new i = 0; i < g_iMapCount; i++) {
        if (i != winner && g_iVoteCount[i] == g_iVoteCount[winner]) {
            draw = 1
        }
    }
   
    if (draw) {
        winner = random_num(0, g_iMapCount - 1)
        client_print(0, print_chat, "[SUNUCU] Oylama berabere! Rastgele harita seçiliyor: %s", g_szMapList[winner])
    } else {
        new percent = floatround((float(g_iVoteCount[winner]) / float(g_iTotalVotes)) * 100.0)
        client_print(0, print_chat, "[SUNUCU] Kazanan harita: %s (%d%%, %d oy)", g_szMapList[winner], percent, g_iVoteCount[winner])
    }
   
    // Menüleri kapat
    new players[32], num
    get_players(players, num)
   
    for (new i = 0; i < num; i++) {
        if (g_iVoteMenu[players[i]]) {
            menu_destroy(g_iVoteMenu[players[i]])
            g_iVoteMenu[players[i]] = 0
        }
    }
   

    set_task(5.0, "change_map", winner)
}

public change_map(winner) {
    server_cmd("changelevel %s", g_szMapList[winner])
}

public freeze_all_players() {
    new players[32], num
    get_players(players, num)
   
    for (new i = 0; i < num; i++) {
        new id = players[i]
        set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
    }
   
    client_print(0, print_chat, "[SUNUCU] Harita oylaması başladı! Menü otomatik açılıyor...")
}

public swap_teams() {
    new players[32], num
    get_players(players, num)
   
    for (new i = 0; i < num; i++) {
        new id = players[i]
        if (cs_get_user_team(id) == CS_TEAM_T) {
            cs_set_user_team(id, CS_TEAM_CT)
        } else if (cs_get_user_team(id) == CS_TEAM_CT) {
            cs_set_user_team(id, CS_TEAM_T)
        }
    }
   
    client_print(0, print_chat, "[SUNUCU] Takımlar değiştirildi!")
}

public reset_votes() {
    for (new i = 0; i < MAX_MAPS; i++) {
        g_iVoteCount[i] = 0
    }
    g_iTotalVotes = 0
}

public NewRound() {
    if (g_iRoundCount >= 30) {
        g_iRoundCount = 0
        g_bTeamSwapped = false
        g_bVoteStarted = false
        reset_votes()
    }
}

public client_disconnected(id) {
    if (g_iVoteMenu[id]) {
        menu_destroy(g_iVoteMenu[id])
        g_iVoteMenu[id] = 0
    }
} addons/amxmodx/configs/maplist.ini dosyasına harita ismi ekleyip denermisiniz
2. restarttan sonra 15. elde freezelenip oylama yapacak

(28-04-2025, 13:30)pFer Adlı Kullanıcıdan Alıntı:
(27-04-2025, 20:32)MoonKnight382111 Adlı Kullanıcıdan Alıntı: Merhaba ben cs1.6 da sunucum için tur sistemi istiyorum bu tur sisteminde 15.elde restart ve takım değiştirdikten sonra 15 el bitince 16. elde herkes freezelenip map oylaması yapılması ve ardından map açılmasını istiyorum
iyi formlar teşekkürler.

Anladığım kadarıyla şunu istiyorsunuz.

1- 15. elde restart atılsın.
2- Restart atıldıktan sonra T'ler CT, CT'ler T olsun.
3- 2. 15 el oynandıktan sonra oyuncular freezelensin.
4- 16. Elde harita oylaması yapılsın ve harita değişsin.

Doğru mudur?
Doğru
Son Düzenleme: 28-04-2025, 20:55, Düzenleyen: MoonKnight382111.
#6
(28-04-2025, 20:55)MoonKnight382111 Adlı Kullanıcıdan Alıntı:
(28-04-2025, 13:30)pFer Adlı Kullanıcıdan Alıntı: Anladığım kadarıyla şunu istiyorsunuz.

1- 15. elde restart atılsın.
2- Restart atıldıktan sonra T'ler CT, CT'ler T olsun.
3- 2. 15 el oynandıktan sonra oyuncular freezelensin.
4- 16. Elde harita oylaması yapılsın ve harita değişsin.

Doğru mudur?
Doğru

En basit mantıkla bu çalışmalı. ReAPI olan alttaki eklentiyi deneyin ve bana dönüş yapın. Çalışmaz ise biraz daha kurcalarız.

PHP Kod:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <reapi>

new g_iRoundCounter;
new 
bool:g_bTeamsSwapped;
new 
bool:g_bFreezePlayers;

public 
plugin_init()
{
    register_plugin("15 El Restart & Takas & Map Vote""1.0""fernpasha")

    register_logevent("RoundStart"2"1=Round_Start")
    register_logevent("RoundEnd"2"1=Round_End")
    
    set_task
(1.0"CheckFreeze"___"b")
}

public 
RoundStart()
{
    g_iRoundCounter++;

    if (g_iRoundCounter == 15)
    {
        server_cmd("sv_restart 1")
        g_bTeamsSwapped false;
    }
    else if (g_iRoundCounter == 16 && !g_bTeamsSwapped)
    {
        SwapTeams();
        g_bTeamsSwapped true;
    }
    else if (g_iRoundCounter == 30)
    {
        g_bFreezePlayers true;
    }
}

public 
RoundEnd()
{
    if (g_iRoundCounter == 30)
    {
        set_task(2.0"StartMapVote")
    }
}

public 
SwapTeams()
{
    new players[32], numid;
    get_players(playersnum"a");

    for (new 0numi++)
    {
        id players[i];
        
        
if (cs_get_user_team(id) == CS_TEAM_T)
            cs_set_user_team(idCS_TEAM_CT);
        else if (cs_get_user_team(id) == CS_TEAM_CT)
            cs_set_user_team(idCS_TEAM_T);
    }
}

public 
CheckFreeze()
{
    if (!g_bFreezePlayers)
        return;

    new players[32], numid;
    get_players(playersnum"a");

    for (new 0numi++)
    {
        id players[i];
        set_pev(idpev_flagspev(idpev_flags) | FL_FROZEN);
    }
}

public 
StartMapVote()
{
    server_cmd("amx_mapvote");

Advanced Plug-in & Animated Model Tasarımı
Son Düzenleme: 28-04-2025, 21:01, Düzenleyen: fernpasha.
#7
Bu sanırım random vote atıyor arkadaş map motordaki maplerden rastgele açılsın istiyor
| Return All Starz | Valorant Mod | 95.173.173.31 |
#8
İstek konusu, @"pFer" adlı kullanıcı tarafından 2 gün içinde çözülmüştür.
İsteği çözdüğü için pFer Adlı kullanıcıya 1 rep puanı ve 1 yardım etme puanı otomatik olarak verilmiştir.
pFer Adlı kullanıcı sizin dışınızda toplam 20 kişiye yardım etmiştir.

Herhangi bir konuda hata olduğunu düşünüyorsanız destek sistemi üzerinden iletişim kurabilirsiniz.

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da