0 Members and 1 Guest are viewing this topic.
Rnumber := Random(100);if (Rnumber < 50) then WriteConsole (0,IDToName(ID) + ' won nothing, too bad! Better luck next time!',$EE81FAA1);if (Rnumber >= 50) and (Rnumber < 80) then WonTempMute(ID, THIRD_MUTE);if (Rnumber >= 80) and (Rnumber < 95) then WonTempMute(ID, SECOND_MUTE);if (Rnumber >= 95) and (Rnumber < 99) then WonTempMute(ID, FIRST_MUTE);if (Rnumber = 99) then WonTempBan(ID);
Code: [Select]Rnumber := Random(100);if (Rnumber < 50) then WriteConsole (0,IDToName(ID) + ' won nothing, too bad! Better luck next time!',$EE81FAA1);if (Rnumber >= 50) and (Rnumber < 80) then WonTempMute(ID, THIRD_MUTE);if (Rnumber >= 80) and (Rnumber < 95) then WonTempMute(ID, SECOND_MUTE);if (Rnumber >= 95) and (Rnumber < 99) then WonTempMute(ID, FIRST_MUTE);if (Rnumber = 99) then WonTempBan(ID);
1) Random(min, max);2) Try this?3) Just check if its empty?
Quote from: JFK on March 19, 2008, 05:53:30 pmCode: [Select]Rnumber := Random(100);if (Rnumber < 50) then WriteConsole (0,IDToName(ID) + ' won nothing, too bad! Better luck next time!',$EE81FAA1);if (Rnumber >= 50) and (Rnumber < 80) then WonTempMute(ID, THIRD_MUTE);if (Rnumber >= 80) and (Rnumber < 95) then WonTempMute(ID, SECOND_MUTE);if (Rnumber >= 95) and (Rnumber < 99) then WonTempMute(ID, FIRST_MUTE);if (Rnumber = 99) then WonTempBan(ID);I just wanted to say that that code might just not work as you expect... If the randomnumber is 99 both the last and the second last line will execute. You cannot just change your if-clauses it to 'else if' either, because then execution will stop if Rnumber >=95 (wich is the case when Rnumber=99). Also make sure you call randomize before calling the random function
if ((Rnumber=>95) and (Rnumber <99)) then WontTempMute(ID, FIRST_MUTE);
lowercase('o.O') returns 'o.o'
constWORDS : Array[1..5] of string = ('hello', 'why', 'wont', 'this', 'work');
Any way to make a constant array?