Sari la conținut

[Cerere Plugin] vipmenu


lionzew

Postări Recomandate

#include <sourcemod> 
#include <sdktools> 

int g_Rounds;
bool g_HasUsedMenu[MAXPLAYERS + 1];

public Plugin myinfo =
{
    name = "VIP Menu",
    author = "PorcusorulMagic",
    version = "1.0",
    description = "Arme la VIP", 
    url = "www.usp.ro" 
};

public void OnPluginStart()
{
    HookEvent("round_start", Event_RoundStart);
    RegAdminCmd("sm_vipmenu", Command_VipMenu, ADMFLAG_CUSTOM6, "Comanda pentru arme VIP"); 
}

public void OnMapStart()
{
    g_Rounds = 0;
}

public void OnClientConnected(int client)
{
    g_HasUsedMenu[client] = false;
}

public Action Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
{
    g_Rounds++;
    
    for (int i = 1; i <= MaxClients; i++)
    {
        g_HasUsedMenu[i] = false;
    }
}

public Action Command_VipMenu(int client, int args)
{
    if (!client)
    {
        return Plugin_Handled;
    }
    
    if (g_Rounds == 1 || g_Rounds == 17 || g_Rounds == 2)
    {
        ReplyToCommand(client, "Nu poti lua arme in aceasta runda!");
        return Plugin_Handled;
    }
    
    if (g_HasUsedMenu[client])
    {
        ReplyToCommand(client, "Nu mai poti folosi meniul in aceasta runda!");
        return Plugin_Handled;
    }
    
    Menu vipmenu = new Menu(VIPMenu_Handler, MENU_ACTIONS_ALL);
    vipmenu.SetTitle("Meniu Arme");
    vipmenu.AddItem("AK47", "AK47");
    vipmenu.AddItem("M4A4", "M4A4");
    vipmenu.AddItem("M4A1-S", "M4A1-S");
    vipmenu.AddItem("AWP", "AWP");
    vipmenu.ExitButton = true;
    vipmenu.Display(client, MENU_TIME_FOREVER);
    
    return Plugin_Handled;
}

public int VIPMenu_Handler(Menu vipmenu, MenuAction action, int param1, int param2)
{
    char choice[32];
    vipmenu.GetItem(param2, choice, sizeof(choice));
    
    if (action == MenuAction_Select)
    {
        if (StrEqual(choice, "AK47"))
        {
            GivePlayerItem(param1, "weapon_ak47");
            PrintToChat(param1, " \x04[USP] \x07Ai ales \x03AK47 \x04!");
        }
        else if (StrEqual(choice, "M4A4"))
        {
            GivePlayerItem(param1, "weapon_m4a4");
            PrintToChat(param1, " \x04[USP] \x07Ai ales \x03M4A4 \x04!");
        }
        else if (StrEqual(choice, "M4A1-S"))
        {
            GivePlayerItem(param1, "weapon_m4a1_silencer");
            PrintToChat(param1, " \x04[USP] \x07Ai ales \x03M4A1-S \x04!");
        }
        else if (StrEqual(choice, "AWP"))
        {    
            GivePlayerItem(param1, "weapon_AWP");
            PrintToChat(param1, " \x04[USP] \x07Ai ales \x03AWP \x04!");
        }
    }
    
    else if (action == MenuAction_End)
    {
        delete vipmenu;
    }
}

Pentru meniul de arme

  • Love 1

YOUTUBE | TWITCH | STEAM | TIKTOK

chX82JV.png

Link spre comentariu
Distribuie pe alte site-uri

Vizitator
Acest topic este acum închis pentru alte răspunsuri.
×
×
  • Creează nouă...

Informații Importante

Am plasat cookie-uri pe dispozitivul tău pentru a îmbunătății navigarea pe acest site. Poți modifica setările cookie, altfel considerăm că ești de acord să continui. Also by continuing using this website you agree with the Terms of Use and Privacy Policy.