Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

Помогите в переделке плагина auto_rr

, [inside]
Статус пользователя kupuk96
сообщение 12.11.2010, 18:00
Сообщение #1


Стаж: 15 лет

Сообщений: 456
Благодарностей: 139
Полезность: 554

Привет Всем :)
Мне нужно, чтобы вы помогли переделать плагин auto_rr так, чтобы пока идёт таймер рестарта, на сервере ставилась переменная mp_friendlyfire "1"
А после рестарта обратно.
auto_restart.sma
/********************************************************************************
*

Auto Game Restart with Countdown Timer
Version 1.0
Created by AbeX
19.02.2008

Features:

Plugin restarts the game after the time in seconds you have choose.
Also it shows HUD message with countdown timer in the center of screen.
After restart the message "LIVE ! LIVE ! LIVE !" will appear in chat.
Counting starts at game commencing.

Installation:

Put compiled plugin in the /plugins/ directory.
Add line containing "auto_rr.amxx" into your plugins.ini file.

Requirements:

None (amxmodx)

Configuration:

Use autorr_time (float) CVAR in your amxx.cfg change the time after
that game will be restarted. Example:

autorr_time 10.0 //game will be restarted in 10 seconds, default: 20.0

********************************************************************************
**/


#include <amxmodx>

new g_Seconds
new g_SecondsCvar

public plugin_init() {
register_plugin("Auto Game Restart with Countdown Timer", "1.0", "AbeX")
register_event("TextMsg", "game_commencing", "a", "2=#Game_Commencing")
g_SecondsCvar = register_cvar("autorr_time","20.0")
}

public game_commencing() {
if (task_exists(41170))
remove_task(41170)
g_Seconds = floatround(get_pcvar_float(g_SecondsCvar))
new param[32]
set_task(1.0,"count_rr",41170,param,31,"b",0)
}

public count_rr() {
g_Seconds--;
set_hudmessage(255, 255, 255, -1.0, 0.4, 0, 6.0, 1.0)
show_hudmessage(0, "Автоматический рестарт через %d секунд",g_Seconds)
if (g_Seconds == 0) {
server_cmd("sv_restartround 1")
client_print(0, print_chat, "Разнесём здесь всё!")
remove_task(41170)
}
}


Отредактировал: kupuk96, - 12.11.2010, 18:01
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя GODZILLA
сообщение 12.11.2010, 18:08
Сообщение #2


Стаж: 18 лет

Сообщений: 1471
Благодарностей: 440
Полезность: 716

auto_rr

Код
#include <amxmodx>

new g_Seconds
new g_SecondsCvar

public plugin_init()
{
    register_plugin("Auto Game Restart with Countdown Timer", "1.0", "AbeX")
    register_event("TextMsg", "game_commencing", "a", "2=#Game_Commencing")
    g_SecondsCvar = register_cvar("autorr_time","20.0")
}

public game_commencing()
{
    if (task_exists(41170))
    remove_task(41170)
    g_Seconds = floatround(get_pcvar_float(g_SecondsCvar))
    server_cmd("mp_friendlyfire 1")
    new param[32]
    set_task(1.0,"count_rr",41170,param,31,"b",0)    
}

public count_rr()
{    
    g_Seconds--;
    set_hudmessage(255, 255, 255, -1.0, 0.4, 0, 6.0, 1.0)
    show_hudmessage(0, "Автоматический рестарт через %d секунд",g_Seconds)    
    if (g_Seconds == 0)
    {
    server_cmd("sv_restartround 1")    
    server_cmd("mp_friendlyfire 0")
    client_print(0, print_chat, "Разнесём здесь РІСЃС‘!")
    remove_task(41170)
    }
}



и код плагина вставляй в тэгах
Цитата
[code][/code]

на будущее

Отредактировал: GODZILLA, - 12.11.2010, 18:09
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
  Тема закрытаНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: