PHP Code:
public DoSomethingRandom() {
switch(random_num(1,10)) { // create a random number between 1 and 10, inclusive
case 1: client_print(0, print_chat, "[AMXX] Random number: 1")
case 2: client_print(0, print_chat, "[AMXX] Random number: 2")
case 3: client_print(0, print_chat, "[AMXX] Random number: 3")
case 4..9: client_print(0, print_chat, "[AMXX] Random number between 4 and 9 (inclusive)") // Something between 4 and 9, inclusive
default: client_print(0, print_chat, "[AMXX] This doesn't fit any of the above cases.") // If nothing fits the case, do this
}
}
__________________