Raised This Month: $ Target: $400
 0% 

Help in Zombie Packs plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ahmedkhater012
Member
Join Date: Jan 2017
Location: Egypt
Old 03-10-2017 , 06:29   Help in Zombie Packs plugin
Reply With Quote #1

I want it for only zombie classes. Human can use it
my mod zombie plauge 5.0.5


PHP Code:
 /* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <zp50_core>
#include <zp50_class_nemesis>
#include <zp50_class_survivor>
#include <zp50_items>
#include <fun>
#include <colorchat>

#define PLUGIN "[ZP] Extra Item : Zombie Pack"
#define VERSION "0.1"
#define AUTHOR "MaNdo"

#define COST 20

new g_HasPack[33]

new 
g_itemid

new cvar_hp cvar_longjump cvar_speed cvar_gravitycvar_one_round

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_itemid zp_items_register("Zombie Pack"COST)
    
    
register_logevent "Round_End"2"1=Round_End" )
    
    
cvar_gravity register_cvar("zp_pack_gravity""0.5")
    
cvar_hp register_cvar("zp_pack_hp""1000")
    
cvar_longjump register_cvar("zp_pack_enable_longjump""1")
    
cvar_speed register_cvar("zp_pack_speed""280.0")
    
cvar_one_round register_cvar "zp50_pack_one_round""1" )
}

public 
Round_End ( )
{
    for ( new 
id=1id <= get_maxplayers ( ); id++ )
    {
        if ( 
is_user_alive id ) && g_HasPackid ] )
        {
            if ( 
get_pcvar_num cvar_one_round ) )
            {
                
g_HasPackid ] = 0;
            }
        }
    }
}

public 
client_connectid )
{
    
g_HasPackid ] = 0
}

public 
client_disconnectid )
{
    
g_HasPackid ] = 0
}

public 
zp_fw_items_select_preiditemid )
{
    if ( 
itemid == g_itemid )
    {
        if ( 
zp_core_is_zombieid ) && zp_class_nemesis_getid ) && zp_class_survivor_get id ) ) 
        {
            return 
ZP_ITEM_NOT_AVAILABLE;
        }
    }
    
    return 
ZP_ITEM_AVAILABLE;
}

public 
zp_fw_items_select_post iditemid )
{
    if ( 
itemid == g_itemid )
    {
        
g_HasPack[id] = true;
            
        
set_user_gravity(idget_pcvar_float cvar_gravity ) )
        
set_user_maxspeed(idget_pcvar_float cvar_speed ) )
        
set_user_health(idget_user_health(id) + get_pcvar_num cvar_hp ) )
            
        if ( 
get_pcvar_num cvar_longjump ) )
        {
            
give_item(id"item_longjump")
        }
            
        
ColorChat(idGREEN"[ZP]^x01 You have bought a ^x04Zombie Pack^x01!")
    }
    
    return 
ZP_ITEM_AVAILABLE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by ahmedkhater012; 03-10-2017 at 06:38.
ahmedkhater012 is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 03-10-2017 , 22:04   Re: Help in Zombie Packs plugin
Reply With Quote #2

Try..

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <zp50_core>
#include <zp50_class_nemesis>
#include <zp50_class_survivor>
#include <zp50_items>
#include <fun>
#include <colorchat>

#define PLUGIN "[ZP] Extra Item : Zombie Pack"
#define VERSION "0.1"
#define AUTHOR "MaNdo"

#define COST 20

new g_HasPack[33]

new 
g_itemid

new cvar_hp cvar_longjump cvar_speed cvar_gravitycvar_one_round

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_itemid zp_items_register("Zombie Pack"COST)
    
    
register_logevent "Round_End"2"1=Round_End" )
    
    
cvar_gravity register_cvar("zp_pack_gravity""0.5")
    
cvar_hp register_cvar("zp_pack_hp""1000")
    
cvar_longjump register_cvar("zp_pack_enable_longjump""1")
    
cvar_speed register_cvar("zp_pack_speed""280.0")
    
cvar_one_round register_cvar "zp50_pack_one_round""1" )
}

public 
Round_End ( )
{
    for ( new 
id=1id <= get_maxplayers ( ); id++ )
    {
        if ( 
is_user_alive id ) && g_HasPackid ] )
        {
            if ( 
get_pcvar_num cvar_one_round ) )
            {
                
g_HasPackid ] = 0;
            }
        }
    }
}

public 
client_connectid )
{
    
g_HasPackid ] = 0
}

public 
client_disconnectid )
{
    
g_HasPackid ] = 0
}

public 
zp_fw_items_select_preiditemid )
{
    if ( 
itemid == g_itemid )
    {
        if ( !
zp_core_is_zombieid ) && zp_class_nemesis_getid ) && zp_class_survivor_get id ) ) 
        {
            return 
ZP_ITEM_NOT_AVAILABLE;
        }
    }
    
    return 
ZP_ITEM_AVAILABLE;
}

public 
zp_fw_items_select_post iditemid )
{
    if ( 
itemid == g_itemid )
    {
        
g_HasPack[id] = true;
            
        
set_user_gravity(idget_pcvar_float cvar_gravity ) )
        
set_user_maxspeed(idget_pcvar_float cvar_speed ) )
        
set_user_health(idget_user_health(id) + get_pcvar_num cvar_hp ) )
            
        if ( 
get_pcvar_num cvar_longjump ) )
        {
            
give_item(id"item_longjump")
        }
            
        
ColorChat(idGREEN"[ZP]^x01 You have bought a ^x04Zombie Pack^x01!")
    }
    
    return 
ZP_ITEM_AVAILABLE;

wicho is offline
Old 03-11-2017, 16:40
ahmedkhater012
This message has been deleted by ahmedkhater012.
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 17:44.


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