Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP] Extra Item: T-Virus


Post New Thread Reply   
 
Thread Tools Display Modes
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 03-24-2009 , 10:35   Re: [ZP] Extra Item: T-Virus
Reply With Quote #21

why not use zp native [zp_infect_user] instead of use zp_zombie ?
also you can check if after the command the user becomes zombie or not , i f not return the ammo packs count.
AlejandroSk is offline
Send a message via MSN to AlejandroSk
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-24-2009 , 10:39   Re: [ZP] Extra Item: T-Virus
Reply With Quote #22

Quote:
Originally Posted by AlejandroSk View Post
why not use zp native [zp_infect_user] instead of use zp_zombie ?
also you can check if after the command the user becomes zombie or not , i f not return the ammo packs count.
It is a more effectively

Look at this:

PHP Code:
#include <amxmodx>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item: T-Virus"
#define VERSION "1.0"
#define AUTHOR "fezh"

new g_virus
const g_cost 15

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_virus zp_register_extra_item("T-Virus"g_costZP_TEAM_HUMAN)
}

public 
zp_extra_item_selected(iditemid)
{
    if (
itemid == g_virus)
    {
        if(
zp_get_user_zombie(id))
            return;
            
        
zp_infect_user(id)
        
set_task(1.0"check_zombie"id)
    }
}

public 
check_zombie(id)
{
    if(
zp_get_user_zombie(id))
    {
        new 
name[32]
        
get_user_name(idname31)
        
set_hudmessage(25500, -0.05, -0.4510.05.01.01.0, -1)
        
show_hudmessage(0"%s has infected himself with the T-Virus!"name)
    }
    else
    {
        new 
ammopacks
        ammopacks 
zp_get_user_ammo_packs(id)
        
zp_set_user_ammo_packs(idammopacks g_cost)
    }

__________________

Last edited by alan_el_more; 03-24-2009 at 10:47.
alan_el_more is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 03-24-2009 , 13:01   Re: [ZP] Extra Item: T-Virus
Reply With Quote #23

Why set_task? The HUD message could be in zp_extra_item_selected. Also, the Zombie Plague remove the necesary ammo packs when you have selected an item..
__________________
"There is no knowledge, that is not power"
fezh is offline
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 03-24-2009 , 13:08   Re: [ZP] Extra Item: T-Virus
Reply With Quote #24

Quote:
Originally Posted by fezh View Post
Why set_task? The HUD message could be in zp_extra_item_selected. Also, the Zombie Plague remove the necesary ammo packs when you have selected an item..
because if the user dont get zombie will send a hudmessage too.
and the set task is because if is nemesis round and someone buy it zp will accept this but the ammo packs will not be returned.
AlejandroSk is offline
Send a message via MSN to AlejandroSk
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-24-2009 , 13:22   Re: [ZP] Extra Item: T-Virus
Reply With Quote #25

Quote:
Originally Posted by AlejandroSk View Post
because if the user dont get zombie will send a hudmessage too.
and the set task is because if is nemesis round and someone buy it zp will accept this but the ammo packs will not be returned.
you're right

Update the plugin
__________________

Last edited by alan_el_more; 03-24-2009 at 13:39.
alan_el_more is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 03-25-2009 , 12:47   Re: [ZP] Extra Item: T-Virus
Reply With Quote #26

o.O

PHP Code:
g_virus zp_register_extra_item("T-Virus"g_costZP_TEAM_HUMAN
If the user is a Zombie, can't buy the T-Virus... the task is useless -.-

PHP Code:
#include <amxmodx>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item: T-Virus"
#define VERSION "1.0"
#define AUTHOR "fezh"

new g_virusname[32]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_virus zp_register_extra_item("T-Virus"30ZP_TEAM_HUMAN)
}

public 
zp_extra_item_selected(iditemid)
{
    if (
itemid == g_virus)
    {
        
get_user_name(idname31)
        
set_hudmessage(02550, -0.05, -0.4510.05.01.01.0, -1)
        
show_hudmessage(0"%s has infected himself with the T-Virus!"name)
        
zp_infect_user(id)
    }

and ready...
__________________
ILUSION is offline
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 03-25-2009 , 13:58   Re: [ZP] Extra Item: T-Virus
Reply With Quote #27

Quote:
Originally Posted by ILUSION View Post
o.O

PHP Code:
g_virus zp_register_extra_item("T-Virus"g_costZP_TEAM_HUMAN
If the user is a Zombie, can't buy the T-Virus... the task is useless -.-

PHP Code:
#include <amxmodx>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item: T-Virus"
#define VERSION "1.0"
#define AUTHOR "fezh"

new g_virusname[32]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_virus zp_register_extra_item("T-Virus"30ZP_TEAM_HUMAN)
}

public 
zp_extra_item_selected(iditemid)
{
    if (
itemid == g_virus)
    {
        
get_user_name(idname31)
        
set_hudmessage(02550, -0.05, -0.4510.05.01.01.0, -1)
        
show_hudmessage(0"%s has infected himself with the T-Virus!"name)
        
zp_infect_user(id)
    }

and ready...
what a noob...
ITS FOR CHECK IF USER GET THE TVIRUs OR NOT !! NOBISH
AlejandroSk is offline
Send a message via MSN to AlejandroSk
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-25-2009 , 22:07   Re: [ZP] Extra Item: T-Virus
Reply With Quote #28

And if the last human buy this item? They do not return the ammo packs
__________________
alan_el_more is offline
o2gulo
Member
Join Date: Jul 2008
Old 03-26-2009 , 00:52   Re: [ZP] Extra Item: T-Virus
Reply With Quote #29

Why do you want to become a zombie and SACRIFICING you 30 AMMO PACKS?? LOL!
__________________
LOL sorry my english is freaking bad!!


UNBEATABLE INTERNET SPEED!!! no one is slow as mine!!


o2gulo is offline
Send a message via Yahoo to o2gulo
blue2kx
Member
Join Date: Mar 2009
Old 03-26-2009 , 16:43   Re: [ZP] Extra Item: T-Virus
Reply With Quote #30

Cool idea. So this can be edited for Nemesis/Survivor?

I don't know much scripting but if any of you can do this:

1) Nemesis - usable only by zombies in standard mode (so it can't be used in Plague, Swarm or Multiple Infection) if you are the first zombie and there are no other zombies infected?

2) Survivor - usable only by humans if you're the last person alive in standard mode similar to above?

Also, maybe add a cvar for both plugins similar to:

zp_nem_min_players
zp_surv_min_players

Thanks to anyone who might take this up.
blue2kx is offline
Reply



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 21:56.


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