Results 1 to 2 of 2
  1. #1
    B3CLAWED's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    143
    Reputation
    10
    Thanks
    57
    My Mood
    Busy

    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.

  2. #2
    SinnersTV's Avatar
    Join Date
    Feb 2015
    Gender
    male
    Location
    USA
    Posts
    102
    Reputation
    10
    Thanks
    22
    My Mood
    Cool
    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
    go watch my bad content: https://www.youtube.com/cequalstv

Similar Threads

  1. [Steam] Guess the number between 1-100 for a game key.
    By adoben88 in forum Giveaways
    Replies: 50
    Last Post: 08-23-2015, 12:56 PM
  2. [Release] new CD key give away x2 just thank me and pick a number between 1-100
    By Dayzservices in forum DayZ Mod & Standalone Hacks & Cheats
    Replies: 55
    Last Post: 01-21-2013, 03:55 PM
  3. Generating Unique Random Numbers?
    By apandhi in forum C++/C Programming
    Replies: 10
    Last Post: 05-23-2010, 11:51 AM
  4. Fill with random numbers between 0-12
    By ppl2pass in forum Visual Basic Programming
    Replies: 13
    Last Post: 02-22-2010, 03:00 PM
  5. Random Number Generator
    By Iam"iDude" in forum Visual Basic Programming
    Replies: 5
    Last Post: 10-02-2007, 04:16 PM

Tags for this Thread