[REQ] /roll command

Submit your code requests, and if you are good at coding come help others with their requests.
Post Reply
Kardon
Regular
Posts: 36
Joined: Sun Feb 29, 2004 1:58 am

Post by Kardon »

Simple command I think all coders can create.

say you and a buddy are hunting wws, you get a good drop.

in wow you get a /roll command which chooses a number at random, usually the highest number wins.

how about add a /roll command that will randomly roll numbers 1-100.

can someone do this please?
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

Kardon wrote: Simple command I think all coders can create.

say you and a buddy are hunting wws, you get a good drop.

in wow you get a /roll command which chooses a number at random, usually the highest number wins.

how about add a /roll command that will randomly roll numbers 1-100.

can someone do this please?
Probably one of the easiest things I've seen requested xD

Code: Select all

  if (memcmp(cp, "/roll", 5) == 0) {
  	wsprintf(G_cTxt, "Random dice roll: %d", iDice(1,100));
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, G_cTxt);
  	return;
  }
Or to make sure they don't "cheat"

Code: Select all

  if (memcmp(cp, "/roll", 5) == 0) {


  	CStrTok * pStrTok = new class CStrTok(cp, " ");
  	char * token;
  	token = pStrTok->pGet();
  	token = pStrTok->pGet();

  	if (token == NULL) {
    delete pStrTok;
    return;
  	}

  	for (int x = 0; x < DEF_MAXCLIENTS; x++)
    if ((m_pClientList[x] != NULL) && (memcmp(m_pClientList[x]->m_cCharName, token, 10) == 0)) {
    	int iRoll = iDice(1,100);
    	wsprintf(G_cTxt, "Random dice roll: %d", iRoll);
    	SendNotifyMsg(NULL, x, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, G_cTxt);
    	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, G_cTxt);
    	delete pStrTok;
    	return;
    }
  	delete pStrTok;
  	return;
  }
Sends it to both players (supply 2nd player name ex: /roll Friendsname)
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
ogeid
Member
Posts: 110
Joined: Thu Feb 02, 2006 11:11 pm

Post by ogeid »

u dont get the idea

EDIT: u get the idea :D
"Prefiero morir de pie que vivir arrodillado"
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

ogeid wrote: u dont get the idea
Get the idea of what? He asked for a command to randomly roll a number and return it. That's all it does x.x
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
Kardon
Regular
Posts: 36
Joined: Sun Feb 29, 2004 1:58 am

Post by Kardon »

thanks bro =]
Post Reply