/* Plugin generated by AMXX-Studio */
#include < amxmodx >
#include < fakemeta_util >
#include < hamsandwich >
#include <
cstrike >
#include < engine >
#define PLUGIN "Shop"
#define VERSION "1.0"
#define AUTHOR "50Cent # HackeR"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
// Add your code here...
register_clcmd("say /shop","ClcmdShop")
register_clcmd("say_team /shop","ClcmdShop")
}
public ClcmdShop(id) {
if(is_user_alive(id)) {
new szTitle[128];
formatex(szTitle, charsmax(szTitle), "\rShop Menu Knife^n\yBanii Tai: \w%d", cs_get_user_money(id));
new menu = menu_create(szTitle, "ShopClcmd");
menu_additem(menu, "\yViteza + 150 \r(16000 $$)", "1");
menu_additem(menu, "\yGravity \r(16000 $$)", "2");
menu_additem(menu, "\yFroze Nade \r(16000 $$)", "3");
menu_additem(menu, "\yGrenada de Foc \r(16000 $$)", "4");
menu_additem(menu, "\yFlashbang \r(10000 $$)", "5")
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0 );
}
else
{
ChatColor(id, "!g[Shop] !nNu. poti Acesa Shop-ul cand esti !tMort");
}
}
public ShopClcmd(id, menu, item) {
if(item == MENU_EXIT || !is_user_alive(id) ) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data [6], szName [64];
new access, callback;
menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
new key = str_to_num (data);
switch (key)
{
case 1: {
new iBanuti = cs_get_user_money(id) - 16000;
if( iBanuti < 0 )
{
ChatColor(id, "!g[Shop] !nNu ai destui banutii sa-ti cumperi !gViteza ");
ClcmdShop( id )
return PLUGIN_HANDLED;
}
else
{
fm_set_user_maxspeed( id, 350.0 );
cs_set_user_money ( id, iBanuti )
}
}
case 2: {
new iBanuti = cs_get_user_money(id) - 16000;
if( iBanuti < 0 )
{
ChatColor(id, "!g[Shop] !nNu ai destui banutii sa-ti cumperi !ggravity ");
ClcmdShop( id )
return PLUGIN_HANDLED;
}
else
{
fm_set_user_gravity(id,0.650)
cs_set_user_money ( id, iBanuti )
}
}
case 3: {
new iBanuti = cs_get_user_money(id) - 16000;
if( iBanuti < 0 )
{
ChatColor(id, "!g[Shop] !nNu ai destui banutii sa-ti cumperi !gFroze Nade ");
ClcmdShop( id )
}
else
{
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1);
fm_give_item(id, "weapon_smokegrenade");
cs_set_user_money ( id, iBanuti )
}
}
case 4: {
new iBanuti = cs_get_user_money(id) - 16000;
if( iBanuti < 0 )
{
ChatColor(id, "!g[Shop] !nNu ai destui banutii sa-ti cumperi !gGrenade de Foc ");
ClcmdShop( id )
}
else
{
cs_set_user_bpammo(id, CSW_HEGRENADE, 1);
fm_give_item(id, "weapon_hegrenade");
cs_set_user_money ( id, iBanuti )
}
}
case 5: {
new iBanuti = cs_get_user_money(id) - 10000;
if( iBanuti < 0 )
{
ChatColor(id, "!g[Shop] !nNu ai destui banutii sa-ti cumperi !gFlashBang ");
ClcmdShop( id )
return PLUGIN_HANDLED;
}
else
{
fm_give_item(id, "weapon_flashbang");
cs_set_user_bpammo(id, CSW_FLASHBANG, 1);
cs_set_user_money ( id, iBanuti )
}
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
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, "!n", "^1"); // Default Color
replace_all(msg, 190, "!t", "^3"); // Team Color
replace_all(msg, 190, "!t2", "^0"); // Team2 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();
}
}
}
}