Raised This Month: $ Target: $400
 0% 

TFC Weapons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Zenith77
Veteran Member
Join Date: Aug 2005
Old 02-12-2007 , 21:01   Re: TFC Weapons
Reply With Quote #4

Instead of doing this a bunch of times:

Code:
register_clcmd("say /needshotgun", "fnSayNeedShotGun")

->
Code:
register_clcmd("say /need", "fnHookSayNeed"); // ... public fnHookSayNeed(id) {      // bla bla read_arg here or w/e      if (equal(arg, "shotgun"))            GiveWeapon(WEAPON_SHOTGUN); }

Of course you would create a GiveWeapon() function (hopefully with weapon enumerations). But it would also be better to store all the weapon names or w/e in a cache, loop through them witch matches up with the weapon enumerations, and pass the iterator (I hope I used that correctly).
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred

Last edited by Zenith77; 02-12-2007 at 21:03.
Zenith77 is offline
 



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 11:06.


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