madness, I'll add this in next update when i have time. @mr. ZP, The Frost one is final and it have no bugs, But Fire one not released yet this is just quick one and i'll write the code again when i have time.
new M4A1_V_MODEL[64] = "models/v_forst_m4a1.mdl" new M4A1_P_MODEL[64] = "models/p_forst_m4a1.mdl" new const ice_model[] = "models/icecube_frozen.mdl" new const MODEL_GLASSGIBS[] = "models/glassgibs.mdl" new const SOUND_UNFROZEN[] = "debris/glass3.wav"
new gc_itemID new bool:g_ForstM4A1[33] new g_FrozeN[33] new M4A1ForstSpr new g_msgScreenFade new g_iMaxPlayers new g_HudSync new FrostTime new BackSpeed new m_spriteLaser new g_iDmg[33] new FreezeDamage new glassGibs
const UNIT_SECOND = (1<<12)
public plugin_init() { register_plugin("[ZP] Extra Item: Frost M4A1", "1.3", "Raheem")
public zp_user_infected_post(infected, infector) { if (g_ForstM4A1[infected]) { g_ForstM4A1[infected] = false } }
public zp_user_humanized_post(id) { g_ForstM4A1[id] = false RemoveEntity(id) }
public event_round_start() { for (new i = 1; i <= g_iMaxPlayers; i++) { if (g_ForstM4A1[i]) { g_ForstM4A1[i] = false } if(g_FrozeN[i]) { g_FrozeN[i] = false } } }
public EventDeathMsg() { new victim = read_data(2) RemoveEntity(victim) g_FrozeN[victim] = false }
public FrostEffect(id) { // Only effect alive unfrozen zombies if (!is_user_alive(id) || !zp_get_user_zombie(id) || g_FrozeN[id]) return;
message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, _, id) write_short(UNIT_SECOND*1) // duration write_short(UNIT_SECOND*1) // hold time write_short(0x0000) // fade type write_byte(0) // red write_byte(50) // green write_byte(200) // blue write_byte(100) // alpha message_end()
g_FrozeN[id] = true set_task(get_pcvar_float(FrostTime), "RemoveFrost", id) // Time to Remove Frost Effect }
public fw_PlayerPreThink(id) { // Not alive if (!is_user_alive(id)) return;
// Set Player MaxSpeed if (g_FrozeN[id]) { set_pev(id, pev_velocity, Float:{0.0,0.0,0.0}) // stop motion set_pev(id, pev_maxspeed, 1.0) // prevent from moving } else { set_pev(id, pev_maxspeed, get_pcvar_float(BackSpeed)) // Change this in Cvar if you Want } }
// Frost Effect Sound public FrostEffectSound(iOrigin[3]) { new Entity = create_entity("info_target")
message_begin_fl(MSG_PVS,SVC_TEMPENTITY,origin,0); write_byte(TE_IMPLOSION); write_coord_fl(origin[0]); // x write_coord_fl(origin[1]); // y write_coord_fl(origin[2] + 8.0); // z write_byte(64); // radius write_byte(10); // count write_byte(3); // duration message_end();
message_begin_fl(MSG_PVS,SVC_TEMPENTITY,origin,0); write_byte(TE_SPARKS); write_coord_fl(origin[0]); // x write_coord_fl(origin[1]); // y write_coord_fl(origin[2]); // z message_end();
message_begin_fl(MSG_PAS,SVC_TEMPENTITY,origin,0); write_byte(TE_BREAKMODEL); write_coord_fl(origin[0]); // x write_coord_fl(origin[1]); // y write_coord_fl(origin[2] + 24.0); // z write_coord_fl(16.0); // size x write_coord_fl(16.0); // size y write_coord_fl(16.0); // size z write_coord(random_num(-50,50)); // velocity x write_coord(random_num(-50,50)); // velocity y write_coord_fl(25.0); // velocity z write_byte(10); // random velocity write_short(glassGibs); // model write_byte(10); // count write_byte(25); // life write_byte(BREAK_GLASS); // flags message_end();
Raheem bro i found one more bug i mean like when i buy another m4a1 like golden m4a1 its like convert with frost? i mean not dropping frost m4a1 while you buy another m4a1 :\
even when i drop frost m4a1 and buy golden m4a1 its still same frost m4a1 with golden :S!!
You need stock for that.
Buy Weapon M16 then drop , then Buy Forest M4A1 for 8DAMAGE
medo, Already solved just use the Auto-Mixed fixed ones also there is Native to handle this, If you need to run Forst M4A1 with Another M4A1 just upload it's sma and i'am going to add to it the native so no mix will occur.
Important for all use this plugin New Simple Fix inserted, Please use the final versions. The damage hud message was shown for all i don't realize this untill i tested it with another players in @alnazo server. So what only changes:
1. Rather than allocating place many times, just do it in one shot.
new gc_itemID new bool:g_ForstM4A1[33] new g_FrozeN[33] new M4A1ForstSpr new g_msgScreenFade new g_iMaxPlayers new g_HudSync new FrostTime new BackSpeed new m_spriteLaser new g_iDmg[33] new FreezeDamage new glassGibs -->
3. You don't have to call client_disconnect, just do them in client_putinserver, although you need to check if that entity exists first, i'm not sure how to do that tho.. xd
public client_putinserver(id) { g_ForstM4A1[id] = false g_FrozeN[id] = false }
4. Check if user is valid (1 <= attacker <= 32) or it will give invalid player id error , and you need to return HAM_ returns not PLUGIN_ .. it's a HAM forward !!!! Also checking if user is connected is useless, just check if attacker is alive..
1-Agree 2-LOL, My English isn't so good i know. 3-Important to RemoveEntity in player disconnect, Suppose that you got frozen with the ice cube and you quikly disconnected from the server if the disconnect event not there the ice cube will be remain although you disconnected. 4-I agree we should check the attacker also returns you are right in.