rendered paste body#include <a_samp> // #include <core> // #include <float> // #include <file> #include <dudb> // #include <dini> // #include <dutils> #define COLOR_YELLOW 0xFFFF00AA #define COLOR_SYSTEM_PW 0xFFFF33AA // YELLOW (FFFF33) system personal warning (âyou in A bankâ must) #define COLOR_MENU 0xFFFFFFAA // WHITE (FFFFFF) menu's (/help) #define COLOR_SYSTEM_GM 0xFF9966AA // LIGHT ORANGE-TALK (FF9966) system generated general message (âx just the bought four dragons! â) #define GAMBLE_LICENCE 2500000 // #define dcmd (%1, %2, %3) if ((strcmp (%3, â/%1â, true, %2+1) == 0) && (((%3 [%2+1] ==0) && (dcmd_%1 (playerid, "")))|| ((%3 [%2+1] ==32) && (dcmd_%1 (playerid, %3 [%2+2]))))) return 1 #define FILE_SETTINGS âsettings.iniâ #define MAX_3DLOCS 3 new float: casCoords [MAX_3DLOCS] [6] = {// {Xmin, Ymin, Zmin, Xmax, Ymax, Zmax} {1925,1511, 968,2360, 992,4687, 1982,3024, 1067,4122, 995,5211}, // four dragons {2179,5100, 1559,0856, 1000,0, 2281,1492, 1622,9048, 1010,0}, //caligula {1113,6541, - 13,2672, 1000,6718, 1143,2858, 12,4690, 1003,0662} // of talking sand casino}; new float: casSpawn [MAX_3DLOCS] [3] = {{2030,2551, 1007,9247, 10,8203}, // four dragons {2186,8896, 1680,6750, 11,1027}, //caligula {1658,9501, 2255,8767, 10,8203} // of talking sand casino}; new gamblelicence [MAX_PLAYERS]; //new spawned [MAX_PLAYERS]; new logged [MAX_PLAYERS]; new playername [MAX_PLAYER_NAME]; new stringer [256]; new float: X250 [MAX_PLAYERS]; new float: Y250 [MAX_PLAYERS]; new float: Z250 [MAX_PLAYERS]; new isincasino [MAX_PLAYERS]; new currentmoney [MAX_PLAYERS]; new tmps1 [256]; new GameTextForPlayers1 [MAX_PLAYERS] [36]; new GameTextForPlayers2 [MAX_PLAYERS] [36]; new GameTextForPlayersCounter [MAX_PLAYERS]; public OnFilterScriptInit () {//print (â--CASINO GAMBLE--â); Set timers (âCasinoUpdateâ, 1100, 1); return 1; }
public OnFilterScriptExit() {
print("\n |--Fixed By Alex.");
print(" |--Visit www.swat-clan.co.nr.forum\n");
}
public OnPlayerCommandText (playerid, cmdtext []) {new cmd [256]; if (strcmp (cmd,â /gamble ", true) == 0) {// #pragma unused params if (logged [playerid] == 1) {tmps1 = dini_Get (FILE_SETTINGS, âcasinosâ); if (strval (tmps1) == 0) {SendClientMessage (playerid, COLOR_SYSTEM_PW, â* Casinos are not permitted on the server! â); return 1; } GetPlayerName (playerid, playername, sizeof (playername)); if (gamblelicence [playerid] == 1) {SendClientMessage (playerid, COLOR_SYSTEM_PW, â* you have already a GambleLizensâ); return 1; } if (logged [playerid] == 0) {SendClientMessage (playerid, COLOR_SYSTEM_PW, â* please logs you in, in order to play. â); return 1; } if (GetPlayerMoney (playerid) >= 7500) {// TO-DO money scanner update //format (moneyreason, sizeof (moneyreason), â* Money decreased by $%d (old: $%d), because player ID %d bought A gamble licenceâ, GAMBLE_LICENCE, GetPlayerMoney (playerid), playerid); GivePlayerMoney (playerid, -7500); dini_IntSet (udb_encode (playername), âgamblelicenceâ, 1); gamblelicence [playerid] = 1; format (stringer, sizeof (stringers),â-- %s (ID: %d) A gamble licence bought for %d. â, playername, playerid, GAMBLE_LICENCE); printf (stringers); format (stringer, sizeof (stringers), â* %s (ID: %d) A gamble licence bought for %d. â, playername, playerid, GAMBLE_LICENCE); SendClientMessageToAll (COLOR_SYSTEM_GM, stringers); } else {format (stringer, sizeof (stringers), â* you do not have enough money for a Spiellizens. It costs $7500. â, GAMBLE_LICENCE); SendClientMessage (playerid, COLOR_SYSTEM_PW, stringers); return 1; }} return 1; } return 0; } public CasinoUpdate () {tmps1 = dini_Get (FILE_SETTINGS, âcasinosâ); for (new i=0; i<MAX_PLAYERS; i++) {if (IsPlayerConnected (i)) {for (new j=0; j < MAX_3DLOCS; j++) {if (X250 [i] >= casCoords [j] [0] && X250 [i] <= casCoords [j] [3] && Y250 [i] >= casCoords [j] [1] && Y250 [i] <= casCoords [j] [4] && Z250 [i] >= casCoords [j] [2] && Z250 [i] <= casCoords [j] [5]) {if (strval (tmps1) == 1) {if (gamblelicence [i] == 1) {isincasino [i] = 1; currentmoney [i] = GetPlayerMoney (i); return 1; } else {format (GameTextForPlayers1 [i], 36, â~w~DU HASTE NO GAMBLE LICENCEâ); format (GameTextForPlayers2 [i], 36, âPURCHASE a WITH /GAMBLE! â); GameTextForPlayersCounter [i] =5; SetPlayerInterior (i, 0); SetPlayerPos (i, casSpawn [j] [0], casSpawn [j] [1], casSpawn [j] [2]); return 1; }} else {GameTextForPlayer (i, â~w~CASINOS ARE ILLEGAL. EARNED YOUR MONEY DIFFERENTLY! â, 5000.3); SetPlayerInterior (i, 0); SetPlayerPos (i, casSpawn [j] [0], casSpawn [j] [1], casSpawn [j] [2]); return 1; }} else {if (isincasino [i] == 1) {isincasino [i] = 0; }}}}} return 1; }