error 017: undefined symbol "randomEx"
#1

I am trying to make random drug system but it keeps failing

Код:
CMD:test(playerid, params[])
{
    new drugs = randomEx(1,10);
	new string[128];
	format(string, sizeof(string), "You received %d drugs", drugs);
	SendClientMessage(playerid, COLOR_YELLOW, string);
	PlayerInfo[playerid][pWeed] = drugs;
	return 1;
}
Код:
error 017: undefined symbol "randomEx"
Reply
#2

Found the solution

stock randomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum;
Reply
#3

Quote:
Originally Posted by Squirrel
Посмотреть сообщение
I am trying to make random drug system but it keeps failing

Код:
CMD:test(playerid, params[])
{
    new drugs = randomEx(1,10);
	new string[128];
	format(string, sizeof(string), "You received %d drugs", drugs);
	SendClientMessage(playerid, COLOR_YELLOW, string);
	PlayerInfo[playerid][pWeed] = drugs;
	return 1;
}
Код:
error 017: undefined symbol "randomEx"
#define randomEx(%1,%2) (random(%2-%1)+%1)
Reply
#4

PHP код:
#define randomEx(%1,%2) (random(%2)+%1) //if you don't want it to be 0 but it might exceed the max, so set max to 9. 
EDITED^
Reply
#5

You realize the thread is years old right?
Reply
#6

Quote:
Originally Posted by DTV
Посмотреть сообщение
You realize the thread is years old right?
Just realized that ... but I didn't bump it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)