| Napoleon_be |
06-27-2012 14:18 |
Re: Freezing Problem
Can someone fix this for me? Cause i've never worked with Ham_Item_Preframe
Full code:
PHP Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta> #include <fun> #include <cstrike> #include <colorchat>
#define PLUGIN "HideNseeK" #define VERSION "1.0.0" #define AUTHOR "NapoleoN#"
#define TASKID 1996
new Timer new Rounds new maxplayers new pArmor
new bool:plrSolid[33] new bool:plrRestore[33] new plrTeam[33]
new const WEAPONS[] = { CSW_HEGRENADE, CSW_FLASHBANG, CSW_SMOKEGRENADE }
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) // ham // events register_logevent("Cmdround", 2, "1=Round_Start") register_logevent("CtWinEvent", 6, "3=CTs_Win", "3=All_Hostages_Rescued") register_logevent("TsWinEvent" , 6, "3=Terrorists_Win", "3=Target_Bombed") // fakemeta register_forward(FM_CmdStart, "CmdStart") register_forward(FM_PlayerPreThink, "preThink") register_forward(FM_PlayerPostThink, "postThink") register_forward(FM_AddToFullPack, "addToFullPack", 1) // pcvars pArmor = register_cvar("hns_armor", "100") maxplayers = get_maxplayers() }
public CtWinEvent(id) { Rounds = 0 new players[32], count get_players(players, count, "e", "CT") for(new i; i < count; i++) { cs_set_user_team(players[i], CS_TEAM_T) ColorChat(players[i], GREEN, "[HNS]^1 Changing teams...") } }
public TsWinEvent(id) { if(Rounds == 3) { ColorChat(0, GREEN, "[HNS]^1 The ct's can now use nubslash because of loosing 3 rounds...") } else { Rounds++ } }
public plugin_cfg() { set_cvar_num("sv_freezetime", 0) }
public Cmdround(id) { if (task_exists(TASKID)) remove_task(TASKID) set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 0.1, 14.0, 0.1, 1.0, 1) show_hudmessage(0, "[HideNseeK]") Timer = 10 set_task(1.0, "Cmdcountdown", TASKID, _, _, "a", Timer) new players[32], count get_players(players, count, "ae", "CT") for(new i; i < count; i++) { set_user_maxspeed(players[i], -1.0) set_task(11.0, "RemoveFreeze", players[i]) } get_players(players, count, "ae", "TERRORIST") for(new i; i < count; i++) { strip_user_weapons(players[i]) } }
public Cmdcountdown(id) { Timer-- if (Timer > 0) { set_hudmessage(255, 255, 255, -1.0, 0.03, 0, 0.1, 1.0, 0.1, 0.1, 2) show_hudmessage(0, "%i", Timer) } else { set_hudmessage(255, 255, 255, -1.0, 0.03, 0, 0.1, 3.0, 0.1, 1.0, 3) show_hudmessage(0, "Ready or not, here we come!") new players[32], count get_players(players, count, "ae", "CT") for(new i; i < count; i++) { set_task(2.0, "StripWeapons", players[i]) } } }
public RemoveFreeze(id) { if(is_user_alive(id)) { set_user_maxspeed(id, 0.1) } }
public StripWeapons(id) { if(is_user_alive(id)) { strip_user_weapons(id) give_item(id, "weapon_knife") set_user_armor(id, get_pcvar_num(pArmor)) if(cs_get_user_team(id) == CS_TEAM_T) { if(random(100) > 90) { give_item(id, "weapon_hegrenade") ColorChat(id, GREEN, "[HNS]^1 You receive a^3 HE Grenade^4 (10 percent chance)") } if(random(100) > 75) { give_item(id, "weapon_smokegrenade") ColorChat(id, GREEN, "[HNS]^1 You receive a^3 Smoke Grenade^4 (25 percent chance)") } if(random(100) > 50) { give_item(id, "weapon_flashbang") ColorChat(id, GREEN, "[HNS]^1 You receive a^3 FlashBang^4 (50 percent chance)") } } } }
public CmdStart(id, Handle) { static button button = get_uc(Handle, UC_Buttons) if (button & IN_ATTACK && cs_get_user_team(id) == CS_TEAM_CT && Rounds < 3) { button &= ~IN_ATTACK } for(new i; i < sizeof(WEAPONS); i++) { if(button & IN_ATTACK && cs_get_user_team(id) == CS_TEAM_CT && get_user_weapon(id) != WEAPONS[i]) { button &= ~IN_ATTACK } } set_uc(Handle, UC_Buttons, button) }
public addToFullPack(es, e, ent, host, hostflags, player, pSet) { if(player) { if(plrSolid[host] && plrSolid[ent] && plrTeam[host] == plrTeam[ent]) { set_es(es, ES_Solid, SOLID_NOT) set_es(es, ES_RenderMode, kRenderTransAlpha) set_es(es, ES_RenderAmt, 255) } } }
FirstThink() { for(new i = 1; i <= maxplayers; i++) { if(!is_user_alive(i)) { plrSolid[i] = false continue } plrTeam[i] = get_user_team(i) plrSolid[i] = pev(i, pev_solid) == SOLID_SLIDEBOX ? true : false } }
public preThink(id) { static i, LastThink
if(LastThink > id) { FirstThink() } LastThink = id
if(!plrSolid[id]) { return }
for(i = 1; i <= maxplayers; i++) { if(!plrSolid[i] || id == i) { continue } if(plrTeam[i] == plrTeam[id]) { set_pev(i, pev_solid, SOLID_NOT) plrRestore[i] = true } } }
public postThink(id) { static i
for(i = 1; i <= maxplayers; i++) { if(plrRestore[i]) { set_pev(i, pev_solid, SOLID_SLIDEBOX) plrRestore[i] = false } } }
I've been fucking around with the code now for a bit to get it fixed, but nothing worked.
|