Raised This Month: $ Target: $400
 0% 

Buy Unflash


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-30-2007 , 10:58   Re: Buy Unflash
Reply With Quote #2

- Since you're using fakemeta, you can use it to get/set user money, so no more need cstrike module.
Something like :

Code:
    #define OFFSET_CSMONEY    115     #define LINUX_EXTRAOFFSET 5     new g_iMsg_Money;     public plugin_init()     {         g_iMsg_Money = get_user_msgid( "Money" );     }     get_user_money( id )         return get_pdata_int( id, OFFSET_CSMONEY, LINUX_EXTRAOFFSET );     set_user_money( id, iNew_money, iFlash = 1 )     {         set_pdata_int( id, OFFSET_CSMONEY, iNew_money, LINUX_EXTRAOFFSET );         message_begin( MSG_ONE, g_iMsg_Money, _, id );         write_long( iNew_money );         write_byte( iFlash ? 1 : 0);         message_end();     }
- Optimization. Use formatex() instead of format().

- It's ugly to use an array for pvars. If you like this way, at least you should using an enum for a better readability. Something like:
Code:
    enum e_Unflash     {         buy_unflash,         unflash_price     }     new pcvar[ e_Unflash ];         public plugin_init()     {         pcvar[ buy_unflash ]   = register_cvar( "amx_buyunflash"  , "1", FCVAR_SERVER|FCVAR_UNLOGGED );         pcvar[ unflash_price ] = register_cvar( "amx_unflashprice", "2000", FCVAR_SERVER|FCVAR_UNLOGGED );     }     // ...     get_pcvar_num( pcvar[ buy_unflash ] )     get_pcvar_num( pcvar[ unflash_price ] )
__________________

Last edited by Arkshine; 12-30-2007 at 11:01.
Arkshine 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 20:38.


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