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! 8) ../zone/parser.cpp : line 1456 (or thereabouts) INSERT this Code:
//used_pawn |
bah, i hadnt updated my cvs lately, try putting it here
../zone/parser.cpp : line 1497 Code:
else if (!strcmp(varname,"chr")) { |
ok.. got it
|
I've been testing this out and it doesn't seem to use the amount you enter in $random() as the max.
|
are yoou using $random("10") or $random(10) ?
|
Tried with both, neither work 100% of the time.
And this is with creating a script to where the npc responds with all of the possible numbers in the quest. |
Bleh
Change: Replace(origstring,format,itoa(rand()%varparms[0],temp,10)); To: Replace(origstring,format,itoa(rand()%atoi(varparm s[0]),temp,10)); Should maybe do the trick |
the number you put in will never be chosen, that is by design.
as I stated 0<n<x where x is the number you put in random(x), easy to put in one number higher than you need, or change it in the code, doesnt really matter to me either way. I have noticed strange things with quotes on many commands, some use them, some dont, some dont seem to work the same way twice in a row. Wasnt sure if it was things ive done to my code or if everyone had the problem ah well, these things happen |
All times are GMT -4. The time now is 10:05 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.