View Single Post
  #1  
Old 06-20-2003, 09:34 AM
used_pawn
Sarnak
 
Join Date: Apr 2003
Posts: 53
Default Added code for random numbers in quests =)

Ok, here it is! :worship:

usage is: $random(x)
where x is the upper limit of a random number 0 < n < x

also, put it in quotes when you use it (ie. givecash("random(10)","random(10)","random(5)","ra ndom(5)"

enjoy!

../zone/parser.cpp : line 1456 (or thereabouts) INSERT this
Code:
//used_pawn
	else if (!strcmp(varname,"random")) {
		char temp[10];
		Replace(origstring,format,itoa(rand()%varparms[0],temp,10));
	}
//used_pawn
Reply With Quote