 |
|
AlliedModders Donor
Join Date: May 2020
Location: Israel
|

10-20-2020
, 14:25
Re: [vip menu plugin]
|
#2
|
Quote:
Originally Posted by lemmon_cs
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_VIP, ADMFLAG_CUSTOM1);
}
public void OnMapEnd()
{
g_iRounds = 0;
}
public Action OnRoundStart(Event event, char[] name, bool dontBroadcast)
{
g_iRounds++;
for(int i = 1; i <= MaxClients;i++)
{
if(IsClientInGame(i)&&!IsFakeClient(i))
g_bAlreadyUsed[i] = false;
}
}
public Action Command_VIP(int client, int 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(client, MENU_TIME_FOREVER);
}
public int menuHandler_VipMenu(Menu menu, MenuAction action, int client, int itemNUM)
{
if (action == MenuAction_Select)
{
char sWeapon[32];
menu.GetItem(itemNUM, sWeapon, sizeof(sWeapon));
GivePlayerItem(client, sWeapon);
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:
|
|
|
|