Raised This Month: $ Target: $400
 0% 

Auto Reload


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-26-2008 , 15:20   Re: Auto Reload
Reply With Quote #1

Quote:
Originally Posted by devicenull View Post
What we are looking for in plugins:
  • Make sure it's code is clean, concise, and readable.
Quote:
Originally Posted by Johnny got his gun View Post
Badly coded plugins that do stuff in a silly way that there obviously are better and more sleek ways of doing will be trashed.
Instead of trashing, I will show you how you could make it better:

Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <fakemeta_util> public plugin_init() {     register_plugin("Auto Reload", "0.1", "Exolent");     register_event("CurWeapon", "EventCurWeapon", "be", "1=1"); } public EventCurWeapon(client) {     new clip, ammo;     new weapon = get_user_weapon(client, clip, ammo);         if( !clip && ammo ) // empty clip, but has backpack ammo     {         new classname[32];         get_weaponname(weapon, classname, sizeof(classname) - 1);                 new ent = fm_find_ent_by_owner(-1, classname, client);                 if( pev_valid(ent) )         {             if( pev(client, pev_button) & IN_ATTACK )             {                 client_cmd(client, "-attack");             }                         ExecuteHamB(Ham_Weapon_Reload, ent);         }     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 16:11.


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