Raised This Month: $51 Target: $400
 12% 

Furien Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Al3xandru27
Member
Join Date: Oct 2019
Old 07-10-2020 , 13:53   Furien Menu
Reply With Quote #1

When I buy super knife or super knife vip from the shop if I take the grenade in my hand or anything else the item disappears

sma:

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 
#include <fun> 
#include <engine> 
#include <fakemeta_util> 

#define PLUGIN_NAME    "Furien Shop" 
#define PLUGIN_VERSION "1.0" 
#define PLUGIN_AUTHOR  "AlliedMods" 

#define FURIEN_VIP ADMIN_LEVEL_H

new has_no_flash[33]
new 
has_model[33]

new const 
models[][] =  { "models/v_knife_human.mdl""models/v_superknifeVIP.mdl" }

new 
g_msgScreenFade 
new const prefix[] = { "!g[!tShop!g]!n" 

public 
plugin_init() 

    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR
    
    
register_clcmd("say /shop""shop"
    
register_clcmd("say_team /shop""shop"
    
register_event("CurWeapon","switchweapon","be","1=1","2!29")
    
register_event("DeathMsg""deathmsg""a"); 
    
register_event("ScreenFade""eventFlash""be""4=255""5=255""6=255""7>199"
    
    
g_msgScreenFade get_user_msgid("ScreenFade"


public 
deathmsg(){
  new 
ivictim read_data(2);
  
has_no_flash[ivictim] = false;
  
has_model[ivictim]=false;
}

public 
switchweapon(id)
{
    if(
is_user_alive(id) && has_model[id])
           if(
get_user_weaponid ) == CSW_KNIFE)
              
set_pev(idpev_viewmodel2get_user_flags(id) & FURIEN_VIP models[1] : models[0] ) 
         
    
}

public 
client_disconnect(id){

has_no_flash[id] = false;
has_model[id]=false;

}

public 
client_connect(id){

has_no_flash[id] = false;
has_model[id]=false;

}

public 
plugin_precache() {
    
precache_model(models[0])
    
precache_model(models[1])
    
}

public 
eventFlash(id)
{
    if(
has_no_flash[id])
    {
      
message_begin(MSG_ONEg_msgScreenFade, {0,0,0}, id)
      
write_short(1)
      
write_short(1)
      
write_short(1)
      
write_byte(0)
      
write_byte(0)
      
write_byte(0)
      
write_byte(255)
      
message_end()
    }
}


public 
shop(id

    if(!
is_user_alive(id)) 
    { 
        
client_printc(id"%s You !gmust !nbe !talive !nto !topen !nthe !gShop!n!"prefix); 
        return 
PLUGIN_HANDLED 
    

    
    switch(
cs_get_user_team(id)) 
    { 
        case 
CS_TEAM_CT
            
AFURIEN(id); 
        
        case 
CS_TEAM_T
            
FURIEN(id); 
    } 
    return 
PLUGIN_HANDLED



public 
FURIEN(id

    if(!
is_user_alive(id)) 
    { 
        
client_printc(id"%s You !gmust !nbe !talive !nto !topen !nthe !gShop!n!"prefix); 
        return 
PLUGIN_HANDLED 
    

    
    new 
menu menu_create("FURIEN Shop""shop_furien"); 
    
    
menu_additem(menu"Super Knife r[w10000$r] ""1"0); 
    
menu_additem(menu"HE Grenade  r[w3000$r] ""2"0); 
    
menu_additem(menu"+50 Health  r[w3000$r] ""3"0); 
    
menu_additem(menu"+50 Armor   r[w500$r] ""4"0); 
    
menu_additem(menu"No Flash    r[w1000$r] ""5"0); 
    
menu_additem(menu"Super Knife VIP r[wFREEr] ""6"0); 
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL); 
    
menu_display(idmenu0); 
    
    return 
PLUGIN_HANDLED 


public 
shop_furien(idmenuitem

    if(!
is_user_alive(id)) 
    { 
        
client_printc(id"%s You !gmust !nbe !talive !nto !topen !nthe !gShop!n!"prefix); 
        return 
PLUGIN_HANDLED 
    

    
    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); 
    new 
tmp_money cs_get_user_money(id)
    
    switch(
key
    { 
        case 
1
        { 
            if(
tmp_money 10000)
            {
                
client_printc(id"%s You dont have enough !gMoney!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
has_model[id]=true;
            if(
get_user_weaponid ) == CSW_KNIFE)
            
set_pev(idpev_viewmodel2models[0]) 
            
cs_set_user_money(idtmp_money 10000
            
client_printc(id"%s You bought !gSuper Knife!"prefix); 
        } 
        case 
2
        { 
            if(
tmp_money 3000)
            {
                
client_printc(id"%s You dont have enough !gMoney!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
            if(
user_has_weapon(idCSW_HEGRENADE))
            {
              
client_printc(id"%s You already have !gHeGrenade!"prefix); 
              return 
PLUGIN_HANDLED;
            }
            
            
give_item(id"weapon_hegrenade"
            
cs_set_user_money(idtmp_money 3000
            
client_printc(id"%s You bought !gHE Grenade!"prefix); 
            
        } 
        case 
3
        { 
            if(
tmp_money 3000)
            {
                
client_printc(id"%s You dont have enough !gMoney!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
            new 
health get_user_health(id);
            
            if(
health >= 200){
                
client_printc(id"%s You cant have more than !g200 Health!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
health+=50;
            
            
set_user_health(idclamp(health,0,200) == 200 200 health
            
            
cs_set_user_money(idtmp_money 3000
            
client_printc(id"%s You bought !g+50 HP!"prefix); 
        } 
        case 
4
        { 
            
            if(
tmp_money 500)
            {
                
client_printc(id"%s You dont have enough !gMoney!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
            new 
armor get_user_armor(id);
            
            if(
armor >= 300){
                
client_printc(id"%s You cant have more than !g300 Armor!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
armor+=50
            
            set_user_armor
(idclamp(armor,0,300) == 300 300 armor
            
            
cs_set_user_money(idtmp_money 500
            
client_printc(id"%s You bought !g+50 AP!"prefix); 
        } 
        case 
5
        { 
            if(
tmp_money 1000)
            {
                
client_printc(id"%s You dont have enough !gMoney!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
            
has_no_flash[id]=true;
            
cs_set_user_money(idtmp_money 1000
            
client_printc(id"%s You bought !gNo Flash!"prefix); 
        } 
        case 
6
        { 
            if(
get_user_flags(id) & FURIEN_VIP
            { 
                
client_printc(id"%s You taked !gSuper Knife!"prefix); 
                
has_model[id]=true;
                if(
get_user_weaponid ) == CSW_KNIFE)
                
set_pev(idpev_viewmodel2models[1]) 
            }     
        } 
        
    } 
    
    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED


public 
AFURIEN(id

    if(!
is_user_alive(id)) 
    { 
        
client_printc(id"%s You !gmust !nbe !talive !nto !topen !nthe !gShop!n!"prefix); 
        return 
PLUGIN_HANDLED 
    

    
    new 
menu menu_create("Anti-Furien Shop""shop_afurien"); 
    
    
menu_additem(menu"Defuse Kit  r[w500$r] ""1"0); 
    
menu_additem(menu"HE Grenade  r[w3000$r] ""2"0); 
    
menu_additem(menu"+50 Health  r[w3000$r] ""3"0); 
    
menu_additem(menu"+50 Armor   r[w500$r] ""4"0); 
    
menu_additem(menu"No Flash    r[w10000$r] ""5"0); 
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL); 
    
menu_display(idmenu0); 
    
    return 
PLUGIN_HANDLED 


public 
shop_afurien(idmenuitem

    if(!
is_user_alive(id)) 
    { 
        
client_printc(id"%s You !gmust !nbe !talive !nto !topen !nthe !gShop!n!"prefix); 
        return 
PLUGIN_HANDLED 
    

    
    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); 
    new 
tmp_money cs_get_user_money(id)
    
    switch(
key
    { 
        case 
1
        { 
            if(
tmp_money 500)
            {
                
client_printc(id"%s You dont have enough !gMoney!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
            if(
cs_get_user_defuse(id))
            {
                
client_printc(id"%s You already have !gDefuse Kit!"prefix); 
                return 
PLUGIN_HANDLED;
            }
        
            
cs_set_user_money(idtmp_money 500
            
give_item(id"item_thighpack"); 
            
give_item(id"item_assaultsuit"); 
            
client_printc(id"%s You bought !gDefuse Kit!"prefix); 
        } 
        case 
2
        { 
            if(
tmp_money 3000)
            {
                
client_printc(id"%s You dont have enough !gMoney!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
            if(
user_has_weapon(idCSW_HEGRENADE))
            {
              
client_printc(id"%s You already have !gHeGrenade!"prefix); 
              return 
PLUGIN_HANDLED;
            }
            
            
give_item(id"weapon_hegrenade"
            
cs_set_user_money(idtmp_money 3000
            
client_printc(id"%s You bought !gHE Grenade!"prefix); 
            
        } 
        case 
3
        { 
            if(
tmp_money 3000)
            {
                
client_printc(id"%s You dont have enough !gMoney!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
            new 
health get_user_health(id);
            
            if(
health >= 200){
                
client_printc(id"%s You cant have more than !g200 Health!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
health+=50;
            
            
set_user_health(idclamp(health,0,200) == 200 200 health
            
cs_set_user_money(idtmp_money 3000
            
client_printc(id"%s You bought !g+50 HP!"prefix); 
        } 
        case 
4
        { 
            
            if(
tmp_money 500)
            {
                
client_printc(id"%s You dont have enough !gMoney!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
            new 
armor get_user_armor(id);
            
            if(
armor >= 300){
                
client_printc(id"%s You cant have more than !g300 Armor!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
armor+=50
            
            set_user_armor
(idclamp(armor,0,300) == 300 300 armor); 
            
            
cs_set_user_money(idtmp_money 500
            
client_printc(id"%s You bought !g+50 AP!"prefix); 
        } 
        case 
5
        {  
            if(
tmp_money 1000)
            {
                
client_printc(id"%s You dont have enough !gMoney!"prefix); 
                return 
PLUGIN_HANDLED;
            }
            
has_no_flash[id]=true;
            
cs_set_user_money(idtmp_money 1000
            
client_printc(id"%s You bought !gNo Flash!"prefix); 
        }     
    } 
    
    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED


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(id
        
players[0] = id
    else 
        
get_players(playerscount"ch"); 
    
    for (new 
0counti++) 
    { 
        
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
        
write_byte(players[i]); 
        
write_string(msg); 
        
message_end(); 
    } 

Al3xandru27 is offline
Reply



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 15:42.


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