AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [ZP] Free VIP Menu (https://forums.alliedmods.net/showthread.php?t=266496)

Dr Zayd 07-17-2015 21:06

[ZP] Free VIP Menu
 

This plugin work for all players in zombie plague only when the server have 16/32 players
to motivate the players to bring theire friends

.:: Commands ::.
  • say /freevip


.:: CVAR's ::.
  • c_minplayers "15"
  • How many players needed to active plugin(Def.: "15")

PHP Code:

//#pragma semicolon 1
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>
#include <zombieplague>

// Define the Plugin Version
new const VERSION[] = { "2.3" };

// PREFIX
new const PREFIX[] = { "!g[.:V.I.P:.]!n" };

new 
pNum;

new 
VipUsed[33];


public 
plugin_init()
{
    
register_plugin("Zombie Plague: New VIP Menu"VERSION"");
    
    
RegisterHam(Ham_Spawn"player""FwdHamSpawn_Post"1);
    
    
    
pNum register_cvar("c_minplayers","15")     // Number of Min. Players
    
register_clcmd("say /freevip""cmdVmenu");
    
register_clcmd("say_team /freevip""cmdVmenu");
}

public 
FwdHamSpawn_Post(id)
{
    if ( !
is_user_alive(id)) return 1;
    
    
VipUsed[id] = false;
    
set_user_renderingid_000_);
    
    return 
0;
}

public 
cmdVmenu(id)
{
    if ( 
is_user_alive(id) ){
        if( 
get_playersnum() >= get_pcvar_num(pNum))
        {
            if (!
VipUsed[id]){
                
VipUsed[id] = true;
                
                switch(
cs_get_user_team(id))
                {
                    case 
ZP_TEAM_ZOMBIE:
                    
VipTMenu(id);
                    
                    case 
ZP_TEAM_HUMAN:
                    
VipCTMenu(id);
                }
            }
            else
            {
                
client_printc(id"%s u can use !gFree VIP Menu!n . One Time, every round"PREFIX);
                
client_cmd(id"spk /sound/ng_no.wav");
            }
            
        }
        else {
            
client_printc(id"%s VIP Will Be Actived ON !g%d !nPLayers"PREFIX get_pcvar_num(pNum));
            
client_cmd(id"spk /sound/ng_ok.wav");
        }
    }
    else
    {
        
client_printc(id"%s !nYou need to be !gAlive to run the menu"PREFIX);
        
client_cmd(id"spk /sound/ng_no.wav");
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
VipCTMenu(id)
{
    
client_cmd(id"spk /sound/ng_vipmenu.wav");
    new 
menu menu_create("\yFree VIP Menu \r(Human):^n""VipCTMenu_handler");
    
    
menu_additem(menu"\w50 Hp + 50 Armor""1"0);
    
menu_additem(menu"\wMachingun + Gravity""2"0);
    
menu_additem(menu"\w100 Armor \d[Anti Inf Armor]""3"0);
    
menu_additem(menu"\wExtra AmmoPacks \d[8 AmmoPacks]""4"0);
    
menu_additem(menu"\wG3SG1 \d[Sniper]""5"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
VipCTMenu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
set_user_health(idget_user_health(id) + 50)
            
set_user_armor(idget_user_armor(id) + 100)
            
VipUsed[id] = true
            client_printc
(id"%s You Have !g50 Hp!n + !g100 Armor!n"PREFIX)
        }
        case 
2:
        {
            
give_item(id"weapon_m249");
            
set_user_gravityid0.5 );
            
cs_set_user_bpammo(idCSW_M249200);
            
VipUsed[id] = true;
            
client_printc(id"%s You Have !gM249!n + !gGravity!n"PREFIX)
        }
        case 
3:
        {
            
VipUsed[id] = true;
            
set_user_armor(idget_user_armor(id) + 100);
            
client_printc(id"%s You Have !g140 Armor!n"PREFIX)
        }
        
        case 
4:
        {
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + random_num(88));
            
VipUsed[id] = true;
            
client_printc(id"%s You Have !g8 Ammo"PREFIX);
            
        }
        
        case 
5:
        {
            
give_item(id"weapon_g3sg1");
            
cs_set_user_bpammo(idCSW_G3SG1200);
            
VipUsed[id] = true;
            
client_printc(id"%s You choose !gG3sg1"PREFIX);
            
        }
        
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
VipTMenu(id)
{
    new 
menu menu_create("\yFree VIP Menu \r(Zombies):^n""VipTMenu_handler");
    
    
menu_additem(menu"\w500 Hp""1"0);
    
menu_additem(menu"\wRandom AmmoPacks \d[From 1 to 9 AP]""2"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
VipTMenu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
VipUsed[id] = true;
            
set_user_health(idget_user_health(id) + 500);
            
client_printc(id"%s You Have !g500 HP"PREFIX);
            
VipUsed[id] = true;
        }
        
        case 
2:
        {
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + random_num(19))
            
VipUsed[id] = true;
            
client_printc(id"%s You Have !gSome AmmoPacks!n"PREFIX);
        }
        
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

// Colour Chat
stock client_printc(const id, const input[], any:...)
{
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^x04"); // Green Color
    
replace_all(msg190"!n""^x01"); // Default Color
    
replace_all(msg190"!t""^x03"); // Team Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch");
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }


- My 1sT Plugin i hope you like it and thnx for Spawner for help :D

Linkin Hisoka 07-17-2015 22:33

Re: [ZP] Free VIP Menu
 
Nice but no information about the plugin ?

ZiZox 07-18-2015 19:25

Re: [ZP] Free VIP Menu
 
COOL :')

Dr Zayd 08-04-2015 05:11

Re: [ZP] Free VIP Menu
 
Thanks ^^ :D
Quote:

Nice but no information about the plugin ?
i forgot :p

Dr Zayd 09-13-2015 16:01

Re: [ZP] Free VIP Menu
 
Bump ? :v

Depresie 09-14-2015 12:26

Re: [ZP] Free VIP Menu
 
why are you bumping it ?...

amir saiaoud 09-16-2015 09:20

Re: [ZP] Free VIP Menu
 
NiCe ;)

Dr Zayd 09-18-2015 13:06

Re: [ZP] Free VIP Menu
 
Quote:

Originally Posted by Depresie (Post 2342944)
why are you bumping it ?...

More Views

BN Houssam 09-26-2015 17:06

Re: [ZP] Free VIP Menu
 
Niceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee :')

amir saiaoud 10-16-2015 11:31

Re: [ZP] Free VIP Menu
 
where is the sound file :/ /sound/ng_vipmenu.wav ?


All times are GMT -4. The time now is 04:53.

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