Siemka! Potrzebuje czegośtakiego że bez wpisywania sv_restart 1 albo w amxmodmenu po 1 rundzie zawsze restart mi sie robił.
Nie wiem to może plugin albo coś ale to potrzebuje.
Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
restart po 1 rundzie.
Temat rozp. Boooskyw0w~, 24.01.2009 11:44
5 odpowiedzi w tym temacie
#1
Napisano 24.01.2009 11:44
#2
Napisano 24.01.2009 11:55
#include <amxmodx>
#include <fun>
#include <cstrike>
new bool:gPlayerFirstSpawn[33]
new bool:is_warmup
new warmup_time
new time_left
public plugin_init() {
register_plugin("warmup on first round", "1.0", "x-raycat")
warmup_time = register_cvar("amx_warmup_time", "1m 0s")
register_event("ResetHUD", "Event_ResetHud", "be")
register_event("CurWeapon", "Event_CurWeapon", "be")
is_warmup = true
init_warmup_time()
}
public restartround(id){
gPlayerFirstSpawn[id] = true
return PLUGIN_CONTINUE
}
public countdown(){
time_left--
if(time_left < 0)
{
restart()
}
return PLUGIN_CONTINUE
}
public init_warmup_time(){
new time[24], temp[2][6]
get_pcvar_string(warmup_time, time, 23)
replace(time, 23, "m", "")
replace(time, 23, "s", "")
parse(time, temp[0], 5, temp[1], 5)
time_left = str_to_num(temp[0]) * 60 + str_to_num(temp[1])
set_task(1.0, "countdown", 4567,_,_,"b")
set_task(1.0, "show_time", 2345,_,_,"b")
}
public show_time(){
set_hudmessage(255, 255, 255, -1.0, 0.31, 0, 6.0, 2.0)
show_hudmessage(0, "Runda rozgrzekowa, %d:%02d sekund do konca.", time_left / 60, time_left % 60)
}
public restart(){
is_warmup = false
remove_task(4567)
remove_task(2345)
server_cmd("sv_restart 1")
}
public Event_ResetHud(id) {
if(is_warmup)
set_task(0.1, "task_give", id)
}
public task_give(id){
if (!is_user_alive(id))
return
strip_user_weapons(id);
give_item(id, "weapon_m3")
cs_set_user_bpammo(id, CSW_M3, 200)
cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM)
cs_set_user_money (id , 0) //Set money 0 that they will not buy anything
}
public Event_CurWeapon(id){
//just to make sure if they get weapons somewhere...
static trash1, trash2
new weapon = get_user_weapon(id, trash1, trash2)
new bool:hasInvalidWeapon = (weapon != CSW_M3)
if (hasInvalidWeapon && is_warmup)
{
client_cmd(id, "drop")
}
}
To jest na pompy, zmień m3 na jaką broń chcesz
#3
Napisano 24.01.2009 12:03
a gdzie to wkleic?
@edit
i jak zmienic bron?
@edit
i jak zmienic bron?
#5
Napisano 24.01.2009 12:20
a mógł byś mi to przerobić że są deagle i runda rozgrzewkowa trwa 45 sekund?
#6
Napisano 24.01.2009 13:31
Ta runda trwa 45 sekund
#include <amxmodx>
#include <fun>
#include <cstrike>
new bool:gPlayerFirstSpawn[33]
new bool:is_warmup
new warmup_time
new time_left
public plugin_init() {
register_plugin("warmup on first round", "1.0", "x-raycat")
warmup_time = register_cvar("amx_warmup_time", "1m 0s")
register_event("ResetHUD", "Event_ResetHud", "be")
register_event("CurWeapon", "Event_CurWeapon", "be")
is_warmup = true
init_warmup_time()
}
public restartround(id){
gPlayerFirstSpawn[id] = true
return PLUGIN_CONTINUE
}
public countdown(){
time_left--
if(time_left < 0)
{
restart()
}
return PLUGIN_CONTINUE
}
public init_warmup_time(){
new time[24], temp[2][6]
get_pcvar_string(warmup_time, time, 23)
replace(time, 23, "m", "")
replace(time, 23, "s", "")
parse(time, temp[0], 5, temp[1], 5)
time_left = str_to_num(temp[0]) * 60 + str_to_num(temp[1])
set_task(1.0, "countdown", 4567,_,_,"b")
set_task(1.0, "show_time", 2345,_,_,"b")
}
public show_time(){
set_hudmessage(255, 255, 255, -1.0, 0.31, 0, 6.0, 2.0)
show_hudmessage(0, "Runda rozgrzekowa, %d:%02d sekund do konca.", time_left / 60, time_left % 60)
}
public restart(){
is_warmup = false
remove_task(4567)
remove_task(2345)
server_cmd("sv_restart 1")
}
public Event_ResetHud(id) {
if(is_warmup)
set_task(0.1, "task_give", id)
}
public task_give(id){
if (!is_user_alive(id))
return
strip_user_weapons(id);
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_deagle, 200)
cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM)
cs_set_user_money (id , 0) //Set money 0 that they will not buy anything
}
public Event_CurWeapon(id){
//just to make sure if they get weapons somewhere...
static trash1, trash2
new weapon = get_user_weapon(id, trash1, trash2)
new bool:hasInvalidWeapon = (weapon != CSW_deagle)
if (hasInvalidWeapon && is_warmup)
{
client_cmd(id, "drop")
}
}
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych


Dodatki SourceMod



Temat jest zamknięty








