⭐🚀 TkyNET | Blacklist ve Profesyonel DDoS Korumalı TeamSpeak 3 Sunucuları 🚀⭐
Sponsor Görsel
🇹🇷 TR Lokasyon | 🛡️ Gelişmiş DDoS Koruması | ⚡ Düşük Ping | 🎧 Kesintisiz TS3 | Hostlar
Sponsor Görsel 2
SponsorSponsor

Konu

#1
Merhabalar

bu maç botuna pause unpause eklemek mümkün mü veya ayrı bir eklenti olarakta yapabilabilir maç esnasında gerektiği zaman oyunu durduramıyoruz sorun oluyor.
.smabot2.sma(Dosya Boyutu: 120,26 KB | İndirme Sayısı: 3)
#2
PHP Kod:
#include <amxmodx>
#include <reapi>

// List of client commands to use pause feature
new const CLCMDS[][] = {
    
"say !pause",
    
"say .pause",
    
"say /pause"
}

// Create config with cvars in 'configs/plugins', and execute it?
//#define AUTO_CFG

stock const SOUND__ERROR[] = "sound/buttons/button2.wav"
stock const SOUND__BELL1[] = "sound/buttons/bell1.wav"
stock const SOUND__BLIP2[] = "sound/buttons/blip2.wav"

#define FREEZETIME_NOT_SET -1

enum _:CVAR_ENUM {
    
CVAR__PAUSABLE,
    
CVAR__PAUSE_TIME,
    
CVAR__PAUSE_COOLDOWN
}

new 
g_eCvar[CVAR_ENUM]
new 
g_pFreezeTime
new bool:g_bNeedPause
new g_iOldFreezeTime FREEZETIME_NOT_SET
new HookChain:g_hRestartPost
new g_iPauseTime

public plugin_init() {
    
register_plugin("Say Pause""1.0.""Mr.Commander")
    
//register_dictionary("say_pause.txt")

    
bind_cvar_num("pause_available""2", .desc "Is pausing available (1/0) ?", .bind g_eCvar[CVAR__PAUSABLE])
    
bind_cvar_num("pause_duration""60", .desc "Pause duration in seconds", .bind g_eCvar[CVAR__PAUSE_TIME])
    
bind_cvar_num("pause_cooldown""120", .desc "Pause usage cooldown in seconds", .bind g_eCvar[CVAR__PAUSE_COOLDOWN])

/*#if defined AUTO_CFG
    AutoExecConfig()
#endif*/

    
RegisterHookChain(RG_CSGameRules_RestartRound"CSGameRules_RestartRound_Pre")
    
g_hRestartPost RegisterHookChain(RG_CSGameRules_RestartRound"CSGameRules_RestartRound_Post"true)
    
DisableHookChain(g_hRestartPost)

    
g_pFreezeTime get_cvar_pointer("mp_freezetime")

    for(new 
isizeof(CLCMDS); i++) {
        
register_clcmd(CLCMDS[i], "clcmd_SayPause")
    }
}

public 
clcmd_SayPause(pPlayer) {
    if(!
g_eCvar[CVAR__PAUSABLE]) {
        
rg_send_audio(pPlayerSOUND__ERROR)
        
client_print_color(pPlayerprint_team_red,"^1[^3csd^1] ^3* ^1Duraklatma su anda kullanilamaz!")
        return 
PLUGIN_HANDLED
    
}

    if(
g_bNeedPause) {
        
rg_send_audio(pPlayerSOUND__ERROR)
        
client_print_color(pPlayerprint_team_red,"^1[^3csd^1] ^3* ^1Pause zaten alindi!")
        return 
PLUGIN_HANDLED
    
}

    new 
iSeconds get_systime() - g_iPauseTime

    
if(g_iPauseTime && iSeconds g_eCvar[CVAR__PAUSE_COOLDOWN]) {
        
iSeconds g_eCvar[CVAR__PAUSE_COOLDOWN] - iSeconds
        rg_send_audio
(pPlayerSOUND__ERROR)
        
client_print_color(pPlayerprint_team_red,"^1[^3csd^1] ^3* ^1Pause su sure kadar gecerli olacak^4 %02d:%02d"iSeconds 60iSeconds 60)
        return 
PLUGIN_HANDLED
    
}

    
g_bNeedPause true

    rg_send_audio
(0SOUND__BELL1)
    
client_print_color(0pPlayer"%l"LANG_PLAYER"^1[^3csd^1] ^4* ^1Oyuncu ^3%n ^1pause istedi ^4%i sn. ^1sonraki turda aktif olacak!"pPlayerg_eCvar[CVAR__PAUSE_TIME])

    return 
PLUGIN_HANDLED
}

public 
CSGameRules_RestartRound_Pre() {
    if(!
g_bNeedPause) {
        return
    }

    
g_bNeedPause false

    
if(!g_eCvar[CVAR__PAUSABLE] || g_eCvar[CVAR__PAUSE_TIME] < 1) {
        return
    }

    
g_iPauseTime get_systime()

    
rg_send_audio(0SOUND__BLIP2)
    
client_print_color(0print_team_default"%l"LANG_PLAYER"^1[^3csd^1] ^4* ^1Dikkat! Pause ^4%i sec."g_eCvar[CVAR__PAUSE_TIME])

    
g_iOldFreezeTime get_pcvar_num(g_pFreezeTime)
    
set_pcvar_num(g_pFreezeTimeg_eCvar[CVAR__PAUSE_TIME])
    
EnableHookChain(g_hRestartPost)
}

public 
CSGameRules_RestartRound_Post() {
    
DisableHookChain(g_hRestartPost)
    
set_pcvar_num(g_pFreezeTimeg_iOldFreezeTime)
    
g_iOldFreezeTime FREEZETIME_NOT_SET
}

// Some mapchoosers can change map in RestartRound Pre, so we need to cover it
public plugin_end() {
    if(
g_iOldFreezeTime != FREEZETIME_NOT_SET) {
        
set_pcvar_num(g_pFreezeTimeg_iOldFreezeTime)
    }
}

stock bind_cvar_num(const cvar[], const value[], flags FCVAR_NONE, const desc[] = ""bool:has_min falseFloat:min_val 0.0bool:has_max falseFloat:max_val 0.0, &bind) {
    
bind_pcvar_num(create_cvar(cvarvalueflagsdeschas_minmin_valhas_maxmax_val), bind)

Merhaba,

Maç sunucunuza bu eklentiyi ayrıca yükleyip dener misiniz ?  /pause !pause ve .pause olarak çalıştırabilirsiniz.
Stand Back Warrior's   | ip: cs.sbwpro.com | ts3: ts3.sbwpro.com
#3
(27-03-2025, 05:06)Mr.Commander Adlı Kullanıcıdan Alıntı:
PHP Kod:
#include <amxmodx>
#include <reapi>

// List of client commands to use pause feature
new const CLCMDS[][] = {
    
"say !pause",
    
"say .pause",
    
"say /pause"
}

// Create config with cvars in 'configs/plugins', and execute it?
//#define AUTO_CFG

stock const SOUND__ERROR[] = "sound/buttons/button2.wav"
stock const SOUND__BELL1[] = "sound/buttons/bell1.wav"
stock const SOUND__BLIP2[] = "sound/buttons/blip2.wav"

#define FREEZETIME_NOT_SET -1

enum _:CVAR_ENUM {
    
CVAR__PAUSABLE,
    
CVAR__PAUSE_TIME,
    
CVAR__PAUSE_COOLDOWN
}

new 
g_eCvar[CVAR_ENUM]
new 
g_pFreezeTime
new bool:g_bNeedPause
new g_iOldFreezeTime FREEZETIME_NOT_SET
new HookChain:g_hRestartPost
new g_iPauseTime

public plugin_init() {
    
register_plugin("Say Pause""1.0.""Mr.Commander")
    
//register_dictionary("say_pause.txt")

    
bind_cvar_num("pause_available""2", .desc "Is pausing available (1/0) ?", .bind g_eCvar[CVAR__PAUSABLE])
    
bind_cvar_num("pause_duration""60", .desc "Pause duration in seconds", .bind g_eCvar[CVAR__PAUSE_TIME])
    
bind_cvar_num("pause_cooldown""120", .desc "Pause usage cooldown in seconds", .bind g_eCvar[CVAR__PAUSE_COOLDOWN])

/*#if defined AUTO_CFG
    AutoExecConfig()
#endif*/

    
RegisterHookChain(RG_CSGameRules_RestartRound"CSGameRules_RestartRound_Pre")
    
g_hRestartPost RegisterHookChain(RG_CSGameRules_RestartRound"CSGameRules_RestartRound_Post"true)
    
DisableHookChain(g_hRestartPost)

    
g_pFreezeTime get_cvar_pointer("mp_freezetime")

    for(new 
isizeof(CLCMDS); i++) {
        
register_clcmd(CLCMDS[i], "clcmd_SayPause")
    }
}

public 
clcmd_SayPause(pPlayer) {
    if(!
g_eCvar[CVAR__PAUSABLE]) {
        
rg_send_audio(pPlayerSOUND__ERROR)
        
client_print_color(pPlayerprint_team_red,"^1[^3csd^1] ^3* ^1Duraklatma su anda kullanilamaz!")
        return 
PLUGIN_HANDLED
    
}

    if(
g_bNeedPause) {
        
rg_send_audio(pPlayerSOUND__ERROR)
        
client_print_color(pPlayerprint_team_red,"^1[^3csd^1] ^3* ^1Pause zaten alindi!")
        return 
PLUGIN_HANDLED
    
}

    new 
iSeconds get_systime() - g_iPauseTime

    
if(g_iPauseTime && iSeconds g_eCvar[CVAR__PAUSE_COOLDOWN]) {
        
iSeconds g_eCvar[CVAR__PAUSE_COOLDOWN] - iSeconds
        rg_send_audio
(pPlayerSOUND__ERROR)
        
client_print_color(pPlayerprint_team_red,"^1[^3csd^1] ^3* ^1Pause su sure kadar gecerli olacak^4 %02d:%02d"iSeconds 60iSeconds 60)
        return 
PLUGIN_HANDLED
    
}

    
g_bNeedPause true

    rg_send_audio
(0SOUND__BELL1)
    
client_print_color(0pPlayer"%l"LANG_PLAYER"^1[^3csd^1] ^4* ^1Oyuncu ^3%n ^1pause istedi ^4%i sn. ^1sonraki turda aktif olacak!"pPlayerg_eCvar[CVAR__PAUSE_TIME])

    return 
PLUGIN_HANDLED
}

public 
CSGameRules_RestartRound_Pre() {
    if(!
g_bNeedPause) {
        return
    }

    
g_bNeedPause false

    
if(!g_eCvar[CVAR__PAUSABLE] || g_eCvar[CVAR__PAUSE_TIME] < 1) {
        return
    }

    
g_iPauseTime get_systime()

    
rg_send_audio(0SOUND__BLIP2)
    
client_print_color(0print_team_default"%l"LANG_PLAYER"^1[^3csd^1] ^4* ^1Dikkat! Pause ^4%i sec."g_eCvar[CVAR__PAUSE_TIME])

    
g_iOldFreezeTime get_pcvar_num(g_pFreezeTime)
    
set_pcvar_num(g_pFreezeTimeg_eCvar[CVAR__PAUSE_TIME])
    
EnableHookChain(g_hRestartPost)
}

public 
CSGameRules_RestartRound_Post() {
    
DisableHookChain(g_hRestartPost)
    
set_pcvar_num(g_pFreezeTimeg_iOldFreezeTime)
    
g_iOldFreezeTime FREEZETIME_NOT_SET
}

// Some mapchoosers can change map in RestartRound Pre, so we need to cover it
public plugin_end() {
    if(
g_iOldFreezeTime != FREEZETIME_NOT_SET) {
        
set_pcvar_num(g_pFreezeTimeg_iOldFreezeTime)
    }
}

stock bind_cvar_num(const cvar[], const value[], flags FCVAR_NONE, const desc[] = ""bool:has_min falseFloat:min_val 0.0bool:has_max falseFloat:max_val 0.0, &bind) {
    
bind_pcvar_num(create_cvar(cvarvalueflagsdeschas_minmin_valhas_maxmax_val), bind)

Merhaba,

Maç sunucunuza bu eklentiyi ayrıca yükleyip dener misiniz ?  /pause !pause ve .pause olarak çalıştırabilirsiniz.


olmadı
#4
İstek konusu, @Mr.Commander adlı kullanıcı tarafından 2 gün içinde çözülmüştür.
İsteği çözdüğü için Mr.Commander Adlı kullanıcıya 1 rep puanı ve 1 yardım etme puanı otomatik olarak verilmiştir.
Mr.Commander Adlı kullanıcı sizin dışınızda toplam 69 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
Task