Junior Member
Join Date: Sep 2019
Location: Republic of Moldova
|
01-08-2020
, 14:31
Re: VIP Menu Plugin Shop
|
#2
|
Or can someone make me this plugin to work on zombie plague 4.3, to be compatible with what I mentioned above. That's about what I want.
Cvars from buy_menu.
PHP Code:
register_native("zp_cs_set_user_money", "set_user_money", 1)
register_native("zp_cs_get_user_money", "get_user_money", 1)
register_native("zp_cs_get_user_limit", "get_user_limit", 1)
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <zp50_gamemodes>
new g_MsgSync
new g_GameModeMultiID
new g_GameModeInfectionID
new g_armor
new g_goldenak
new g_Janus3
public plugin_init()
{
register_plugin("SVIP Menu", "1.0", "SNIPER")
register_concmd( "svip_menu","svipmenu" );
}
public svipmenu( id )
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
ChatColor(id, "!g[SVIP] You Have no Access to Use The Super Vip menu.");
return PLUGIN_HANDLED;
}
new menu = menu_create( "\wSuper VIP Menu", "menu_handler" );
menu_additem( menu, "\wSuper Armor \y1000\r$", "", 0 );
menu_additem( menu, "\wJanus-3 \y8000\r$", "", 0 );
menu_additem( menu, "\wGolden AK47 \y3000\r$", "", 0 );
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display( id, menu, 0 );
{
new current_mode = zp_gamemodes_get_current()
if (current_mode != g_GameModeInfectionID && current_mode != g_GameModeMultiID)
{
ChatColor(id, "!g[SVIP] You Cant Use The Super Vip Menu Now.");
return PLUGIN_HANDLED
}
}
}
public menu_handler( id, menu, item )
{
switch( item )
{
case 0: // g_armor
{
new money = cs_get_user_money(id)
if (money >= 1000)
{
cs_set_user_money(id, money - 1000)
client_cmd(id, "svip_armor")
ChatColor(id,"!g[SVIP] !yYou have bought !gSuper Armor !yEngoy Killing Zombie");
}
else
{
ChatColor(id,"!g[SVIP] !yYou dont hav enough money to buy !gSuper Armor")
}
}
case 1: // g_Janus3
{
new money = cs_get_user_money(id)
if (money >= 8000)
{
cs_set_user_money(id, money - 8000)
client_cmd(id, "svip_j3")
ChatColor(id,"!g[SVIP] !yYou have bought !gJanus-3 !yEngoy Killing Zombie");
}
else
{
ChatColor(id,"!g[SVIP] !yYou dont hav enough money to buy !gJanus-3")
}
}
case 2: // g_goldenak
{
new money = cs_get_user_money(id)
if (money >= 3000)
{
cs_set_user_money(id, money - 3000)
client_cmd(id, "svip_goldenak")
ChatColor(id,"!g[SVIP] !yYou have bought !gGolden AK47 !yEngoy Killing Zombie");
}
else
{
ChatColor(id,"!g[SVIP] !yYou dont hav enough money to buy !gGolden AK47")
}
}
}
menu_destroy( menu );
return PLUGIN_HANDLED;
}
public plugin_cfg()
{
g_GameModeInfectionID = zp_gamemodes_get_id("Infection Mode")
g_GameModeMultiID = zp_gamemodes_get_id("Multiple Infection Mode")
}
public event_round_start()
{
g_armor = 0
g_goldenak = 0
g_Janus3 = 0
}
// Stock: ChatColor!
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!t", "^3") // Team Color
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
Last edited by SuperrioR; 01-08-2020 at 14:35.
|
|