Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

Add Vip Guns on Menu


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
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)


Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

×
×
  • Dodaj nową pozycję...