Raised This Month: $ Target: $400
 0% 

Random player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-14-2007 , 02:41   Re: Random player
Reply With Quote #2

Humm, maybe something like :

Code:
    #include <amxmodx>     #include <fakemeta>     public plugin_init()     {         register_plugin( "", "1.0", "Amxx Community" );         register_event( "HLTV", "eNew_round", "a", "1=0", "2=0" );     }         public eNew_round()     {         give_extra( random_person() );     }         random_person()     {         new iRandom_id = random_num( 1, get_playersnum() );                 return is_user_alive( iRandom_id ) ? iRandom_id : random_person();     }         give_extra( id )     {         set_pev( id, pev_health, 1000.0 );     }

New Round is happen at the freeze time start.

Quote:
or sometime around then
Use that. You can choose an interval.

Code:
    public eNew_round()     {         set_task( random_float( 2.0, 6.0 ), "random_person" );     }



EDIT: hm. I have a doubt about something. You can use this if above doesn't work well.

Code:
    random_person()     {         new iPlayers[32], iNum         get_players( iPlayers, iNum, "a" );                 return iPlayers[ random( iNum ) ];     }
__________________

Last edited by Arkshine; 10-14-2007 at 03:23.
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 01:23.


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