AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor (https://forums.alliedmods.net/showthread.php?t=185739)

rak 05-21-2012 04:14

[ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
 
1 Attachment(s)
Hi, in this plugin you have 5 extra items:
*Health(H +150 | Z +1500) Price: 12
*Damage Selection(1 Round) Price: 25
*Teleport price: 24
*Nemesis Price: 60
*Survivor Price: 80

If you buy "Damage Selection" when you hit a zombie you take 175 hp

Enjoy

P.S: Tested in ZP 4.3

EDIT; sorry.. xD my mistake

H.RED.ZONE 05-21-2012 05:06

Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
 
Did you try to compile the code?

naSTR 05-24-2012 00:10

Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
 
Compile error xD

rak 05-24-2012 04:24

Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
 
Quote:

Originally Posted by naSTR (Post 1715457)
Compile error xD

compile fine :S

PHP Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2006 ITB CompuPhaseAMX Mod X Team

Header size
:            872 bytes
Code size
:             3204 bytes
Data size
:             1596 bytes
Stack
/heap size:      16384 bytesestimated maxusage=42 cells (168 bytes)
Total requirements:   22056 bytes
Done



KillerMasa 05-24-2012 10:22

Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
 
gj, nice plugin

H.RED.ZONE 05-24-2012 12:02

Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
 
More efficient way would be.
PHP Code:

/*
    Name: Extra Items Pack
    Link: http://forums.alliedmods.net/showthread.php?t=185739
    Autor: [R]ak
*/


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

#define PLUGIN "Some Items Extra"
#define VERSION "1.0"
#define AUTHOR "[R]ak"

#define MarkUserInAlive(%0)   g_bitInAlive |= (1 << (%0 & 31))
#define ClearUserInAlive(%0)  g_bitInAlive &= ~(1 << (%0 & 31))
#define IsUserInAlive(%0)     g_bitInAlive & (1 << (%0 & 31))

#define MarkUserInConnected(%0)   g_bitInConnected |= (1 << (%0 & 31))
#define ClearUserInConnected(%0)  g_bitInConnected &= ~(1 << (%0 & 31))
#define IsUserInConnected(%0)    g_bitInConnected & (1 << (%0 & 31))

#define MarkUserInDamage(%0)   g_bitInDamagePlayers |= (1 << (%0 & 31))
#define ClearUserInDamage(%0)  g_bitInDamagePlayers &= ~(1 << (%0 & 31))
#define IsUserInDamage(%0)    g_bitInDamagePlayers & (1 << (%0 & 31))

new g_bitInDamagePlayers
    
,g_bitInConnected
    
,g_bitInAlive
    
,g_maxplayers

new item_vida
    
,item_damage
    
,item_teleport
    
,item_nemesis
    
,item_survivor

new g_tporigin[33][3]

const 
health_cost 12   // Cost of Health item
const damage_cost 25   // Cost of More Damage item
const teleport_cost 24 // Cost of teleport item
const nemesis_cost 60  // Cost of Buy Nemesis
const survivor_cost 80 // Cost of Buy Survivor


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
item_vida zp_register_extra_item("Health(H +150 | Z +1500)"health_costZP_TEAM_ANY)
    
item_damage zp_register_extra_item("Damage Selection(1 Round)"damage_costZP_TEAM_HUMAN)
    
item_teleport zp_register_extra_item("Teleport"teleport_costZP_TEAM_HUMAN)
    
item_nemesis zp_register_extra_item("Nemesis"nemesis_costZP_TEAM_ANY)
    
item_survivor zp_register_extra_item("Survivor"survivor_costZP_TEAM_ANY)
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled"
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
g_maxplayers get_maxplayers()
}

 public 
fw_PlayerKilled(victimattackershouldgib) {
    if(
IsUserInConnected(victim)) {
        
ClearUserInAlive(victim)
    }
}

public 
fw_PlayerSpawn_Post(id) {
    
    if(
IsUserInConnected(id)) {
        
MarkUserInAlive(id)
    }
    
    if(
IsUserInAlive(id)) {
        
pev(idpev_origing_tporigin[id])
    }    
}

public 
fw_TakeDamage(victiminflictorattacker) {
    
    if(
IsUserInAlive(attacker) && IsUserInAlive(victim) &&  IsUserInDamage(attacker))
        
SetHamParamFloat(4175.0)
}

public 
event_round_start(){
    for(new 
id 1;id <= g_maxplayers;id++) {
        
ClearUserInConnected(id)
        
ClearUserInDamage(id)
    }
}

public 
client_putinserver(id) {
    
MarkUserInConnected(id)
}

public 
client_disconnect(id) {
    
ClearUserInConnected(id)
    
}

public 
zp_extra_item_selected(iditemid) {
    
    if(
itemid == item_vida)
        
set_pev(idpev_healthfloat(pev(idpev_health)+(zp_get_user_zombie(id) ? 1500 150)))
    else if(
itemid == item_damage)
        
MarkUserInDamage(id)
    else if(
itemid == item_teleport) {
        new 
doneihull = (pev(idpev_flags) & FL_DUCKING) ? HULL_HEAD HULL_HUMAN
        
while(!done) {
            
random_num(132)
        
            if(!
g_tporigin[i][0] || !is_hull_vacant(Float:g_tporigin[i], hull))
                continue;
            
            
set_pev(idpev_origing_tporigin[i])
            
done++
        }
    }
    else if(
itemid == item_nemesis)
        
zp_make_user_nemesis(id)
    else if(
itemid == item_survivor)
        
zp_make_user_survivor(id)    
}

stock is_hull_vacant(Float:origin[3], hull) {
    
engfunc(EngFunc_TraceHulloriginorigin0hull00)

    if (!
get_tr2(0TR_StartSolid) && !get_tr2(0TR_AllSolid) && get_tr2(0TR_InOpen))
        return 
true;

    return 
false;



anantthakor 08-23-2012 04:37

Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
 
what does Damage Selection do ?

mottzi 08-23-2012 10:14

Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
 
Quote:

Originally Posted by H.RED.ZONE (Post 1715753)
More efficient way would be.

Ever heard of a switch-condition?

micapat 08-23-2012 13:30

Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
 
Quote:

Originally Posted by mottzi (Post 1780177)
Ever heard of a switch-condition?

Ever heard that a switch-condition does not support non-constant values ?

H.RED.ZONE 08-23-2012 13:39

Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
 
Quote:

Originally Posted by mottzi (Post 1780177)
Ever heard of a switch-condition?

If i could have done it i would (:
-->
Quote:

Originally Posted by micapat (Post 1780406)
Ever heard that a switch-condition does not support non-constant values ?



All times are GMT -4. The time now is 12:50.

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