| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664 |
- /*
- /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
- | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
- | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
- | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
- | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
- | $$\ $$$| $$ \ $$ | $$ \ $$| $$
- | $$ \ $$| $$$$$$/ | $$ | $$| $$
- |__/ \__/ \______/ |__/ |__/|__/
- Horse Race Gambling System
- by Hector
- Next Generation Gaming, LLC
- (created by Next Generation Gaming Development Team)
- * Copyright (c) 2016, Next Generation Gaming, LLC
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are not permitted in any case.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- #include <YSI\y_hooks>
- CMD:placebet(playerid, params[])
- {
- if(!IsAtCasino(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a Casino."); // Check to see if the player is inside of a casino
- if((PlayerInfo[playerid][pHorse] > 0)) return SendClientMessage(playerid, COLOR_GREY, "You are already in a game."); // Check to make sure the player can't place another bet while he has horsetimer going
- #if defined zombiemode
- if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie")) return SendClientMessageEx(playerid, COLOR_GREY, "Zombies can't use this.");
- #endif
- if(GetPVarType(playerid, "Injured")) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot do this right now.");
- if(GetPVarType(playerid, "PlayerCuffed") || GetPVarInt(playerid, "pBagged") >= 1 || GetPVarType(playerid, "IsFrozen") || PlayerInfo[playerid][pHospital] || (PlayerInfo[playerid][pJailTime] > 0 && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1))
- return SendClientMessage(playerid, COLOR_GRAD2, "You can't do that at this time!");
- /*ShowPlayerDialog(playerid, DIALOG_HORSE_RACE, DIALOG_STYLE_TABLIST_HEADERS, "Inside Track Betting",
- "Horse\tBet\tPayout\n\
- Wong's Wang\t$18000\t$40000\n\
- Flaps's Ahoy\t$32000\t$70000\n\
- Beanflicker\t$46000\t$101000\n\
- Axe Wound\t$55000\t$123000\n\
- McTagnut & Fries\t$73000\t$161000\n\
- Love Torpedo\t$150000\t$330000\n\
- Arthur or Martha\t$425000\t$935000\n\
- Purple Love\t$875000\t$1900000\n\
- Billy Sastard\t$10000000\t$22000000",
- "Select", "Cancel");*/
- Dialog_Show(playerid, PlaceHorseBet, DIALOG_STYLE_TABLIST_HEADERS, "Inside Track Betting",
- "Horse\tBet\tPayout\n\
- Wong's Wang\t$18000\t$40000\n\
- Flaps's Ahoy\t$32000\t$70000\n\
- Beanflicker\t$46000\t$101000\n\
- Axe Wound\t$55000\t$123000\n\
- McTagnut & Fries\t$73000\t$161000\n\
- Love Torpedo\t$150000\t$330000\n\
- Arthur or Martha\t$425000\t$935000\n\
- Purple Love\t$875000\t$1900000\n\
- Billy Sastard\t$10000000\t$22000000",
- "Select", "Cancel");
- SendClientMessage(playerid, COLOR_GREY, "Welcome to Inside Track Betting!.");
- return 1;
- }
- Dialog:PlaceHorseBet(playerid, response, listitem, inputtext[]) {
- new string[128];
- if(!response) return 1;
- switch(listitem) {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 18000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 40000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 1;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -18000);
- format(string, sizeof(string), "%s has bet $18000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 18000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Wong's Wang for $18000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 32000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 70000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 2;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -32000);
- format(string, sizeof(string), "%s has bet $32000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 32000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Flap's Ahoy for $32000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 46000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 101000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 3;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -46000);
- format(string, sizeof(string), "%s has bet $46000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 46000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Beanflicker for $46000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 1142, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 3:
- {
- if(PlayerInfo[playerid][pCash] >= 55000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 123000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 4;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -55000);
- format(string, sizeof(string), "%s has bet $55000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 55000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Axe Wound for $55000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 4:
- {
- if(PlayerInfo[playerid][pCash] >= 73000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 161000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 5;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -73000);
- format(string, sizeof(string), "%s has bet $73000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 73000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on McTagnut & Fries for $73000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 1142, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 5:
- {
- if(PlayerInfo[playerid][pCash] >= 150000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 330000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 6;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -150000);
- format(string, sizeof(string), "%s has bet $150000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 150000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Love Torpedo for $150000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 6:
- {
- if(PlayerInfo[playerid][pCash] >= 425000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 935000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 7;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -425000);
- format(string, sizeof(string), "%s has bet $425000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 425000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Arthur or Martha for $425000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 1142, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 7:
- {
- if(PlayerInfo[playerid][pCash] >= 875000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 1900000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 8;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -875000);
- format(string, sizeof(string), "%s has bet $875000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 875000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Purple Love for $875000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 8:
- {
- if(PlayerInfo[playerid][pCash] >= 10000000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 22000000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 9;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -10000000);
- format(string, sizeof(string), "%s has bet $100000000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 10000000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Billy Sastard for $10000000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- }
- return 1;
- }
- /*
- hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
- new string[128];
- switch(dialogid) {
- case DIALOG_HORSE_RACE: {
- if(!response)return 1;
- else
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 18000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 40000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 1;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -18000);
- format(string, sizeof(string), "%s has bet $18000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 18000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Wong's Wang for $18000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 32000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 70000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 2;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -32000);
- format(string, sizeof(string), "%s has bet $32000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 32000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Flap's Ahoy for $32000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 46000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 101000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 3;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -46000);
- format(string, sizeof(string), "%s has bet $46000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 46000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Beanflicker for $46000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 1142, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 3:
- {
- if(PlayerInfo[playerid][pCash] >= 55000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 123000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 4;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -55000);
- format(string, sizeof(string), "%s has bet $55000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 55000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Axe Wound for $55000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 4:
- {
- if(PlayerInfo[playerid][pCash] >= 73000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 161000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 5;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -73000);
- format(string, sizeof(string), "%s has bet $73000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 73000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on McTagnut & Fries for $73000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 1142, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 5:
- {
- if(PlayerInfo[playerid][pCash] >= 150000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 330000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 6;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -150000);
- format(string, sizeof(string), "%s has bet $150000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 150000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Love Torpedo for $150000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 6:
- {
- if(PlayerInfo[playerid][pCash] >= 425000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 935000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 7;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -425000);
- format(string, sizeof(string), "%s has bet $425000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 425000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Arthur or Martha for $425000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 1142, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 7:
- {
- if(PlayerInfo[playerid][pCash] >= 875000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 1900000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 8;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -875000);
- format(string, sizeof(string), "%s has bet $875000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 875000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Purple Love for $875000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- case 8:
- {
- if(PlayerInfo[playerid][pCash] >= 10000000)
- {
- if(Businesses[InBusiness(playerid)][bSafeBalance] < 22000000) return SendClientMessage(playerid, COLOR_GREY, "The casino doesn't have enough money.");
- PlayerInfo[playerid][pHorse] = 9;
- TogglePlayerControllable(playerid, 0);
- GivePlayerCash(playerid, -10000000);
- format(string, sizeof(string), "%s has bet $100000000 on a horse", GetPlayerNameEx(playerid));
- Log("logs/horse.log", string);
- Businesses[InBusiness(playerid)][bSafeBalance] += 10000000; // Adds the money to the biz
- SaveBusiness(InBusiness(playerid));
- SendClientMessage(playerid, COLOR_GREY, "You have placed a bet on Billy Sastard for $10000000.");
- SetTimerEx("HorseTimer", 15000, false, "i", playerid);
- PlayerPlaySound(playerid, 3200, 0.0, 0.0, 0.0);
- format(szMiscArray, sizeof(szMiscArray), "%s places their bet and waits for the race to start", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_GREY, "**Announcer** And they're off!.");
- }
- else return SendClientMessage(playerid, COLOR_GREY,"You don't have enough money to place the bet.");
- }
- }
- }
- }
- }
- return 1;
- }*/
- forward HorseTimer(playerid);
- public HorseTimer(playerid)
- {
- TogglePlayerControllable(playerid, 1);
- new
- a = PlayerInfo[playerid][pHorse];
- switch (a)
- {
- case 1: // If the player selected the first horse
- {
- new Bet1 = random(3); // The chance
- if (Bet1 == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Congratulations, Your horse won the race.");
- SendClientMessage(playerid, COLOR_GREY, "You won $40000.");
- GivePlayerCash(playerid, 40000);
- PlayerInfo[playerid][pHorse] = 0;
- Businesses[InBusiness(playerid)][bSafeBalance] -= 40000; // Removes the money from the biz
- SaveBusiness(InBusiness(playerid));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your horse lost the race.");
- PlayerInfo[playerid][pHorse] = 0;
- }
- }
- case 2:
- {
- new Bet1 = random(3); // The chance
- if (Bet1 == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Congratulations, Your horse won the race.");
- SendClientMessage(playerid, COLOR_GREY, "You won $70000.");
- GivePlayerCash(playerid, 70000);
- PlayerInfo[playerid][pHorse] = 0;
- Businesses[InBusiness(playerid)][bSafeBalance] -= 70000; // Removes the money from the biz
- SaveBusiness(InBusiness(playerid));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your horse lost the race.");
- PlayerInfo[playerid][pHorse] = 0;
- }
- }
- case 3:
- {
- new Bet1 = random(3); // The chance
- if (Bet1 == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Congratulations, Your horse won the race.");
- SendClientMessage(playerid, COLOR_GREY, "You won $101000.");
- GivePlayerCash(playerid, 101000);
- PlayerInfo[playerid][pHorse] = 0;
- Businesses[InBusiness(playerid)][bSafeBalance] -= 101000; // Removes the money from the biz
- SaveBusiness(InBusiness(playerid));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your horse lost the race.");
- PlayerInfo[playerid][pHorse] = 0;
- }
- }
- case 4:
- {
- new Bet1 = random(3); // The chance
- if (Bet1 == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Congratulations, Your horse won the race.");
- SendClientMessage(playerid, COLOR_GREY, "You won $123000.");
- GivePlayerCash(playerid, 123000);
- PlayerInfo[playerid][pHorse] = 0;
- Businesses[InBusiness(playerid)][bSafeBalance] -= 123000; // Removes the money from the biz
- SaveBusiness(InBusiness(playerid));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your horse lost the race.");
- PlayerInfo[playerid][pHorse] = 0;
- }
- }
- case 5:
- {
- new Bet1 = random(3); // The chance
- if (Bet1 == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Congratulations, Your horse won the race.");
- SendClientMessage(playerid, COLOR_GREY, "You won $161000.");
- GivePlayerCash(playerid, 161000);
- PlayerInfo[playerid][pHorse] = 0;
- Businesses[InBusiness(playerid)][bSafeBalance] -= 161000; // Removes the money from the biz
- SaveBusiness(InBusiness(playerid));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your horse lost the race.");
- PlayerInfo[playerid][pHorse] = 0;
- }
- }
- case 6:
- {
- new Bet1 = random(3); // The chance
- if (Bet1 == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Congratulations, Your horse won the race.");
- SendClientMessage(playerid, COLOR_GREY, "You won $330000.");
- GivePlayerCash(playerid, 330000);
- PlayerInfo[playerid][pHorse] = 0;
- Businesses[InBusiness(playerid)][bSafeBalance] -= 330000; // Removes the money from the biz
- SaveBusiness(InBusiness(playerid));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your horse lost the race.");
- PlayerInfo[playerid][pHorse] = 0;
- }
- }
- case 7:
- {
- new Bet1 = random(3); // The chance
- if (Bet1 == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Congratulations, Your horse won the race.");
- SendClientMessage(playerid, COLOR_GREY, "You won $935000.");
- GivePlayerCash(playerid, 935000);
- PlayerInfo[playerid][pHorse] = 0;
- Businesses[InBusiness(playerid)][bSafeBalance] -= 935000; // Removes the money from the biz
- SaveBusiness(InBusiness(playerid));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your horse lost the race.");
- PlayerInfo[playerid][pHorse] = 0;
- }
- }
- case 8:
- {
- new Bet1 = random(3); // The chance
- if (Bet1 == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Congratulations, Your horse won the race.");
- SendClientMessage(playerid, COLOR_GREY, "You won $1900000.");
- GivePlayerCash(playerid, 1900000);
- PlayerInfo[playerid][pHorse] = 0;
- Businesses[InBusiness(playerid)][bSafeBalance] -= 1900000; // Removes the money from the biz
- SaveBusiness(InBusiness(playerid));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your horse lost the race.");
- PlayerInfo[playerid][pHorse] = 0;
- }
- }
- case 9:
- {
- new Bet1 = random(5); // The chance
- if (Bet1 == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Congratulations, Your horse won the race.");
- SendClientMessage(playerid, COLOR_GREY, "You won $22000000.");
- GivePlayerCash(playerid, 22000000);
- PlayerInfo[playerid][pHorse] = 0;
- Businesses[InBusiness(playerid)][bSafeBalance] -= 22000000; // Removes the money from the biz
- SaveBusiness(InBusiness(playerid));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your horse lost the race.");
- PlayerInfo[playerid][pHorse] = 0;
- }
- }
- }
- return 1;
- }
|