Page 1 of 4
No Entities Block
Posted: 22 Jun 2017, 02:45
by Night Fury
No Entities Block
Description:
- I'm here with a new plugin which will block players from blocking things such as train, car, plane, door, etc..
Plugin was tested on public server.
Code:
#include <zombie_escape>
new const szEntities[][] =
{
"func_train",
"func_vehicle",
"func_tracktrain",
"func_door"
}
public plugin_init()
{
register_plugin("No Block", "1.0", "Raheem")
for (new i = 0; i < charsmax(szEntities); i++)
{
RegisterHam(Ham_Blocked, szEntities[i], "Fw_Blocked_Post", 1)
}
}
public Fw_Blocked_Post(iEnt, id)
{
if (is_user_alive(id) && pev_valid(iEnt))
{
new Float:flVelocity[3]
velocity_by_aim(id, 550, flVelocity)
flVelocity[0] += 20.0
flVelocity[1] += 20.0
flVelocity[2] += 20.0
set_entvar(id, var_velocity, flVelocity)
}
}
Downloads:
Re: No Entities Block
Posted: 22 Jun 2017, 03:24
by Raheem
Great job....... So nice. Missing fix for years and it's finally out....
Re: No Entities Block
Posted: 22 Jun 2017, 07:57
by johnnysins2000
Thank You very Much Jack
I will try this plugin Now
Re: No Entities Block
Posted: 22 Jun 2017, 08:36
by sam_bhosale4
Jack GamePlay wrote: ↑6 years ago
No Entities Block
Description:
- I'm here with a new plugin which will block players from blocking things such as train, car, plane, door, etc..
Plugin was tested on public server.
Code:
#include <zombie_escape>
new const szEntities[][] =
{
"func_train",
"func_vehicle",
"func_tracktrain",
"func_door"
}
public plugin_init()
{
register_plugin("[ZE] Addons: No Block", "1.0", "Jack GamePlay")
register_forward(FM_Touch, "Fw_Touch")
}
public Fw_Touch(iEnt, id)
{
// Not alive or Wrong entity
if(!is_user_alive(id) || !pev_valid(iEnt))
return FMRES_IGNORED // Block below code
new szClassName[32] // Variable to store entity's name.
pev(iEnt, pev_classname, szClassName, charsmax(szClassName))
// Loop though all the 2d array
for(new i = 1; i <= charsmax(szEntities); i++)
{
// If the same...
if (equal(szClassName, szEntities[i]))
{
// Block blocking
set_pev(id, pev_solid, SOLID_TRIGGER)
return FMRES_IGNORED
}
}
return FMRES_IGNORED
}
Downloads:
Very well done jack!
Ill soon test it on my server!
+like +karma
Re: No Entities Block
Posted: 22 Jun 2017, 16:40
by Raheem
Don't use this plugin for now till it be fixed. Locked Temporarily.
Re: No Entities Block
Posted: 22 Jun 2017, 21:28
by Night Fury
We have tried to fix crash & make the plugin better but we have failed.
This topic will be trashed.
Re: No Entities Block
Posted: 27 Aug 2017, 15:33
by Raheem
Fixed, While i was reading HAM hooks i found a function that can hook the block but it's too late to block the event itself so i do good thing for blockers... Try it.
Re: No Entities Block
Posted: 12 Sep 2017, 15:31
by sam_bhosale4
Raheem wrote: ↑6 years ago
Fixed, While i was reading HAM hooks i found a function that can hook the block but it's too late to block the event itself so i do good thing for blockers... Try it.
cool ill try!
Re: No Entities Block
Posted: 12 Sep 2017, 15:42
by johnnysins2000
sam_bhosale4 wrote: ↑6 years ago
Raheem wrote: ↑6 years ago
Fixed, While i was reading HAM hooks i found a function that can hook the block but it's too late to block the event itself so i do good thing for blockers... Try it.
cool ill try!
good after trying tell me what does it do
Re: No Entities Block
Posted: 13 Sep 2017, 04:56
by sam_bhosale4
acc to me it must give few amount of damage to the one who is blocking the entity otherwise he will die after few sec! lets see
Re: No Entities Block
Posted: 13 Sep 2017, 10:01
by Raheem
Good idea, Here it's blocker if he is human he will get small damage but if zombie it will be high + print him message in center "Stop BLOCKING!!!".
CODE:
#include <zombie_escape>
new const szEntities[][] =
{
"func_train",
"func_vehicle",
"func_tracktrain",
"func_door"
}
public plugin_init()
{
register_plugin("No Block", "1.0", "Raheem")
for (new i = 0; i <= charsmax(szEntities); i++)
{
RegisterHam(Ham_Blocked, szEntities[i], "Fw_Blocked_Post", 1)
}
}
public Fw_Blocked_Post(iEnt, id)
{
if (is_user_alive(id) && pev_valid(iEnt))
{
if (ze_is_user_zombie(id))
{
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 50.0, DMG_GENERIC)
}
else
{
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 5.0, DMG_GENERIC)
}
client_print(id, print_center, "Stop BLOCK!!!")
}
}
Re: No Entities Block
Posted: 20 Sep 2017, 04:39
by sam_bhosale4
Raheem wrote: ↑6 years ago
Good idea, Here it's blocker if he is human he will get small damage but if zombie it will be high + print him message in center "Stop BLOCKING!!!".
CODE:
#include <zombie_escape>
new const szEntities[][] =
{
"func_train",
"func_vehicle",
"func_tracktrain",
"func_door"
}
public plugin_init()
{
register_plugin("No Block", "1.0", "Raheem")
for (new i = 0; i <= charsmax(szEntities); i++)
{
RegisterHam(Ham_Blocked, szEntities[i], "Fw_Blocked_Post", 1)
}
}
public Fw_Blocked_Post(iEnt, id)
{
if (is_user_alive(id) && pev_valid(iEnt))
{
if (ze_is_user_zombie(id))
{
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 50.0, DMG_GENERIC)
}
else
{
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 5.0, DMG_GENERIC)
}
client_print(id, print_center, "Stop BLOCK!!!")
}
}
yo thanks raheem! have you tested it? working good?
Re: No Entities Block
Posted: 20 Sep 2017, 04:42
by sam_bhosale4
also you have added
"func_train",
"func_vehicle",
"func_tracktrain",
"func_door"
these entities few are remaining like heli, that slider, boat,ship etc etc
add these entities also
Re: No Entities Block
Posted: 20 Sep 2017, 04:59
by sam_bhosale4
Raheem wrote: ↑6 years ago
Good idea, Here it's blocker if he is human he will get small damage but if zombie it will be high + print him message in center "Stop BLOCKING!!!".
CODE:
#include <zombie_escape>
new const szEntities[][] =
{
"func_train",
"func_vehicle",
"func_tracktrain",
"func_door"
}
public plugin_init()
{
register_plugin("No Block", "1.0", "Raheem")
for (new i = 0; i <= charsmax(szEntities); i++)
{
RegisterHam(Ham_Blocked, szEntities[i], "Fw_Blocked_Post", 1)
}
}
public Fw_Blocked_Post(iEnt, id)
{
if (is_user_alive(id) && pev_valid(iEnt))
{
if (ze_is_user_zombie(id))
{
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 50.0, DMG_GENERIC)
}
else
{
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 5.0, DMG_GENERIC)
}
client_print(id, print_center, "Stop BLOCK!!!")
}
}
also please add a white glow where when the blocker gets damage he will glow white so admins can understand who is blocking! glow will be helpful for admins..
Re: No Entities Block
Posted: 20 Sep 2017, 06:56
by sam_bhosale4
just tested it! its not giving any kind of damage and message instead it instant kills the player
doesnt even shows the mssg!
Re: No Entities Block
Posted: 20 Sep 2017, 16:14
by Raheem
That's because the damage is too high so zombies killed fast or humans. You need to reduce damage to fit your humans/zombies HP from:
- ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 50.0, DMG_GENERIC)
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 5.0, DMG_GENERIC)
And about glow it's good idea also, So try this:
#include <zombie_escape>
new const szEntities[][] =
{
"func_train",
"func_vehicle",
"func_tracktrain",
"func_door"
}
public plugin_init()
{
register_plugin("No Block", "1.0", "Raheem")
for (new i = 0; i <= charsmax(szEntities); i++)
{
RegisterHam(Ham_Blocked, szEntities[i], "Fw_Blocked_Post", 1)
}
}
public Fw_Blocked_Post(iEnt, id)
{
if (is_user_alive(id) && pev_valid(iEnt))
{
if (ze_is_user_zombie(id))
{
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 1.0, DMG_GENERIC)
}
else
{
ExecuteHamB(Ham_TakeDamage, id, iEnt, iEnt, 0.5, DMG_GENERIC)
}
client_print(id, print_center, "Stop BLOCK!!!")
Set_Rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 40)
}
}
Change the glow color from: Set_Rendering(i, kRenderFxGlowShell,
255, 255, 255, kRenderNormal, 40) It's on RGB format.
And about you say there is another entities that moves like helicopter it will work also with them bro as these helicopters is one of these entities in the plugin. If you see in one map when you block a helicopter the plugin not works report it bro.
Re: No Entities Block
Posted: 21 Sep 2017, 13:23
by sam_bhosale4
getting many errors for Set_Rendering and when compiling without that it compiles without errors but now it doesnt work! no damage no mssg!
Re: No Entities Block
Posted: 21 Sep 2017, 19:40
by Raheem
Check code again.
Re: No Entities Block
Posted: 22 Sep 2017, 06:30
by sam_bhosale4
now working but need few changes! the ham is taking damage on Armour not health and also when the blocker stop blocking he keeps glowing need to terminate glow after block end
Re: No Entities Block
Posted: 22 Sep 2017, 07:33
by sam_bhosale4
suggestions-
1. set time for takedamage as 0.5 sec
2.glow is working good but player should glow only when blocking the entity once he stop glow should terminate!
3.if glow will blink every sec it would be nice
4.I wonder if we add human block in this..like when semiclip isnt added and players are inside the heli/entity if they come closer to each other and stick together the heli gets blocked, so in this case also the humans must get damage..
if these things comes into plugins it will be a great plugin of ze <3
and sorry bros(jacky and raheem) im giving you so much work but im just started in pawn amxx