Raised This Month: $ Target: $400
 0% 

Four variables into one and back


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
jim_yang
Veteran Member
Join Date: Aug 2006
Old 02-12-2009 , 07:16   Re: Four variables into one and back
Reply With Quote #5

Code:
#include <amxmodx>
 
#define PLUGIN    "Test"
#define AUTHOR    "Jim"
#define VERSION    "1.0"
 
#define MAKEWORD(%1,%2,%3,%4) ((((%1)&0xF)<<12)|(((%2)&0xF)<<8)|(((%3)&0xF)<<4)|((%4)&0xF))
#define GET_1(%1) ( (%1)>>12 & 0xF )
#define GET_2(%1) ( (%1)>>8  & 0xF )
#define GET_3(%1) ( (%1)>>4  & 0xF )
#define GET_4(%1) ( (%1)     & 0xF )
 
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("test", "test")
}
 
public test(id)
{
    new a = 1
    new b = 5
    new c = 7
    new d = 13
    new e = MAKEWORD(a,b,c,d)
    console_print(id, "%d %d %d %d", a, b, c, d)
    console_print(id, "%d %d %d %d", GET_1(e), GET_2(e), GET_3(e), GET_4(e))
    return 1
}
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang 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 16:55.


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