Raised This Month: $ Target: $400
 0% 

Equal and sizeof.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-10-2011 , 09:22   Re: Equal and sizeof.
Reply With Quote #1

Another way without looping for string matches:
PHP Code:
#include <amxmodx>
#include <fun>

//WPN
new weapon_list 
    (
1<<CSW_SCOUT) |
    (
1<<CSW_SG550) |
    (
1<<CSW_FAMAS) |
    (
1<<CSW_USP) |
    (
1<<CSW_AWP) |
    (
1<<CSW_M249) |
    (
1<<CSW_M4A1) |
    (
1<<CSW_DEAGLE) |
    (
1<<CSW_P90)
;

public 
plugin_init() {
    
register_plugin("WPN""0.01""Ex3cuTioN");
    
register_clcmd("say","cmdWPN");
}

public 
cmdWPN(id) {
    static 
s_Args[32];
    
read_args(s_Argscharsmax(s_Args));
    
    if(!
s_Args[0])
        return 
PLUGIN_CONTINUE;
        
    
remove_quotes(s_Args);
    
strtolower(s_Args);
    
format(s_Argscharsmax(s_Args), "weapon_%s"s_Args);
    
    new 
weaponID get_weaponid(s_Args);
    
    if(
weaponID && (weapon_list & (1<<weaponID)))
    {
        
give_item(ids_Args);
        
client_print(idprint_chat"You received %s"s_Args);
    }
    
    return 
PLUGIN_CONTINUE;

__________________
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 03:31.


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