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 , 22:03   Re: Random player
Reply With Quote #5

It retrieves a player list (alive) and return a random player id.

Of course you have to replace this function by the other above.


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 iPlayers[32], iNum         get_players( iPlayers, iNum, "a" );                 return iPlayers[ random( iNum ) ];     }         give_extra( id )     {         set_pev( id, pev_health, 1000.0 );     }
__________________
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