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.
It's not called in the player disconnect event only see the code again. And i don't know why he set it to 0 it should be -1 this is copied from Ice Cube plugin not by me.
Ok i agreed i mean i copied this from Ice Cube Plugin if you have account in AlliedModders you can report it also to be fixed in this plugin: forums.alliedmods.net/showthread.php?t=244661
register_event("WeapPickup","CheckModel","b","1=19") register_event("CurWeapon","CurrentWeapon","be","1=1") you can use Ham_Item_Deploy , it gets called on both weapon pickup, and weapon change.
// Stop Moving Mouse set_pev(id , pev_v_angle , Float:{0.0,0.0,0.0}) set_pev(id , pev_fixangle , 1) Create a cvar to change price and name of the weapon.
You can remove this, there's no way a player to have a M4A1 on connect or to be frozen.
public client_putinserver(id) { g_bHasFrostM4A1[id] = false g_bIsFrozen[id] = false } Here you're checking if g_bHasFrostM4A1 is true then set it false
public zp_user_infected_post(infected, infector) { if (g_bHasFrostM4A1[infected]) { g_bHasFrostM4A1[infected] = false } }
But here you aren't, stick to one way, either check if it's true on both either remove from the first too.
public zp_user_humanized_post(id) { g_bHasFrostM4A1[id] = false g_iDmg[id] = 0 RemoveEntity(id) } Why are you calling a task for no reason? Task creation lags the players , remove this
set_task(0.1, "remove_jibs", id)
and put the code inside remove_jibs in the original function (RemoveFrost)
1-Yes, Ham_Item_Deploy is better, I'll change it next update.
2-This just the forward cells i write it so anyone read it understand that the second parameter for infector he may use it.
3-It's same, as set_user_rendering(id) mean: set_user_rendering(id, kRenderFxNone, 255, 255, 255, kRenderNormal, 16) So don't think if you remove the rest you make optimization you just will not see it only but it's processed as default.
4-No, task can't handle this. There is better ways but this also is fine it's used in ZP4.3 but i'll try apply the Ham method. PreThink have it's own usages not bad all time and not good at time you should use it when you need it only.
5-I don't make this plugin for noobs, So if one need to change anything he should learn how to compile the code also he can edit the name/price from extra_items.ini it's ZP not normal game!
6-Yes, As i remove it in player disconnect it's useless to remove again in his connect will be removed.
As when he infected i already checked if he has then set it to false so it's already false. Will be fixed.
8-No, Task is better but i should call it once only: set_task(0.1, "Remove_Jibs", _, _, _, "a", 1) I don't add it in the original function to make the code readable.
8) I didn't understand, why are you calling a task only once inside a function with a 0.1 interval? It anyways doesn't do anything because it gets called instantly after your create it. It would be useful if it was a repeatable task (flag "b") to check every 0.1 seconds but now it's useless.
// Remove Frost Effect public RemoveFrost(id) { // Not alive or not frozen anymore if (!is_user_alive(id) || !g_bIsFrozen[id]) return
// Rest Player Speed ExecuteHamB(Ham_Player_ResetMaxSpeed, id)
Remove_Rendering(id) RemoveStatusIcon(id) }
-->
// Remove Frost Effect public RemoveFrost(id) { // Not alive or not frozen anymore if (!is_user_alive(id) || !g_bIsFrozen[id]) return
// Unfreeze g_bIsFrozen[id] = false;
RemoveEntity(id)
new Float:origin[3] pev(id,pev_origin,origin)
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(g_iGlassGibs) // model write_byte(10) // count write_byte(25) // life write_byte(0x01) // flags message_end()