View Single Post
Ulrich
Member
Join Date: Mar 2010
Location: In a box
Old 06-12-2010 , 03:55   Re: [L4D2] Weapon/Zombie Spawner v0.7a (Update 14.01.2010)
Reply With Quote #361

Since I know nothing about programming plugins, could someone help me?

I'm altering the menu-creating part of this code to add the Riot Shield as an option for a spawnable Melee weapon. What I've done is I took the code already in the plugin and just changed the names of the weapons to riotshield, which is the Riot Shield's weapon name. I've added this to the list of melee weapons for each of the campeigns (could this be the problem?), along with the AllowAllMeleeWeapons menu. This is what it ends up looking like:
Code:
Format(riotshield, sizeof(riotshield),"%T", "RiotShield", LANG_SERVER)
  AddMenuItem(menu, "riotshield", riotshield)
I've also added a string to the code for the riotshield as is done with each other weapon:
Code:
BuildMeleeGiveMenu(client)
{
 decl String:baseball_bat[40], String:cricket_bat[40], String:crowbar[40],
 String:electric_guitar[40], String:fireaxe[40], String:riotshield[40];}
Something is wrong, though, because when I navigate to the GiveWeaponMenu, selection of the Melee catagory exits the menu. Since I obviously did something wrong, could some one please post a re-compiled version of the plugin so I can both have a working version and see what I did wrong (as I am new to writing plugins)? Also, I know that spawning of the riotshield with this plugin works, since it gives a player the Riot Shield when I use the sm_gw <client> riotshield. Thanks in advance to anyone that helps.

Edit: If it makes any difference, I'm running the latest version of this plugin, v0.8

Last edited by Ulrich; 06-12-2010 at 04:05.
Ulrich is offline