lottery_api.inc
Original include source with line numbers.
| 1 | #if defined _lottery_api_included |
| 2 | #endinput |
| 3 | #endif |
| 4 | |
| 5 | #define _lottery_api_included |
| 6 | |
| 7 | // For the native lottery_set_description |
| 8 | const LOTTERY_COST = 0; |
| 9 | const LOTTERY_REWARD = 1; |
| 10 | |
| 11 | // Set the description of the cost or reward (in format style). |
| 12 | native lottery_set_description(const Which = LOTTERY_COST, const Description[] = "", any:...); |
| 13 | |
| 14 | // Set the number of options for the players to choose. |
| 15 | native lottery_set_options_num(const OptionsNum); |
| 16 | |
| 17 | // Sets the minimun number of participants for the lottery. |
| 18 | native lottery_set_min_participants(const MinParticipants); |
| 19 | |
| 20 | // Forces a lottery to start. Returns true on success, false if the lottery couldn't begin. |
| 21 | native bool:lottery_force_start(); |
| 22 | |
| 23 | // Returns the seconds (float with ms) remaining for the next lottery, 0.0 if a lottery is in progress. |
| 24 | // Returns < 0 if there is not a next lottery. |
| 25 | native Float:lottery_time_remaining(); |
| 26 | |
| 27 | // Called when a lottery is ready to start. |
| 28 | // This is the only correct place to call the natives lottery_set_* |
| 29 | // Return PLUGIN_HANDLED to stop the lottery from beginning. |
| 30 | forward lottery_start(); |
| 31 | |
| 32 | // Called when someone wants to participate. Here we must check if the player can pay. |
| 33 | // Return PLUGIN_HANDLED if the player can't pay. |
| 34 | forward lottery_check(id); |
| 35 | |
| 36 | // After checking that the player can pay the lottery, this is called. |
| 37 | // Here we collect the cost from the player. |
| 38 | forward lottery_pay(id); |
| 39 | |
| 40 | // This forward is called if someone payed to play but the lottery didn't start. |
| 41 | // Here we refund the cost to the player. |
| 42 | forward lottery_refund(id); |
| 43 | |
| 44 | // This forward is called when a player won the lottery. Here we give the reward to the player. |
| 45 | forward lottery_give_reward(id); |
| 46 | /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE |
| 47 | *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang10250\\ f0\\ fs16 \n\\ par } |
| 48 | */ |
| 49 | |