#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <fakemeta_util>
#include <colorchat>
#define PLUGIN "Ganiany"
#define VERSION "1.0"
#define AUTHOR "Gierek"
new g_tempid, goniec
new ctek[33]
new bron[33]
new Float:roundstart
new gn_time
new gn_speed
new Float: speed
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /ganiany", "ganianyspr");
register_clcmd("say_team /ganiany", "ganianyspr");
register_event("CurWeapon","cur_weapon","be", "1=1");
register_forward(FM_CmdStart, "CmdStart");
RegisterHam(Ham_Spawn, "player", "Odrodzenie", 1);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
register_logevent("round_start", 2, "1=Round_Start")
register_logevent("round_end", 2, "1=Round_End")
register_cvar("gn_enable", "1")
gn_time = register_cvar("gn_time", "20.0")
gn_speed = register_cvar("gn_speed", "255.0")
register_cvar("gn_weapon", "1")
}
public plugin_cfg()
{
server_cmd("sv_maxspeed 255");
}
public cur_weapon(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED;
static Float:nowtime
nowtime = get_gametime()
if(goniec==1 && nowtime - roundstart < get_cvar_float("mp_roundtime")*60)
engclient_cmd(id,"weapon_knife");
return PLUGIN_HANDLED;
}
public round_start()
{
roundstart = get_gametime()
}
public round_end()
{
goniec=0
}
public CmdStart(id, uc_handle)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
static Float: nowtime
nowtime = get_gametime()
if(goniec==1 && ctek[id] == 0)
{
if(nowtime - roundstart < get_cvar_float("mp_roundtime")*60)
set_user_maxspeed(id, speed);
else
{
set_user_maxspeed(id, 255.0);
if(bron[id]==1)
{
bron[id]=0
give_item(id, "knife")
cs_set_user_bpammo(id, CSW_M4A1, 90)
}
}
}
return FMRES_IGNORED;
}
public Odrodzenie(id)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_CONTINUE;
set_user_maxspeed(id, 250.0);
return PLUGIN_CONTINUE;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_alive(this) || !is_user_connected(this) || !is_user_connected(idattacker) || get_user_team(this) == get_user_team(idattacker))
return HAM_IGNORED;
static Float:nowtime
nowtime = get_gametime()
if(cs_get_user_team(idattacker) == CS_TEAM_T && cs_get_user_team(this) == CS_TEAM_CT)
{
if(goniec==1 && nowtime - roundstart < get_cvar_float("mp_roundtime")*60)
{
set_user_frags(this,get_user_frags(this)+1)
user_kill(idattacker)
return HAM_SUPERCEDE
}
}
return HAM_IGNORED;
}
public ganianyspr(id)
{
if(get_cvar_num("gn_enable"))
{
if(cs_get_user_team(id) == CS_TEAM_T)
{
ColorChat(id, GREEN, "[JailBreak]^x01 Nie jestes Klawiszem");
return PLUGIN_HANDLED;
}
if(!is_user_alive(id))
{
ColorChat(id, GREEN, "[JailBreak]^x01 Nie zyjesz wiec nie mozesz uzywac tej komendy");
return PLUGIN_HANDLED;
}
if(goniec==1)
{
ColorChat(id, GREEN, "[JailBreak]^x01 Ganiany jest juz wlaczony");
return PLUGIN_HANDLED;
}
goniec = 1
force_open()
ganiany()
speed = get_pcvar_float(gn_speed)
if(speed<250.0)
speed=250.0
}
return PLUGIN_HANDLED;
}
public ganiany()
{
new players[32], pnum
get_players(players, pnum)
new Float: czas = get_pcvar_float(gn_time)
for( new i; i<pnum;i++ )
{
g_tempid = players[i];
if(get_cvar_num("gn_weapon"))
bron[g_tempid] = 1
else
bron[g_tempid] = 0
if(cs_get_user_team(g_tempid) == CS_TEAM_T && is_user_alive(g_tempid))
{
set_user_maxspeed(g_tempid, 550.0);
ctek[g_tempid] = 0
}
if(cs_get_user_team(g_tempid) == CS_TEAM_CT && is_user_alive(g_tempid))
{
strip_user_weapons(g_tempid);
give_item(g_tempid, "weapon_knife");
set_user_maxspeed(g_tempid, 0.01);
set_task(czas, "ganianystart", g_tempid)
ctek[g_tempid] = 1
}
}
}
public ganianystart(id)
{
ctek[id] = 0
set_hudmessage(85, 212, 255, -1.0, 0.22, 0, 6.0, 12.0)
show_hudmessage(id, "Klawisze wypuszczeni!^nWiezniowie spierdalajcie!")
}
public force_open()
{
new ent = -1
while((ent = fm_find_ent_by_class(ent, "func_door")))
{
dllfunc(DLLFunc_Use, ent, 0)
}
}
Witam. Można to edytować tak, aby komenda była tylko dla admina z flagą B ? Przy okazji - jeśli ktoś może to proszę o skompilowanie do amxx
Pozdrawiam.
@ref
Użytkownik Patmar1 edytował ten post 02.02.2012 20:11