I would make it this way:
PHP Code:
#include <amxmodx>
new g_player_num[33]
new g_max_players
public plugin_init(){
register_plugin( "test", "1.0", "Sylwester" )
g_max_players = get_maxplayers()
set_numbers()
mix_numbers()
}
public set_numbers(){ //set default numbers {1,...,32}
for(new i=1; i<=32; i++)
g_player_num[i] = i
}
public mix_numbers(){ //exchange every number with randomly chosen
new temp_exchange
new temp_random
for(new i=1; i<=g_max_players; i++){
temp_random = random_num(1, g_max_players) //use this if you want to give them numbers {1,...,g_max_players}
//temp_random = random_num(1, 32) //use this if you want to give them numbers {1,...,32}
//exchange numbers
temp_exchange = g_player_num[i]
g_player_num[i] = g_player_num[temp_random]
g_player_num[temp_random] = temp_exchange
}
}
__________________