|
|
Hey guys. Sorry for the title, but I really didn't know what to name it lol.
You've probably seen that Eudora-World that was posted? First of all, I want to say that H 4 Z B R O and I coded most of that client (it was coded from a clean PI client). Also, there is a "gambler" at the home. Well it doesn't work ( no suprize ). Well I made some stuff to add to that. As you know, I'm mostly a java programmer, not a rsps coder so I know most about java, and I will be mastering it soon. Well I made a Random Number Generator which you can use with the gambler so that it will pick a number, and if you guess that, than you will get your prize. Here is part of what you would have to add:
I will be adding more if people want me to perfect it, and make it so you can add it fully to your server. So comment below if you want me to finish and perfect it, so that it could be a command.Originally Posted by // Random Number Generator
import java.util.Random;
class commands{
public static void main(String[
Thanks, -TheNewCoder A.k.A Steven
I'm sorry, but how is this even a snippet? Most servers have a Random object already added into one of their utility classes anyways.
Oh, sorry about that. I never saw that in a server before. Sorry.
Nobody uses it, so I wanted to promote it I guess.




Lol nice effort, but I think its pretty obvious how to create an instance of util.Random and generate a random number.
And like what was said before, what's wrong with
Code:if (misc.Random(3) = 3){
You say 75%, when about 10% do. Trust me, they don't know how.

Just because you don't know how doesn't mean 10% or so don't, the only people who don't are the extremely new beginners.
Well alot, and I mean ALOT of the people on Rune-Server claim that they are good coders, but they only talk, or they leech. They never release anything besides reposts shit.


"Java - Random number" would've been a suitable title.
If you actually wanted to make a gambling system with a command, this would do:
Code:if(command.equals("gamble")){ int[][] possibleRewards = { {4151, 995}, // Item ids {1, 200000} // Item amounts }; if(!hasPlayerItem(995, 100000)){ sendMessage("You need 100,000 gold pieces to gamble."); return; } deleteItem(995, 100000); if((Math.random() * 10) == 1){ int idx = (Math.random() * possibleRewards[0].length); addItem(possibleRewards[0][idx], possibleRewards[1][idx]); sendMessage("Congratulations you got an item from the gamble."); } else { sendMessage("Sorry you didn't get anything from this gamble!"); } }
| « Project Insanity Improved Commands Class + SpawnNPC Command | [PI] ::goup / ::godown commands » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |