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

Subplugin Submission [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 05-21-2012 , 04:14   [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
Reply With Quote #1

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
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_5_items.sma - 1952 views - 2.9 KB)
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 05-24-2012 at 04:26.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 05-21-2012 , 05:06   Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
Reply With Quote #2

Did you try to compile the code?
__________________
H.RED.ZONE is offline
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 05-24-2012 , 00:10   Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
Reply With Quote #3

Compile error xD
__________________
naSTR is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 05-24-2012 , 04:24   Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
Reply With Quote #4

Quote:
Originally Posted by naSTR View Post
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

__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
KillerMasa
Senior Member
Join Date: May 2012
Old 05-24-2012 , 10:22   Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
Reply With Quote #5

gj, nice plugin
KillerMasa is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 05-24-2012 , 12:02   Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
Reply With Quote #6

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;

__________________
H.RED.ZONE is offline
anantthakor
Senior Member
Join Date: Aug 2009
Old 08-23-2012 , 04:37   Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
Reply With Quote #7

what does Damage Selection do ?
anantthakor is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-23-2012 , 10:14   Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
Reply With Quote #8

Quote:
Originally Posted by H.RED.ZONE View Post
More efficient way would be.
Ever heard of a switch-condition?
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 08-23-2012 , 13:30   Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
Reply With Quote #9

Quote:
Originally Posted by mottzi View Post
Ever heard of a switch-condition?
Ever heard that a switch-condition does not support non-constant values ?
micapat is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 08-23-2012 , 13:39   Re: [ZP] +Health | Damage Selection | Teleport | Nemesis | Survivor
Reply With Quote #10

Quote:
Originally Posted by mottzi View Post
Ever heard of a switch-condition?
If i could have done it i would (:
-->
Quote:
Originally Posted by micapat View Post
Ever heard that a switch-condition does not support non-constant values ?
__________________
H.RED.ZONE 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 05:11.


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