AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [ZPS] Extra Item: Buy Classes 2.0 (with Item Limiter) (https://forums.alliedmods.net/showthread.php?t=243148)

ROKronoS 06-30-2014 11:30

[ZPS] Extra Item: Buy Classes 2.0 (with Item Limiter)
 
2 Attachment(s)
[ZPS] Extra Item: Buy Classes

Description

Players can buy a special mode (Sniper, Assassin, Bombardier, Survivor, Nemesis) with ammo packs if the last played mode wasn't Nemesis, Survivor, Assassin, Sniper or Bombardier.By default, each item can be bought once in 4 rounds (this can be changed by modifying the value of the g_limit variable).

zps_buy_classes_2.0.sma includes Sniper, Assassin, Bombardier
zps_buy_classes_nmsv2.0.sma includes Survivor, Nemesis

Requirements
  • Zombie Plague Shade 1.1 or newer (due to the new natives)

Images

[IMG]http://img856.**************/img856/3438/loye.png[/IMG]

Just4Games 06-30-2014 13:28

Re: [ZPS] Extra Item: Buy Classes
 
Very nice, tested and it's working! GJ
PS: You could add Nemesis and Survivor too (all in one)

Nano x 06-30-2014 17:52

Re: [ZPS] Extra Item: Buy Classes
 
very nice:)

ghostz0r 07-07-2014 00:58

Re: [ZPS] Extra Item: Buy Classes
 
hey man , create this item for arnaas vip system plss)

zmd94 07-07-2014 03:17

Re: [ZPS] Extra Item: Buy Classes
 
Just follow this step: https://forums.alliedmods.net/showpo...6&postcount=99

Or just try below:
PHP Code:

/*

This plugin works only with Zombie Plague Shade

*/

#include < amxmodx >
#include < zombieplague >
#include <zmvip> 

new g_buy_sniper;
new 
g_item_sniper[] = "Become Sniper";
new 
g_cost_sniper 200;

new 
g_buy_assassin;
new 
g_item_assassin[] = "Become Assassin";
new 
g_cost_assassin 200;

new 
g_buy_bombardier;
new 
g_item_bombardier[] = "Become Bombardier";
new 
g_cost_bombardier 200;

public 
plugin_init()
{
        
register_plugin "[ZPS] Buy Classes""1.0""KronoS" ;
    
        
g_buy_sniper zv_register_extra_itemg_item_sniper"for VIP only"g_cost_sniperZV_TEAM_HUMAN );
        
g_buy_assassin zv_register_extra_itemg_item_assassin"for VIP only"g_cost_assassinZV_TEAM_HUMAN );
        
g_buy_bombardier zv_register_extra_itemg_item_bombardier"for VIP only"g_cost_bombardierZV_TEAM_HUMAN );
}

public 
zv_extra_item_selectedindexitem )
{
        if ( 
item != g_buy_sniper && item != g_buy_assassin && item != g_buy_bombardier )
            return 
PLUGIN_CONTINUE;
    
        if ( 
zp_has_round_started( ) )
            return 
ZP_PLUGIN_HANDLED;

    if ( 
zp_get_last_mode() == MODE_NEMESIS || zp_get_last_mode() == MODE_SURVIVOR || zp_get_last_mode() == MODE_ASSASSIN || zp_get_last_mode() == MODE_SNIPER || zp_get_last_mode() == MODE_BOMBARDIER )
    {
        
client_printindexprint_chat"[ZP] You can't buy a mode because one was played recently!" );
            return 
ZP_PLUGIN_HANDLED;
    }    
    
        if ( 
item == g_buy_sniper )
        
zp_make_user_sniperindex );
        else if ( 
item == g_buy_assassin )
        
zp_make_user_assassinindex );
        else if ( 
item == g_buy_bombardier )
        
zp_make_user_bombardierindex );
    
        return 
PLUGIN_CONTINUE;


Edit: I have tested it and it is working in ZPS. Now, only VIP can buy the classes.

ghostz0r 07-07-2014 14:57

Re: [ZPS] Extra Item: Buy Classes
 
zmd94 , thank's very big (:

Ren0k 07-08-2014 08:03

Re: [ZPS] Extra Item: Buy Classes
 
nop, crashes server

Just4Games 07-08-2014 08:26

Re: [ZPS] Extra Item: Buy Classes
 
Make sure you don't have other plugin like this.
This plugin is running well on my server :)

gigis 07-21-2014 06:22

Re: [ZPS] Extra Item: Buy Classes
 
100% NO error code,work for vip
no class bomber
- compille no errors

Code:

/*

This plugin works only with Zombie Plague Shade

*/

#include < amxmodx >
#include < zombieplague >
#include <zmvip>

new g_buy_sniper;
new g_item_sniper[] = "Become Sniper";
//new g_cost_sniper = 200;

new g_buy_assassin;
new g_item_assassin[] = "Become Assassin";
//new g_cost_assassin = 200;

//new g_buy_bombardier;
//new g_item_bombardier[] = "Become Bombardier";
//new g_cost_bombardier = 200;

public plugin_init()
{
        register_plugin "[ZPS] Buy Classes", "1.0", "KronoS" ;
   
        g_buy_sniper = zv_register_extra_item( g_item_sniper, "Transform in Sniper", 200, ZV_TEAM_HUMAN );
        g_buy_assassin = zv_register_extra_item( g_item_assassin, "Transform in Assasin", 200, ZV_TEAM_HUMAN );
        //g_buy_bombardier = zv_register_extra_item( g_item_bombardier, "Transform in Bombardier", 200, ZV_TEAM_HUMAN );
}

public zv_extra_item_selected( index, item )
{
        if ( item != g_buy_sniper && item != g_buy_assassin )
            return PLUGIN_CONTINUE;
   
        if ( zp_has_round_started( ) )
            return ZP_PLUGIN_HANDLED;

    if ( zp_get_last_mode() == MODE_NEMESIS || zp_get_last_mode() == MODE_SURVIVOR || zp_get_last_mode() == MODE_ASSASSIN || zp_get_last_mode() == MODE_SNIPER )
    {
        client_print( index, print_chat, "[ZP] You can't buy a mode because one was played recently!" );
            return ZP_PLUGIN_HANDLED;
    }   
   
        if ( item == g_buy_sniper )
        zp_make_user_sniper( index );
        else if ( item == g_buy_assassin )
        zp_make_user_assassin( index );
   
        return PLUGIN_CONTINUE;
}


zmd94 07-21-2014 06:51

Re: [ZPS] Extra Item: Buy Classes
 
Quote:

It do not have Bombardier Class.
LOL, why you removed the Bombardier Class as this plugin is specifically for ZPS which have Bombardier Class.


All times are GMT -4. The time now is 14:47.

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