How to make this kind of function?
#1

I got
Код:
new rand_proc = {
	{random(4)+30},
	{random(12)+30}
	};
could anyone tell me how to do this function to make the first line give from 4 to 30 points and second from 12 to 30points without any errors? because i get some errors and i don't know really how to form this one..
Reply
#2

'Nyone?..
Reply
#3

I don understand, but what should the function do ?
Reply
#4

Umh ok, look right now i got a function like this:
Код:
new random_points[][3] = {
	{5,13,30}
and i want a function like :

Код:
new rand_proc = {
	{random(4)+30},
the point of this is that the random_points gives only 5,13,30 points and i want to make that it would give 4,5,6,7,8,9,10,11... and so on to 30, understand?
Reply
#5

Quote:
Originally Posted by 0ne
Umh ok, look right now i got a function like this:
Код:
new random_points[][3] = {
	{5,13,30}
and i want a function like :

Код:
new rand_proc = {
	{random(4)+30},
the point of this is that the random_points gives only 5,13,30 points and i want to make that it would give 4,5,6,7,8,9,10,11... and so on to 30, understand?
pawn Код:
stock GiveRandomPoints( playerid, maxpoints )
{
    return SetPlayerScore( playerid, GetPlayerScore( playerid )+random( maxpoints ) );
}
You might use a variable to hold the points/score, but I've simplified it for you. There's no need whatsoever for an enum. This could will work.
Reply
#6

No it wont work, you don't understand, uhhh...

Код:
new random_points[][3] = {
	{5,13,30},
	{12,24,15},
	{24,30,35},
	{35,40,44},
	{44,47,53},
	{53,57,64},
	{64,80,84},
	{84,95,103},
	{103,124,154},
	{154,189,220},
	{220,250,320}
	};
The whole function of random points is like that, and the functioni m using is like this:
Код:
playerDB[killerid][EXP] += random_points[playerDB[killerid][Level]][rand];
it gives those points for the specific leve, so thats why i need a command like that with random..
Reply
#7

GUYS?!
Reply
#8

pawn Код:
random(26)+4
will do from 4 to 30
pawn Код:
random(18)+12
will go from 12 to 30
Reply
#9

I know that

I am asking for a command!

Код:
new rand_proc = {
	{random(26)+4}
I want that above command to get no errors, and i don't know how to do it that is ALL i am asking lol!
Reply
#10

This will not work. You have to randomize it everytime it gives score to player. Using a variable is not a good choice.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)