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

Add Vip Guns on Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
artYY
Member
Join Date: May 2020
Location: Brazil, Curitiba, PR
Old 07-26-2020 , 11:52   Add Vip Guns on Menu
Reply With Quote #1

Hi guys, it's me again

I have this plugin below that works perfectly for me. But I would like an option to be included where the terrorist could buy m4a1 if he has ADMIN_KICK access and the counter-terrorist could buy ak47 if he had the same access.

Can you help me, please?


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

#define PLUGIN  "CS Revo: Menu de Armas"
#define VERSION "1.0"
#define AUTHOR  "Wilian M."

#define PREFIX_MENUS "\r[T'KING]"
#define PREFIX_CHAT "^4[T'KING]"

/*
Cores para o Chat:

^4 = verde
^3 = cor do time
^1 = cor normal (amarelo)
*/

new xmapname[32], xRemeber[33], xSaveItem[33]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""xHamSpawnPost"true)

    
get_mapname(xmapnamecharsmax(xmapname))

    if(
equal(xmapname"awp_"4) || equal(xmapname"aim_"4) || equal(xmapname"35hp_"5) || equal(xmapname"fy_"3)
    || 
equal(xmapname"he_"3))
    {
        
pause("a")
    }

    
xRegisterSay("armas""xShowMenuGuns")
}

public 
xHamSpawnPost(id)
{
    if(
is_user_alive(id))
        
set_task(0.5"xGiveItems"id)
}

public 
xGiveItems(id)
{
    if(
is_user_connected(id))
    {
        static 
xmenu2

        
if(xRemeber[id])
            
_xShowMenuGuns(idxmenu2xSaveItem[id])
        else 
xShowMenuGuns(id)
    }
}

public 
client_disconnected(id)
{
    
xRemeber[id] = false
    xSaveItem
[id] = false
}

public 
xShowMenuGuns(id)
{
    if(
is_user_connected(id))
    {    
        static 
xTeam
        xTeam 
get_user_team(id)

        new 
xFmtx[512]

        
formatex(xFmtxcharsmax(xFmtx), "%s \wMenu de armas"PREFIX_MENUS)

        new 
xMenu menu_create(xFmtx"_xShowMenuGuns")

        if(
xTeam == 1)
        {
            
menu_additem(xMenu"Kit \d[\yAK47 + Desert\d]")
            
menu_additem(xMenu"Kit \d[\yAK47 + USP\d]")
            
menu_additem(xMenu"Kit \d[\yAWP + Desert\d]")
            
menu_additem(xMenu"Kit \d[\yGALIL + Desert\d]^n")
        }
        else
        {
            
menu_additem(xMenu"Kit \d[\yM4A1 + Desert\d]")
            
menu_additem(xMenu"Kit \d[\yM4A1 + USP\d]")
            
menu_additem(xMenu"Kit \d[\yAWP + Desert\d]")
            
menu_additem(xMenu"Kit \d[\yFAMAS + Desert\d]^n")
        }

        if(
xRemeber[id])
            
menu_additem(xMenu"\yRelembrar seleção? \r[Sim]")
        else 
menu_additem(xMenu"\yRelembrar seleção? \r[Não]")

        
menu_setprop(xMenuMPROP_EXITNAME"Sair")
        
menu_display(idxMenu)
    }
}

public 
_xShowMenuGuns(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)

        return 
PLUGIN_HANDLED
    
}

    static 
xTeam
    xTeam 
get_user_team(id)

    switch(
item)
    {
        case 
0:
        {
            if(
xTeam == 1client_cmd(id,"vesthelm;ak47;deagle;secammo;primammo;hegren;flash;flash")
            else 
client_cmd(id,"defuser;vesthelm;m4a1;deagle;secammo;primammo;hegren;flash;flash")

            
xSaveItem[id] = 0
        
}

        case 
1:
        {
            if(
xTeam == 1client_cmd(id,"vesthelm;ak47;usp;secammo;primammo;hegren;flash;flash")
            else 
client_cmd(id,"defuser;vesthelm;m4a1;usp;secammo;primammo;hegren;flash;flash")

            
xSaveItem[id] = 1
        
}

        case 
2:
        {
            if(
xTeam == 1client_cmd(id,"vesthelm;awp;deagle;secammo;primammo;hegren;flash;flash")
            else 
client_cmd(id,"defuser;vesthelm;awp;deagle;secammo;primammo;hegren;flash;flash")

            
xSaveItem[id] = 2
        
}

        case 
3:
        {
            if(
xTeam == 1client_cmd(id,"vesthelm;galil;deagle;secammo;primammo;hegren;flash;flash")
            else 
client_cmd(id,"defuser;vesthelm;famas;deagle;secammo;primammo;hegren;flash;flash")

            
xSaveItem[id] = 3
        
}

        case 
4:
        {
            if(
xRemeber[id])
                
xRemeber[id] = false
            
else xRemeber[id] = true

            xShowMenuGuns
(id)
        }
    }

    return 
PLUGIN_HANDLED
}

stock xRegisterSay(szsay[], szfunction[])
{
    new 
sztemp[64]
    
formatex(sztemp63 "say /%s"szsay)
    
register_clcmd(sztempszfunction)
    
    
formatex(sztemp63 "say .%s"szsay)
    
register_clcmd(sztempszfunction)
    
    
formatex(sztemp63 "say_team /%s"szsay)
    
register_clcmd(sztempszfunction )
    
    
formatex(sztemp63 "say_team .%s"szsay)
    
register_clcmd(sztempszfunction)

__________________
artYY 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 03:14.


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