Raised This Month: $32 Target: $400
 8% 

Getting Clients Weapons/Nades


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xaphan
SourceMod Donor
Join Date: Jun 2008
Old 03-24-2009 , 10:31   Getting Clients Weapons/Nades
Reply With Quote #1

I'm in the process of porting over from eventscripts, and I'm finding it very difficult to find examples. Here is what I'm trying to do in SM.

I would like to get the primary weapon, secondary weapon, and total he, flashbangs, and smoke.

In ES I used weapon, dropped then gave weapon.
I would like to drop weapons instead of removing, if thats possible.

Any help would be much appreciated, thanks.

Heres the idea, I'm sure there is a better concept.
Code:
GetPrimaryWeapon(client)
--if == 1, drop primary
----GiveRequestedWeapon(client, weapon)
--else
----GiveRequestedWeapon(client, weapon)

GetSecondaryWeapon(client)
--if == 1, then drop secondary
----GiveRequestedWeapon(client, weapon)
--else
----GiveRequestedWeapon(client, weapon)

GetHECount(client)
--if == 0, 
----GiveNade(client, he, 1)
--else do nothing

GetFBCount(client)
--if == 0, 
----GiveNade(client, flashbang, 2)
--if == 1, 
----GiveNade(client, flashbang, 1)
--elseif == 2, 
----do nothing

GetSMCount(client)
--if == 0, 
----GiveNade(client, smoke, 1)
--else do nothing

GiveRequestedWeapon(client, weapon)
GiveNade(client, nadeType, amount)
Xaphan is offline
DaFox
Senior Member
Join Date: Mar 2005
Old 03-24-2009 , 12:26   Re: Getting Clients Weapons/Nades
Reply With Quote #2

There's some good example code here:

http://svn.alliedmods.net/viewvc.cgi...p&root=dvander

Namely the GiveGrenades() function.
DaFox is offline
Xaphan
SourceMod Donor
Join Date: Jun 2008
Old 03-24-2009 , 12:45   Re: Getting Clients Weapons/Nades
Reply With Quote #3

Thanks DaFox, This will do! ;)
Xaphan is offline
Reply


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 12:28.


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