Raised This Month: $ Target: $400
 0% 

[Solved] CS16: A new method for Unlimited@Infinity Clip.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-02-2016 , 04:12   Re: [Solved] CS16: A new method for Unlimited@Infinity Clip.
Reply With Quote #1

Not that it is required, but you could store all your weapons into a constant and then loop trough it in your plugin_init function to optimize your code & make it look better.

something like this?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new const szWeapons[][] = {
    
"weapon_glock18",
    
"weapon_usp",
    
"weapon_deagle",
    
"weapon_p228",
    
"weapon_elite",
    
"weapon_fiveseven",
    
"weapon_m3",
    
"weapon_xm1014",
    
"weapon_mp5navy",
    
"weapon_mac10",
    
"weapon_tmp",
    
"weapon_p90",
    
"weapon_ump45",
    
"weapon_galil",
    
"weapon_famas",
    
"weapon_ak47",
    
"weapon_m4a1",
    
"weapon_sg552",
    
"weapon_aug",
    
"weapon_g3sg1",
    
"weapon_sg550",
    
"weapon_scout",
    
"weapon_awp",
    
"weapon_m249"
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    new 
szTemp[555 char]
    for(new 
isizeof(szWeapons); i++) {
        
formatex(szTempcharsmax(szTemp), "%s"szWeapons[i])
        
RegisterHam(Ham_Item_DeployszTemp"OnItemDeployPost"1)
    }

EDIT: NVM, didn't notice date of topic.
__________________

Last edited by Napoleon_be; 06-02-2016 at 04:27.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 17:29.


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