Raised This Month: $51 Target: $400
 12% 

TFC Weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Team Fortress Classic        Category:   Gameplay       
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-12-2007 , 20:26   TFC Weapons
Reply With Quote #1

Team Fortress Classic: TFC Weapons!

Description: TFC WEAPONS allows any user on the server to pick any weapon(gun) they choose. This is not a amx_command it's in 'say'(Global Chat). Only one gun comes with 25rockets, for ammo which is the RPG(Rocket Launcher). This is not a plugin to abuse it.

Current Version: I have currently released version: "0.1" - - - Watch the update log.

Chat Commands: This will list the basic commands players need to type:
  • needrocket - Gives the player RocketLauncher.
  • needshotgun - Gives the player ShotGun(scouts).
  • needknife - Gives the player knife.
  • needsniper - Gives the player the Sniper.
  • needautorifle - Gives player Auto-Rifle.
  • needflamer - Gives player FlameThrower.
  • needrail - Gives player RailGun(medic/scout).
  • needmedkit - Gives player Medikit.
  • needac - Gives the player AC(HWGUY)
  • needsuper - Gives you SuperShotgun.
  • needtranq - Gives you tranquilizer.
  • needgrenadelauncher - Gives you GrenadeLauncher.
Want More: I might take your thought in adding something to this plugin. I will(no doubt) add more weapons to this( Will be displayed in Update Log ).

Code:
===Update Log===

2/12/07. - Plugin Released.
2/12/07. - Added 3 more weapons.
2/13/07. - Added SuperGun.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <tfcx>
#include <fun>

#define PLUGIN "TFC Weapons"
#define VERSION "1.0"
#define AUTHOR "Phantom Warrior"

public plugin_init() {
    
register_plugin("WeaponMe","0.1","")
    
register_clcmd("say needrocket","fnSayNeedRocket")
    
register_clcmd("say needshotgun","fnSayNeedShotGun")
    
register_clcmd("say needknife","fnSayNeedKnife")
    
register_clcmd("say needsniper","fnSayNeedSniper")
    
register_clcmd("say needautorifle","fnSayNeedAutoRifle")
    
register_clcmd("say needflamer","fnSayNeedFlamer")
    
register_clcmd("say needrail","fnSayNeedRail")
    
register_clcmd("say needmedkit","fnSayNeedMedkit")
    
register_clcmd("say needac","fnSayNeedAc")
    
register_clcmd("say needsuper","fnSayNeedSuper")
    
register_clcmd("say needtranq","fnSayNeedTranq")
    
register_clcmd("say needgrenadelauncher","fnSayNeedGrenLauncher"
Attached Files
File Type: sma Get Plugin or Get Source (TFC_weapons.sma - 869 views - 2.3 KB)

Last edited by Phantom Warrior; 02-13-2007 at 06:43. Reason: Fixed Typo.
Phantom Warrior is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 02-12-2007 , 20:45   Re: TFC Weapons
Reply With Quote #2

You're method is horrible. Instead of registering practically the same command god knows how many times, just remake it to where it can read paramters.

Oh let's say player types in chat:
/need rocket
/need shotgun
/need gaben
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-12-2007 , 20:46   Re: TFC Weapons
Reply With Quote #3

Wait, What?
Phantom Warrior is offline
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
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-12-2007 , 21:53   Re: TFC Weapons
Reply With Quote #5

I really don't get it, I was taught to do it the way I did it, and it works that way.
Phantom Warrior is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 02-12-2007 , 22:04   Re: TFC Weapons
Reply With Quote #6

It's really poor coding, and I was just offering advice. The one infinite question in programming is not how to get something done, but how to get it done efficiently.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-12-2007 , 22:08   Re: TFC Weapons
Reply With Quote #7

Thank you for your advice, i've sent you a PM regarding our issue.
Phantom Warrior is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-12-2007 , 22:13   Re: TFC Weapons
Reply With Quote #8

**ATTENTION APPROVERS**

Try not to unapprove/approve this yet, Zenith and I are going over some minor changes. Thank you.
Phantom Warrior is offline
mahooo60
Senior Member
Join Date: Apr 2005
Old 02-13-2007 , 03:07   Re: TFC Weapons
Reply With Quote #9

its maybe better if dont have to "type" all of it.
better will be if players have to type only a menu that shows 1234567...and the players can choose their class!
mahooo60 is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-13-2007 , 06:08   Re: TFC Weapons
Reply With Quote #10

Very VERY Nice idea, I like. I will add this, most likely.
Phantom Warrior is offline
Reply



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 07:44.


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