Raised This Month: $32 Target: $400
 8% 

[ZR] Block the respawning of headshot zombies plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author
cjsrk
Junior Member
Join Date: Mar 2023
Location: China
Plugin ID:
8606
Plugin Version:
1.0.0
Plugin Category:
All
Plugin Game:
Any
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
Block the respawning of headshot zombies for ZombieReloaded
Old 12-09-2023 , 11:31   [ZR] Block the respawning of headshot zombies plugin
Reply With Quote #1

This is a very simple plugin. This only works if you're using the ZombieReloaded plugin and you allow zombies to respawn (zr_respawn is set to 1).
It's supposed to stop zombies from regenerating after being headshot by humans.
Attached Files
File Type: sp Get Plugin or Get Source (Block the respawning of headshot zombies.sp - 31 views - 1.3 KB)
File Type: smx Block the respawning of headshot zombies.smx (4.8 KB, 24 views)

Last edited by cjsrk; 12-10-2023 at 10:39.
cjsrk is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 12-10-2023 , 11:08   Re: [ZR] Block the respawning of headshot zombies plugin
Reply With Quote #2

PHP Code:
#pragma semicolon 1

#include <zombiereloaded>

#pragma newdecls required

public Plugin myinfo =
{
    
name        "Block the respawning of headshot zombies",
    
author        "cjsrk",
    
description    "<- Description ->",
    
version        "0.1_fix",
    
url            "<- URL ->"
}

bool IsHeadshot[MAXPLAYERS+1];

public 
void OnPluginStart()
{
    
HookEvent("round_end"Event_RoundEndEventHookMode_PostNoCopy);
    
HookEvent("player_death"Event_PlayerDeathEventHookMode_Pre);
}

public 
void OnMapStart()
{
    for(
int i 1<= MaxClientsi++) IsHeadshot[i] = false;
}

public 
void OnClientPutInServer(int client)
{
    
IsHeadshot[client] = false;
}

public 
void Event_RoundEnd(Event event, const char[] namebool dontBroadcast)
{
    
OnMapStart();
}

public 
void Event_PlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    if(!
event.GetBool("headshot"))
        return;

    
IsHeadshot[GetClientOfUserId(event.GetInt("userid"))] = true;
    
PrintToChatAll("Zombie lost his head! =)");
}

public 
Action ZR_OnClientRespawn(int &clientZR_RespawnCondition &condition)
{
    return 
IsHeadshot[client] ? Plugin_Handled Plugin_Continue;

__________________
Grey83 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode