PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
public Plugin:myinfo =
{
name = "A super cool weapon giver menu like there is so f*cking much",
author = "Arkarr",
description = "Nope.",
version = "1.0",
url = "http://www.sourcemod.net"
};
public OnPluginStart()
{
HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
}
public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
for(new i = 1; i <= MaxClients; i++)
if(IsClientInGame(i)) DisplayTHEsuperCOOLmenu(i);
}
public THEsuperCOOLmenu_HandlerYASH(Handle:THEsuperCOOLmenu, MenuAction:WhatTheFreakingUserDoAgain, NoobIdentifier, THEsuperCOOLmenuIndex)
{
if (WhatTheFreakingUserDoAgain == MenuAction_Select)
{
decl String:theWep[200];
GetMenuItem(THEsuperCOOLmenu, THEsuperCOOLmenuIndex, theWep, sizeof(theWep));
if(StrContains(theWep, "weapon", true) != -1)
{
new wep = GetPlayerWeaponSlot(NoobIdentifier, CS_SLOT_PRIMARY);
if(wep != -1)
AcceptEntityInput(wep, "Kill");
new newWep = GivePlayerItem(NoobIdentifier, theWep);
SetEntPropEnt(newWep, Prop_Data, "m_hOwnerEntity", NoobIdentifier);
EquipPlayerWeapon(NoobIdentifier, newWep);
SetEntPropEnt(NoobIdentifier, Prop_Send, "m_hActiveWeapon", newWep);
}
else
{
for(new i = 0; i < 10; i++)
PrintToChat(NoobIdentifier, theWep);
}
}
else if (WhatTheFreakingUserDoAgain == MenuAction_End)
{
CloseHandle(THEsuperCOOLmenu);
}
}
stock DisplayTHEsuperCOOLmenu(client)
{
new Handle:THEsuperCOOLmenu = CreateMenu(THEsuperCOOLmenu_HandlerYASH);
SetMenuTitle(THEsuperCOOLmenu, "A super cool weapons chooser :");
AddMenuItem(THEsuperCOOLmenu, "none", "--------", ITEMDRAW_DISABLED);
AddMenuItem(THEsuperCOOLmenu, "LOL I don't know how to add s !", "Favorite CT wep, but with a s (pew pew ...)");
AddMenuItem(THEsuperCOOLmenu, "weapon_m4a1", "Favorite CT wep (PEW PEW ...)");
AddMenuItem(THEsuperCOOLmenu, "weapon_ak47", "Favorite T wep, only for pros");
AddMenuItem(THEsuperCOOLmenu, "weapon_awp", "Choose this if you are a n00b at CS:GO");
DisplayMenu(THEsuperCOOLmenu, client, MENU_TIME_FOREVER);
}