AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   [ZP] Addon : Last Human Pain Shock Free (https://forums.alliedmods.net/showthread.php?t=158567)

Dolph_Ziggler 06-06-2011 10:55

[ZP] Addon : Last Human Pain Shock Free
 
1 Attachment(s)
[ZP] Addon : Last Human Pain Shock Free


Plugin Description:
This add the last human pain shock free.

Cvars:
zp_last_human_pain_free // Enable/Disable last human psf [0-Disable/1-Enabled]
zp_human_pain_free_in_swarm // Enable/Disable human psf in swarm round [0-Disable/1-Enabled] - default : 0

dias 06-06-2011 11:00

Re: [ZP] Addon : Last Human Pain Shock Free
 
Edit your title in your post :|...
-> added this thread to new plugins list

georgik57 06-06-2011 11:01

Re: [ZP] Addon : Last Human Pain Shock Free
 
very nice idea
adding this to my zp too xD

Dolph_Ziggler 06-06-2011 11:04

Re: [ZP] Addon : Last Human Pain Shock Free
 
Quote:

Originally Posted by dias (Post 1482397)
Edit your title in your post :|...
-> added this thread to new plugins list

@dias oyyyyyyyyy xDD edited xD
@geaorgik thank you xD

ms@.@ 06-07-2011 10:17

Re: [ZP] Addon : Last Human Pain Shock Free
 
GoooooooooooooD

Dolph_Ziggler 06-07-2011 13:02

Re: [ZP] Addon : Last Human Pain Shock Free
 
Quote:

Originally Posted by ms@.@ (Post 1482956)
GoooooooooooooD

thnx :mrgreen:

GraviAnt 06-21-2011 18:26

Re: [ZP] Addon : Last Human Pain Shock Free
 
Awesome, thanks!

Excalibur.007 06-21-2011 20:32

Re: [ZP] Addon : Last Human Pain Shock Free
 
There should be credits to this e.g. Pain shock free code. I believe it's someone else right?

This is better

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>

new cvar_last_human_pain_freecvar_human_pain_free_swarm
new cached_last_human_pain_freecached_human_pain_free_swarm

const OFFSET_LINUX 5
const OFFSET_PAINSHOCK 108
const PDATA_SAFE 2

#define PLUGIN "[ZP] Last Human Pain Shock Free"
#define VERSION "0.1"
#define AUTHOR "Dolph_Ziggler"

new g_bitZombiePlayersg_bitLastHumanPlayers

#define MarkUserZombie(%0)       g_bitZombiePlayers |= (1 << (%0 & 31))
#define ClearUserZombie(%0)      g_bitZombiePlayers &= ~(1 << (%0 & 31))
#define IsUserZombie(%0)    g_bitZombiePlayers & (1 << (%0 & 31))

#define MarkUserLastHuman(%0)   g_bitLastHumanPlayers |= (1 << (%0 & 31))
#define ClearUserLastHuman(%0)  g_bitLastHumanPlayers &= ~(1 << (%0 & 31))
#define IsUserLastHuman(%0)    g_bitLastHumanPlayers & (1 << (%0 & 31))

new bool:bInSwarm

public plugin_init()
{    
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
    
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage"1)
    
    
cvar_last_human_pain_free register_cvar("zp_last_human_pain_free""1"
    
cvar_human_pain_free_swarm register_cvar("zp_human_pain_free_in_swarm""0")
}

public 
client_disconnect(id)
{
    
ClearUserZombie(id)
    
ClearUserLastHuman(id)
}

public 
event_new_round()
{
    
cached_last_human_pain_free get_pcvar_num(cvar_last_human_pain_free)
    
cached_human_pain_free_swarm get_pcvar_num(cvar_human_pain_free_swarm)
    
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum)
    
    for(new 
0iNumi++)
    {
        
ClearUserZombie(i)
        
ClearUserLastHuman(i)
    }
}

public 
Player_TakeDamage(id)
{
    if(
pev_valid(id) != PDATA_SAFE)
        return 
HAM_IGNORED
        
    
if(IsUserZombie(id))
        return 
HAM_IGNORED
        
    
if (IsUserLastHuman(id) && cached_last_human_pain_free)
    {
        
set_pdata_float(idOFFSET_PAINSHOCK1.0OFFSET_LINUX)
    }
    else if (
bInSwarm && cached_human_pain_free_swarm)
    {
        
set_pdata_float(idOFFSET_PAINSHOCK1.0OFFSET_LINUX)
    }
    
    return 
HAM_IGNORED
}

public 
zp_round_started(gamemode)
{
    if(
gamemode == MODE_SWARM)
        
bInSwarm true
    
else
        
bInSwarm false // Reset it on a new mode start
}

public 
zp_user_infected_post(id)
{
    
MarkUserZombie(id)
}

public 
zp_user_humanized_post(id)
{
    
ClearUserZombie(id)
}

public 
zp_user_last_human(id)
{
    
MarkUserLastHuman(id)



tei1995 06-21-2011 22:07

Re: [ZP] Addon : Last Human Pain Shock Free
 
you can use some native in zp 4.3 new native, its easy :D

Excalibur.007 06-22-2011 00:56

Re: [ZP] Addon : Last Human Pain Shock Free
 
Quote:

Originally Posted by tei1995 (Post 1493201)
you can use some native in zp 4.3 new native, its easy :D

I still prefer the ZP 4.3 Fix3 though. Although it creates some problems, which can be fixed, with setting speed after the updates.


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

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