Raised This Month: $ Target: $400
 0% 

[vip menu plugin]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-20-2020 , 14:25   Re: [vip menu plugin]
Reply With Quote #2

Quote:
Originally Posted by lemmon_cs View Post
I want a plugin for vip , a gunmenu like this
flag needed CUSTOM1 , can be opened only on 3th round and the menu guns are AWP , AK , M4A4 , once you selected a weapon from menu you can't open the menu until the next round starts , and a chat message "You used VIP menu this round" , and for nonvip users chat message "You are not vip" and "This menu can be oppened only on 3th round" , thanks
PHP Code:
#pragma semicolon 1

#define DEBUG

#include <sourcemod>
#include <sdktools>

#pragma newdecls required
int g_iRounds 0;
bool g_bAlreadyUsed[MAXPLAYERS 1] =  { false };
public 
Plugin myinfo 
{
    
name "VIP Gun Menu",
    
author "SheriF",
    
description "",
    
version "1.0",
    
url ""
};

public 
void OnPluginStart()
{
    
HookEvent("round_start"OnRoundStart);
    
RegAdminCmd("sm_vipguns"Command_VIPADMFLAG_CUSTOM1);
}
public 
void OnMapEnd()
{
    
g_iRounds 0;
}
public 
Action OnRoundStart(Event eventchar[] namebool dontBroadcast)
{
    
g_iRounds++;
    for(
int i 1<= MaxClients;i++)
    {
        if(
IsClientInGame(i)&&!IsFakeClient(i))
            
g_bAlreadyUsed[i] = false;
    }    
}
public 
Action Command_VIP(int clientint args)
{
    if(
IsClientInGame(client) && !IsFakeClient(client))
    {
        if(
g_iRounds<3)
            
PrintToChat(client"This menu can be oppened only on 3th round");
        else if(!
IsPlayerAlive(client))
            
PrintToChat(client"This menu can be oppened only when you are alive");
        else if(
g_bAlreadyUsed[client])
            
PrintToChat(client"You used VIP menu this round");
        else
        {
            
g_bAlreadyUsed[client] = true;
            
VIPMenu(client);
        }
    }
}
void VIPMenu(int client)
{
    
Menu menu = new Menu(menuHandler_VipMenu);
    
menu.SetTitle("Choose a weapon");
    
menu.AddItem("weapon_awp","Awp");
    
menu.AddItem("weapon_ak47","Ak47");
    
menu.AddItem("weapon_m4a1","M4A4");
    
menu.ExitButton true;
    
menu.Display(clientMENU_TIME_FOREVER);
}
public 
int menuHandler_VipMenu(Menu menuMenuAction actionint clientint itemNUM)
{
    if (
action == MenuAction_Select)
    {
        
char sWeapon[32];
        
menu.GetItem(itemNUMsWeaponsizeof(sWeapon));
        
GivePlayerItem(clientsWeapon);
        if(
StrContains(sWeapon,"m4a1")!=-1)
            
PrintToChat(client"You got a M4A4");
        else
            
PrintToChat(client"You got an A%s"sWeapon[8]);
    }

__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
 


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 05:47.


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