[Include] Shuffle array
#1

Shuffle array
Hello i made this simple include for shuffling arrays.
It uses random() function to put elements random order in array.

function: ShuffleArray(numbers[],amount)

Example
PHP код:
CMD:shuffle(playerid){
    new 
string[10],string2[10];
    
format(string,sizeof(string), ShuffleArray({3,4,5,6,7}) );
    
format(string2,sizeof(string2),"%d%d%d%d%d",string[0],string[1],string[2],string[3],string[4] );
     
SendClientMessage(playerid,-1,string2);
    return 
1;

I hope it helps.
Reply


Messages In This Thread
Shuffle array - by CodeStyle175 - 24.07.2015, 10:44
Re: Shuffle array - by SpikY_ - 24.07.2015, 10:52
Re: Shuffle array - by CodeStyle175 - 24.07.2015, 10:57

Forum Jump:


Users browsing this thread: 1 Guest(s)