Raised This Month: $ Target: $400
 0% 

how i can do a random array?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ang52
Member
Join Date: Jan 2012
Old 06-27-2012 , 08:16   how i can do a random array?
Reply With Quote #1

this is my code

but i don't know how to random array, i'v been search in the forum.

PHP Code:
#include < amxmodx >

new Array:Games
new gGamesCount;

public 
plugin_natives( )
{
    
register_native"jb_games_register""native_games_register" );
}

public 
native_games_registerpluginparams )
{
    new 
name64 ];
    
get_string1namecharsmaxname ) )
    
    
ArrayPushStringGamesname )
    
    
gGamesCount++
    return 
gGamesCount 1;
}

public 
plugin_init( )
{
    
register_clcmd"say /random""random_array" );
    
    
Games ArrayCreate36);
}

public 
random_arrayid )
{
    
// ok... what next?

thanks for help.
Ang52 is offline
DJHD!
Veteran Member
Join Date: Dec 2009
Location: Santiago, Chile
Old 06-27-2012 , 08:19   Re: how i can do a random array?
Reply With Quote #2

random_num?
__________________
Quote:
Originally Posted by XINLEI View Post
Porque rocccos trata de ser el metalicross que nunca va a poder ser.

Last edited by DJHD!; 06-27-2012 at 08:21.
DJHD! is offline
Send a message via MSN to DJHD!
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-27-2012 , 08:30   Re: how i can do a random array?
Reply With Quote #3

Explain what your trying to do.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Ang52
Member
Join Date: Jan 2012
Old 06-27-2012 , 09:13   Re: how i can do a random array?
Reply With Quote #4

im want that when i will write /random it will be choose a random game from the Array

did is possible?

of course it possible.

this is all i try to do.

to do a random game from the array.
Ang52 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-27-2012 , 11:42   Re: how i can do a random array?
Reply With Quote #5

random - Returns a pseudo-random number in the range of 0 to max-1.

PHP Code:
new szGame64 ];
ArrayGetStringGames randomArraySizeGames ) ) , szGame charsmaxszGame ) ); 
__________________

Last edited by Bugsy; 06-27-2012 at 11:44.
Bugsy is offline
Reply


Thread Tools
Display Modes

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 06:13.


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