Random+Defined HELP
#1

i know its confusing title but...
i am making events and there are 3 possible places with rewards.
1st place 1k+random out of 300
2nd place 600+random out of 200
3rd place 300+random out of 100
that means if like guy wins race and he gets for example 1241$
next time he wins same race he gets 1163$
in every case he gets at least 1000 and max 1300$
how to do it
Reply
#2

Slow the fuck down.

You didn't even fix your previous problem. Plus you still want users to give you code right? How about you make a core function and we will guide you? You can't do this forever you know?
Reply
#3

Quote:
Originally Posted by Fratello
Посмотреть сообщение
Slow the fuck down.

You didn't even fix your previous problem. Plus you still want users to give you code right? How about you make a core function and we will guide you? You can't do this forever you know?
dude.... i am not asking to post code
just to how it looks or what commands are needed.
and yes those problems are less important because im trying to do as many things possible in a short time(idea,script,test,finish) 3 maybe 5 things at once.
and yea i am damn quick
Reply
#4

If I tell you how to make it , will you end up requesting the code?
Reply
#5

Here you are bro, I think it will help you:
PHP код:
new Places randomEx(1,3);
switch(
Places)
{
    case 
1GivePlayerMoney(playerid,1000+RandomEx(100,300)); // 1k + Random between 100 and 300
    
case 2GivePlayerMoney(playerid,600+RandomEx(100,200)); // 1k + Random between 100 and 200
    
case 3GivePlayerMoney(playerid,300+RandomEx(0,100)); // 1k + Random between 0 and 100

There are the stocks if you didn't definded them:
PHP код:
stock randomEx(minnum cellminmaxnum cellmax) return random(maxnum minnum 1) + minnum
PHP код:
stock RandomEx(minmax)
{
    new 
output;
    
output max-min;
    
output random(output);
    
output min+output;
    return 
output;

+REP me if I helped!
Reply
#6

Quote:
Originally Posted by Fratello
Посмотреть сообщение
If I tell you how to make it , will you end up requesting the code?
of course no

Quote:
Originally Posted by Kraeror
Посмотреть сообщение
Here you are bro, I think it will help you:
PHP код:
new Places randomEx(1,3);
switch(
Places)
{
    case 
1GivePlayerMoney(playerid,1000+RandomEx(100,300)); // 1k + Random between 100 and 300
    
case 2GivePlayerMoney(playerid,600+RandomEx(100,200)); // 1k + Random between 100 and 200
    
case 3GivePlayerMoney(playerid,300+RandomEx(0,100)); // 1k + Random between 0 and 100

There are the stocks if you didn't definded them:
PHP код:
stock randomEx(minnum cellminmaxnum cellmax) return random(maxnum minnum 1) + minnum
PHP код:
stock RandomEx(minmax)
{
    new 
output;
    
output max-min;
    
output random(output);
    
output min+output;
    return 
output;

+REP me if I helped!
thats what i wanted dude yee
+rep both of you(kinda kraeror only deserves it but hey why not)
btw it says i must spread it before giving it to you again xDD
Reply
#7

You won't learn to code if you don't put effort on it. You already said what you want, why asking for it? The Scripting Help topic is for uncommon errors, that you can't solve yourself, not for code begging. I am sure that Kraeror don't even know what "stock" means. "kinda kraeror only deserves it", he just gave you the code, when Fratello tried to make you learn how to do it. What you will do in the real life when you will be facing a problem? Asking others to find solutions for you, or think yourself about them.

Just to "feed" your copy-paste hungry:
PHP код:
RandomBased(base,max)
{
  new 
out base random(max);
  return 
out;

So the solution wasn't simple?
Reply
#8

Quote:
Originally Posted by 10MIN
Посмотреть сообщение
You won't learn to code if you don't put effort on it. You already said what you want, why asking for it? The Scripting Help topic is for uncommon errors, that you can't solve yourself, not for code begging. I am sure that Kraeror don't even know what "stock" means. "kinda kraeror only deserves it", he just gave you the code, when Fratello tried to make you learn how to do it. What you will do in the real life when you will be facing a problem? Asking others to find solutions for you, or think yourself about them.

Just to "feed" your copy-paste hungry:
PHP код:
RandomBased(base,max)
{
  new 
out base random(max);
  return 
out;

So the solution wasn't simple?
ok i know i wont learn, but when someone already offers me code itake a look at wiki and see what does these functions look like so i can imagine how it will be in game. copy paste you say? i do copy paste but then i go all over code and edit it as i want
Quote:

What you will do in the real life when you will be facing a problem? Asking others to find solutions for you, or think yourself about them.

probably both. but some kind of force pulls me to ask other people
Reply
#9

" i do copy paste but then i go all over code and edit it as i want" I can only speculate your editing. Translating from English to Serbian right?

10Min has given you the code example, you didn't even discuss about it. What does it mean? It means you're looking for code. Another example is ship include. You was looking for a ship with planes on it right? I gave you include for SHIPS ONLY. You have replied 'there are no planes on it'. You didn't even try to add a plane or two.

I'm going to a programming school. We're learning algorithms. It's not really easy as you may think. I spent two hours solving my programming homework. I didn't post it on forums. Each time you do something on your own (e.g fix) you raise your orientation. You're doing nothing. You will make a same topic with a new errors without fixing previous.
Reply
#10

Quote:
Originally Posted by 10MIN
Посмотреть сообщение
You won't learn to code if you don't put effort on it. You already said what you want, why asking for it? The Scripting Help topic is for uncommon errors, that you can't solve yourself, not for code begging. I am sure that Kraeror don't even know what "stock" means. "kinda kraeror only deserves it", he just gave you the code, when Fratello tried to make you learn how to do it. What you will do in the real life when you will be facing a problem? Asking others to find solutions for you, or think yourself about them.

Just to "feed" your copy-paste hungry:
PHP код:
RandomBased(base,max)
{
  new 
out base random(max);
  return 
out;

So the solution wasn't simple?
You said I can't script, right?
Okay, I'm trying to help another people, so I can't script!
How I can create the code, with no knowage? I'm using 'stock' and I don't know what it means
Best logic ever <<<<
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)