13.06.2013, 19:36
(
Последний раз редактировалось G0rniczek; 21.06.2013 в 21:34.
)
Maths Riddle v3.0

Maths Riddle it's a simple my script for you server for attraction. Players can guess the result of mathematical operations like:
45 + 25,45 - 25,45 / 5,45 * 25.
Just install and your players can get some award* for current result! You only must configure how often riddle start! (in minutes)
Maths Riddle - operations
adding,
subtraction,
multiplication,
division
All this operations it's tested and all works! Never happen to share a number which can not be divided, subtract the smaller number from the larger.
Maths Riddle - commands, award
Only one command for admin:
/riddle - start the math riddle without wait time

How to add award? In OnPlayerText callback after this:
Код:
format(str, sizeof(str),"{00AAFF}%s{FFFFFF} guessed the riddle of mathematical. (result: {00AAFF}%d{FFFFFF})",name,result); SendClientMessageToAll(-1, str);
Код:
format(str, sizeof(str),"{00AAFF}%s{FFFFFF} guessed the riddle of mathematical. (result: {00AAFF}%d{FFFFFF})",name,result); SendClientMessageToAll(-1, str); GivePlayerMoney(playerid, 10000);
Код:
#define TIME 5 // edit this line to set how often riddle start! (in minutes) #define RAND 4 // number of mathematical operations (LOOK in line: 28)
You must change (#define RAND) and after there:
Код:
case 3: { do { result = (numbers[0]=random(1000)+1) / (numbers[1]=random(600)+1); } while(numbers[0] % numbers[1]); format(str, sizeof(str),"New maths riddle is: {00AAFF}%d{FFFFFF} / {00AAFF}%d{FFFFFF} = ?",numbers[0], numbers[1]); SendClientMessageToAll(-1, str); isnow = true; }
Код:
case 4: { // 4 is the next operation result = (numbers[0]=random(1000)) + (numbers[1]=random(840)); // change this example: result = (numbers[0]=random(30)) * (numbers[1]=random(10) + (numbers[2]=random(30)); format(str, sizeof(str),"New maths riddle is: {00AAFF}%d{FFFFFF} * {00AAFF}%d{FFFFFF} + {00AAFF}%d{FFFFFF} = ?",numbers[0], numbers[1], numbers[2]); SendClientMessageToAll(-1, str); // no change isnow = true; // no change }
Programming:
Gorniczek (www.truck-spd.pl) for this script
Maths Riddle - download
http://www.solidfiles.com/d/bcd3dbfae9/