Raised This Month: $81 Target: $400
 20% 

Gun menu witch vip option


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
motuoki
New Member
Join Date: Oct 2022
Old 10-11-2022 , 16:49   Gun menu witch vip option
Reply With Quote #1

Hi, i need some help
the idea of the plugin is that VIP players with ADMIN_IMMUNITY can buy AK when playing CT and M4 when playing TR.
The problem is that in the game I get a message that it's not possible to buy the weapon because I'm on the wrong team, can you help me?
I can't release the purchase of the weapon while on another team
besides I get 7 warnings when compiling, plugin works in game even with warning
- (14) : warning 217: loose indentation
- (27) : warning 217: loose indentation
- (29) : warning 217: loose indentation
- (46) : warning 217: loose indentation
- (47) : warning 217: loose indentation
- (52) : warning 217: loose indentation
- (121) : warning 217: loose indentation

thanks for your time and knowledge
Attached Files
File Type: sma Get Plugin or Get Source (GunVIPMenu.sma - 88 views - 3.1 KB)
motuoki is offline
sPed
Member
Join Date: May 2017
Location: Algeria
Old 10-15-2022 , 04:12   Re: Gun menu witch vip option
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("RvT-MenuArma""1.4""HanzoBR");    
    
register_clcmd("say /rvt_arma""xHam_Spawn");
    
register_clcmd("say_team /rvt_arma""xHam_Spawn");
    
RegisterHam(Ham_Spawn"player""xHam_Spawn"1)
}

public 
xHam_Spawn(id)
{
    new 
xTeam
    xTeam  
get_user_team(id)
    
    new 
menu menu_create("\r\r[\w----------\n \rRvT-Games | Menu Armas\n \w----------\r]""mh_MenuArma");

    if(
xTeam == 1// Armas TR
    
{
        
menu_additem(menu"KIT [\rAK47\w] \dDesert + Granadas + Colete""1")
        
menu_additem(menu"KIT [\rAK47\w] \dUsp + Granadas + Colete""2")
        
menu_additem(menu"KIT [\rAWP\w] \dDesert + Granadas + Colete""3")
        
menu_additem(menu"KIT [\rGalil\w] \dDesert + Granadas + Colete^n""4")
        
menu_additem(menu"KIT [\rM4A1\w] \dDesert + Granadas + Colete - \d[\rVIP\d]^n""5")
    }
    else 
// Armas CTS
    
{
        
menu_additem(menu"KIT [\rM4A1\w] \dDesert + Granadas + Colete + Defuse Kit""1")
        
menu_additem(menu"KIT [\rM4A1\w] \dUsp + Granadas + Colete + Defuse Kit""2")
        
menu_additem(menu"KIT [\rAWP\w] \dDesert + Granadas + Colete + Defuse Kit""3")
        
menu_additem(menu"KIT [\rFamas\w] \dDesert + Granadas + Colete + Defuse Kit""4")
        
menu_additem(menu"KIT [\rAK47\w] \dDesert + Granadas + Colete - \d[\rVIP\d]^n""5")
    }

        
menu_display(idmenu0);
    return 
PLUGIN_HANDLED
}

public 
mh_MenuArma(idmenuitem)
{
    new 
xTeam
    xTeam 
get_user_team(id)
    
    if(!
is_user_connected(id)) return PLUGIN_HANDLED
    
    
switch(item)
    {
        case 
0
        {    
            if(
xTeam == 1)
            {
                
client_cmd(id,"vesthelm;ak47;deagle;secammo;primammo;hegren;flash;flash")
            }
            else
            {
                
client_cmd(id"defuser;vesthelm;ak47;deagle;secammo;primammo;hegren;flash;flash")
            }
        }
        case 
1
        {
            if(
xTeam == 1)
            {
                
client_cmd(id,"vesthelm;m4a1;usp;secammo;primammo;hegren;flash;flash")
            }
            else
            {
                
client_cmd(id"defuser;vesthelm;m4a1;usp;secammo;primammo;hegren;flash;flash")
            }
        }
        case 
2
        {
            if(
xTeam == 1)
            {
                
client_cmd(id"vesthelm;awp;deagle;secammo;primammo;hegren;flash;flash")
            }
            else
            {
                
client_cmd(id"defuser;vesthelm;awp;deagle;secammo;primammo;hegren;flash;flash")
            }
        }
        case 
3
        {
            if(
xTeam == 1)
            {
                
client_cmd(id,"vesthelm;galil;deagle;secammo;primammo;hegren;flash;flash")
            }
            else
            {
                
client_cmd(id"defuser;vesthelm;famas;deagle;secammo;primammo;hegren;flash;flash")
            }
        }
        case 
4
        {
            if(
get_user_flags(id) & ADMIN_IMMUNITY)
            {
                if(
xTeam == 1)
                {
                    
client_cmd(id"vesthelm;m4a1;deagle;secammo;primammo;hegren;flash;flash")
                }
                else
                {
                    
client_cmd(id"vesthelm;ak47;deagle;secammo;primammo;hegren;flash;flash")
                }
            }
        }    
    }
    return 
PLUGIN_HANDLED;

sPed is offline
Reply


Thread Tools
Display Modes

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:57.


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