This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Round Survival Money


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-02-2007 , 19:51   Re: Round Survival Money
Reply With Quote #21

Quote:
@arkshine: why must you kill my moment? I use return PLUGIN_HANDLED because it makes the code look cleaner. ;)
What?

It seems that you don't know when you have to return PLUGIN_CONTINUE, PLUGIN_HANDLED, or PLUGIN_MAIN_HANDLED...
__________________

Last edited by Arkshine; 10-02-2007 at 19:54.
Arkshine is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 10-02-2007 , 20:07   Re: Round Survival Money
Reply With Quote #22

no I know when to use it, the damn little online-compiler tells me.

lol, anyway I know when too its just sometimes it corrects me, it's like a habit.
X-Script is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 10-02-2007 , 20:17   Re: Round Survival Money
Reply With Quote #23

Can you fix my name?
__________________
M249-M4A1 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-02-2007 , 20:17   Re: Round Survival Money
Reply With Quote #24

In your 2 public funtions you don't have to return PLUGIN_HANDLED but 'return;' or 'return PLUGIN_CONTINUE;'.

I'm not good with explanations. Search in this forum. ( PM's posts I think )
__________________
Arkshine is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-02-2007 , 20:57   Re: Round Survival Money
Reply With Quote #25

Using fakemeta you can remove fun & cstrike requirement.
Also no need to put 'new money_to_give = get_pcvar_num(roundreward)' in your for(). It's better to retrieve the value one time.

Here my attempt:

Code:
    #include <amxmodx>     #include <fakemeta>         #define PLUGIN  "Round Survival Money"     #define VERSION "1.0"     #define AUTHOR  "X-Script"         #define GLOW_OFF_TIME  8.0         new         p_roundsurvival,         p_roundreward;             #define OFFSET_CSMONEY     115         #define LINUX_EXTRAOFFSET  5     #define _cs_get_user_money(%1)     get_pdata_int( %1, OFFSET_CSMONEY, LINUX_EXTRAOFFSET )     #define _cs_set_user_money(%1,%2)  set_pdata_int( %1, OFFSET_CSMONEY, %2, LINUX_EXTRAOFFSET )             public plugin_init()     {         register_plugin( PLUGIN, VERSION, AUTHOR );                 register_logevent( "round_end", 2, "0=World triggered", "1=Round_End" );         register_logevent( "new_round", 2, "0=World triggered", "1=Round_Start" );                 p_roundsurvival = register_cvar( "amx_survivemode", "1" );         p_roundreward   = register_cvar( "amx_survivecash", "3000" );     }         public new_round()     {         if( !get_pcvar_num( p_roundsurvival ) )             return;                 client_print( 0, print_chat, "[AMXX] ROUND STARTED: Survive this round and win an additional $%i!", get_pcvar_num( p_roundreward ) );     }         public round_end()     {         if( !get_pcvar_num( p_roundsurvival ) )             return;                 new             iPlayers[32], iNum, iPid,             money_to_give = get_pcvar_num( p_roundreward );                     get_players( iPlayers, iNum );                 for( new i = 0; i < iNum; i++ )         {             iPid = iPlayers[i];             if( is_user_alive( iPid ) )             {                 _cs_set_user_money( iPid, _cs_get_user_money( iPid ) + money_to_give );                             client_print( iPid, print_chat, "[AMXX] ROUND ENDED: You survived and have been awarded $%i!", money_to_give );                                 fm_set_rendering( iPid, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 0 );                 set_task( GLOW_OFF_TIME, "glow_off", iPid );             }             else                 client_print( iPid, print_chat, "[AMXX] ROUND ENDED: You did not survive this round. No award for you. Better luck next time!" );         }         }         public glow_off( id )     {         fm_set_rendering( id );     }             fm_set_rendering( entity, fx = kRenderFxNone, r = 0, g = 0, b = 0, render = kRenderNormal, amount = 0 )     {         new Float:RenderColor[3];         RenderColor[0] = float( r );         RenderColor[1] = float( g );         RenderColor[2] = float( b );         set_pev( entity, pev_renderfx   , fx );         set_pev( entity, pev_rendercolor, RenderColor );         set_pev( entity, pev_rendermode , render );         set_pev( entity, pev_renderamt  , float( amount ) );     }
__________________
Arkshine is offline
_Tool_
Junior Member
Join Date: Sep 2007
Old 10-02-2007 , 21:00   Re: Round Survival Money
Reply With Quote #26

Christ...another plugin that could be done in like 10 lines.
_Tool_ is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 10-02-2007 , 22:04   Re: Round Survival Money
Reply With Quote #27

lol, its like a bloody contest

Thats the best way to be efficient tho i guess...

And I actually like this idea. IF anything you have more control.
__________________
bmann_420 is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-02-2007 , 23:24   Re: Round Survival Money
Reply With Quote #28

Author banned. Unapproved.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Old 10-02-2007, 23:30
M249-M4A1
This message has been deleted by M249-M4A1. Reason: OK i got the reason; thanks vvg126
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 12:15.


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