←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

Problem Runda rozgrzewkowa

Bulgarian's Photo Bulgarian 13.01.2012

Witam.


Problem mój polega na tym iż ludzie powinni mieć noże przez okres rozgrzewki.
Wszystko mam ustawione jak należy, ale nie wiem dlaczego niektórzy mogą miec normalnie bronie i zabijac (USP, GLOCK), do czasu aż nie zmienią na nóż ...
Da się coś z tym zrobić bardzo byłbym wdzięczny.
Czekam na waszą odp.

Attached File  crazy_restart_mp3.sma   4.92KB   20 downloads
Edited by Bulgarian, 13.01.2012 18:24.
Quote

olek0017's Photo olek0017 13.01.2012

Sprwadz to



#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <fakemeta_util>

#define fm_cs_set_user_nobuy(%1) set_pdata_int(%1, 235, get_pdata_int(%1, 235) & ~(1<<0))

new bool:isrestart = false
new timer

new const muzyczka2[] = {"sound/misc/muzyczka.mp3"}

public plugin_precache()
{
precache_generic(muzyczka2)
}

public plugin_init()
{
register_plugin("Crazy Restart", "4.8", "Salamon")

register_event("TextMsg","start","a","2&#Game_C")

register_cvar("crazy_restart","1")
register_cvar("crazy_restart_time","60")
register_cvar("crazy_restart_weapon","weapon_knife")
RegisterHam(Ham_Spawn,"player","SpawnGracza",1);

}

public SpawnGracza(id){
if(isrestart)
{
fm_cs_set_user_nobuy(id);
strip_user_weapons(id)
give_item(id,"weapon_knife")
}
}

public start()
{
timer = get_cvar_num("crazy_restart_time")

new Float:res_time = get_cvar_float("crazy_restart_time")

if(get_cvar_num("crazy_restart") == 1)
{
isrestart = true

//dodajemy pluginy ktore chcemy zatrzymac na czas rundy nozowej
//a robimy to w nastepujacy sposob
//server_cmd("amx_pausecfg pause nazwa_pluginu.amxx")
//server_cmd("amx_pausecfg pause nazwa_pluginu2.amxx")
//dopisujemy te pluginy ktore chcemy zatrzymac i te same spowrotem
//wlaczamy nizej

set_task(res_time + 1, "end")
set_task(3.0, "muzyczka")
set_task(1.0, "count_me", 123, _, _, "b")
set_task(4.0, "ammo", 123, _, _, "b")
}
}

public muzyczka()
{
client_cmd(0, "mp3 play %s", muzyczka2)
}

public ammo()
{
new weapon[192]
get_cvar_string("crazy_restart_weapon", weapon, 191)

for(new i = 1; i <= get_playersnum(); i++)
{
give_item(i, weapon)
engclient_cmd(i, weapon)
}
}

public end()
{
isrestart = false

remove_task(123)

//tu spowrotem wlaczamy pluginy ktore zatrzymalismy wyzej
//server_cmd("amx_pausecfg enable nazwa_pluginu.amxx")
//server_cmd("amx_pausecfg enable nazwa_pluginu2.amxx")
//robimy tak z kazdym, a jak widac jedyne co sie zmienia to enable

set_cvar_num("sv_restartround",1)
}

public count_me()
{
new red = random_num(5,255)
new green = random_num(5,255)
new blue = random_num(5,255)

set_hudmessage(red, green, blue, -1.0, 0.01, 0, 0.1, 0.92, 0.1, 0.1, -1)
show_hudmessage(0,"******************************^n Restart za %i sekund ^n******************************", timer)

if(timer == 3)
{
client_cmd(0, "spk vox/three.wav")
}
if(timer == 2)
{
client_cmd(0, "spk vox/two.wav")
}
if(timer == 1)
{
client_cmd(0, "spk vox/one.wav")
}
timer--
}


Edited by olek0017, 13.01.2012 18:41.
Quote

Bulgarian's Photo Bulgarian 14.01.2012

Dalej ten sam problem nawet gorzej bo ludzie mogą sobie kupić broń.
Czekam na dalszą pomoc.
Edited by Bulgarian, 14.01.2012 14:37.
Quote

olek0017's Photo olek0017 14.01.2012

to dziala na pewno sprawdzalem
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <fakemeta_util>

#define fm_cs_set_user_nobuy(%1) set_pdata_int(%1, 235, get_pdata_int(%1, 235) & ~(1<<0))


new bool:isrestart = false
new timer

new const muzyczka2[] = {"sound/misc/muzyczka.mp3"}

public plugin_precache()
{
precache_generic(muzyczka2)
}

public plugin_init()
{
register_plugin("Crazy Restart", "4.8", "Salamon")

register_event("TextMsg","start","a","2&#Game_C")

register_cvar("crazy_restart","1")
register_cvar("crazy_restart_time","60")
register_cvar("crazy_restart_weapon","weapon_knife")
RegisterHam(Ham_Spawn,"player","SpawnGracza",1);
register_message(get_user_msgid("StatusIcon") , "StatusIcon")

}

public StatusIcon(iMsgid, iDest, id){
if(isrestart){

static szIcon[5]
get_msg_arg_string(2, szIcon, 4)
if(szIcon[0] == 'b' && szIcon[2] == 'y' && szIcon[3] == 'z') {
if(get_msg_arg_int(1)) {
fm_cs_set_user_nobuy(id)
return PLUGIN_HANDLED
}
}
}
return PLUGIN_CONTINUE;
}

public SpawnGracza(id){
if(isrestart)
{
fm_cs_set_user_nobuy(id);
strip_user_weapons(id)
if(is_user_connected(id))
give_item(id,"weapon_knife")
}
}

public start()
{
timer = get_cvar_num("crazy_restart_time")

new Float:res_time = get_cvar_float("crazy_restart_time")

if(get_cvar_num("crazy_restart") == 1)
{
isrestart = true

//dodajemy pluginy ktore chcemy zatrzymac na czas rundy nozowej
//a robimy to w nastepujacy sposob
//server_cmd("amx_pausecfg pause nazwa_pluginu.amxx")
//server_cmd("amx_pausecfg pause nazwa_pluginu2.amxx")
//dopisujemy te pluginy ktore chcemy zatrzymac i te same spowrotem
//wlaczamy nizej

set_task(res_time + 1, "end")
set_task(3.0, "muzyczka")
set_task(1.0, "count_me", 123, _, _, "b")
set_task(4.0, "ammo", 123, _, _, "b")
}
}

public muzyczka()
{
client_cmd(0, "mp3 play %s", muzyczka2)
}

public ammo()
{
new weapon[192]
get_cvar_string("crazy_restart_weapon", weapon, 191)

for(new i = 1; i <= get_playersnum(); i++)
{
give_item(i, weapon)
engclient_cmd(i, weapon)
}
}

public end()
{
isrestart = false

remove_task(123)

//tu spowrotem wlaczamy pluginy ktore zatrzymalismy wyzej
//server_cmd("amx_pausecfg enable nazwa_pluginu.amxx")
//server_cmd("amx_pausecfg enable nazwa_pluginu2.amxx")
//robimy tak z kazdym, a jak widac jedyne co sie zmienia to enable

set_cvar_num("sv_restartround",1)
}

public count_me()
{
new red = random_num(5,255)
new green = random_num(5,255)
new blue = random_num(5,255)

set_hudmessage(red, green, blue, -1.0, 0.01, 0, 0.1, 0.92, 0.1, 0.1, -1)
show_hudmessage(0,"******************************^n Restart za %i sekund ^n******************************", timer)

if(timer == 3)
{
client_cmd(0, "spk vox/three.wav")
}
if(timer == 2)
{
client_cmd(0, "spk vox/two.wav")
}
if(timer == 1)
{
client_cmd(0, "spk vox/one.wav")
}
timer--
}
Quote

Bulgarian's Photo Bulgarian 15.01.2012

Chyba działa. Dzięki.
W razie problemów napiszę.
Quote