HelpAdding a command that generates a random number between 1-100.

Posts 1–2 of 2 · Page 1 of 1
Adding a command that generates a random number between 1-100.
I'm trying to add a command that lets a player automatically say a random number 1-100 in the chat. Any ideas on this one? Also using club source. Thanks, Dante.
Code:
//Sin was here
#include <iostream>
#include <ctime> // Needed for the true randomization
#include <cstdlib> 
using namespace std;

int main ()
{
	int xRan;
	srand( time(0)); // This will ensure a really randomized number by help of time.
	
	xRan=rand()%100+1; // Randomizing the number between 1-100.
	cout << "Shows a random number between 1-100: " << xRan;	
	
	return 0;
}
you can figure out how to add that as a command. I don't want to do all the work for you
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Need help?