Random Score - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Random Score (
/showthread.php?tid=531561)
Random Score -
NewbieTester - 13.08.2014
Hello Guys , I Need help on givng a player Random scores from 25 to 50
Here is my define
PHP Code:
#define CONTEST_SCORE 2
Can Someone help me ?
Re: Random Score -
Norrin - 13.08.2014
Assign this to your score - random(26)+25
Re: Random Score -
greentarch - 13.08.2014
pawn Code:
stock randomEx(min, max)
return (random(max - min + 1) + min);
Usage:
pawn Code:
new
randScore = randomEx(25, 50);
SetPlayerScore(playerid, GetPlayerScore(playerid) + randScore);
Re: Random Score -
NewbieTester - 13.08.2014
Quote:
Originally Posted by greentarch
pawn Code:
stock randomEx(min, max) return (random(max - min + 1) + min);
Usage:
pawn Code:
new randScore = randomEx(25, 50); SetPlayerScore(playerid, GetPlayerScore(playerid) + randScore);
|
Where do i have to put all of these , i mean do i have to include
Re: Random Score -
iFarbod - 13.08.2014
Quote:
Originally Posted by NewbieTester
Where do i have to put all of these , i mean do i have to include
|
pawn Code:
#define rand(%1, %2) random(%2 - %1) + %1
Re: Random Score -
NewbieTester - 13.08.2014
Quote:
Originally Posted by greentarch
pawn Code:
stock randomEx(min, max) return (random(max - min + 1) + min);
Usage:
pawn Code:
new randScore = randomEx(25, 50); SetPlayerScore(playerid, GetPlayerScore(playerid) + randScore);
|
Quote:
Originally Posted by iFarbod
pawn Code:
#define rand(%1, %2) random(%2 - %1) + %1
|
Then What's Next ? Any Variable connected to the Define ?
Explain pls