Resolved Kill player if he block transporter entity.

Coding Help/Re-API Supported
Post Reply
Obada
Member
Member
Palestine
Posts: 27
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 0
Contact:

Kill player if he block transporter entity.

#1

Post by Obada » 1 Year Ago

HI all, i hope you fine.

I seen this thread No Entities Block and i found those:

Code: Select all

new const szEntities[][] =
{
    "func_train",
    "func_vehicle",
    "func_tracktrain",
    "func_door"
}
My question is how we can make the player who blocked those entities get killed / decrease his HP until he got killed by that entity? i mean make the entity is the killer.

I was seen before some server used that and when i blocked the transporter i got killed and this command appear on console.
player killed self with tracktrain.
I tried to make one for me like this:

Code: Select all

#include <zombie_escape>

new not_allow

new const szEntities[][] =
{
	"func_train",
	"func_vehicle",
	"func_tracktrain",
	"func_door"
}

public plugin_precache()
{
	precache_sound("zombie_escape/move.wav")
}

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(!not_allow)
	{
		if (is_user_alive(id) && pev_valid(iEnt))
		{
			not_allow = true
			Set_Rendering(id, kRenderFxGlowShell, random(256), random(256), random(256), kRenderNormal, 40)
			PlaySound(id, "zombie_escape/move.wav")
			if (!ze_is_user_zombie(id))
			{
				client_print(id, print_center, "You are blocking entity, MOVE! -10 H")
				client_print(id, print_chat, "You are blocking entity, MOVE! -10 H")
				new Float:pHealth = get_user_health(id) - 10.0
			}
			else
			{
				client_print(id, print_center, "You are blocking entity, MOVE! -1500 H")
				client_print(id, print_chat, "You are blocking entity, MOVE! -1500 H")
				new Float:pHealth = get_user_health(id) - 1500.0
				set_entvar(id, var_health, pHealth)				
			}
			set_task(2.00, "allow", id)
		}
	}
}

public allow(id)
{
    not_allow = false
}
I know we can use this:

Code: Select all

user_kill(id)
But this like a slay command which i don't need to use.

My edited on code doesn't make the player killed actually, that command make his HP 0 and he still can make block for the entity until round end.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#2

Post by Raheem » 1 Year Ago

Please read: viewtopic.php?f=15&t=1929 fully again, I already made it before.

viewtopic.php?p=4219#p4219
viewtopic.php?p=4232#p4232
.
.
.
You don't know? Learn and you will know.

Obada
Member
Member
Palestine
Posts: 27
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 0
Contact:

#3

Post by Obada » 1 Year Ago

LOL, That what i need exactly xD

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#4

Post by Raheem » 1 Year Ago

NICE. Marked as solved.
You don't know? Learn and you will know.

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 405
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#5

Post by Muhammet20 » 11 Months Ago

Raheem wrote:
1 Year Ago
NICE. Marked as solved.
raheem
man
help me please
i have problem when i compile the plugin
the problem is this

Error: Undefined symbol "Set_Rendering" on line 40
Error: Undefined symbol "PlaySound" on line 41
.::Kaya Gaming || Never Give Up || Zombie Escape::. [Server is Under The Work]
https://kaya-gaming.ga/

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

karan
Mod Tester
Mod Tester
India
Posts: 60
Joined: 2 Years Ago
Location: India
Has thanked: 1 time
Been thanked: 3 times
Age: 22
Contact:

#6

Post by karan » 11 Months Ago

Muhammet20 wrote:
11 Months Ago
Raheem wrote:
1 Year Ago
NICE. Marked as solved.
raheem
man
help me please
i have problem when i compile the plugin
the problem is this

Error: Undefined symbol "Set_Rendering" on line 40
Error: Undefined symbol "PlaySound" on line 41
use latest compiler
NeVeR DiE | Zombie Escape
IP : 139.59.90.127:40000
Image

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 405
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#7

Post by Muhammet20 » 11 Months Ago

karan wrote:
11 Months Ago
Muhammet20 wrote:
11 Months Ago
Raheem wrote:
1 Year Ago
NICE. Marked as solved.
raheem
man
help me please
i have problem when i compile the plugin
the problem is this

Error: Undefined symbol "Set_Rendering" on line 40
Error: Undefined symbol "PlaySound" on line 41
use latest compiler
no no the include file was have a false , i downloaded it again , its compile ing but the problem is , the plugin dont working in the game
.::Kaya Gaming || Never Give Up || Zombie Escape::. [Server is Under The Work]
https://kaya-gaming.ga/

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests