Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #include < sscanf2 >
- #if defined FILTERSCRIPT
- #define Msg SendClientMessage
- #define Spd ShowPlayerDialog
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~[CORES]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- #define VVV 0xFF030FFF
- #define ZZZ 0x00C2ECFF
- #define AAA 0xFFFF00FF
- #define CCC 0xCECECEFF
- #define LLL 0xFFA500FF
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~[VARIAVES]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- new bool:apostando[MAX_PLAYERS],Str[500];
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~[FORWARDE]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- forward Aposta(playerid);
- public OnFilterScriptInit()
- {
- print("\n ======================================================");
- print(" | |");
- print(" | FilterScript Aposta DOF2 Versao Basica |");
- print(" | |");
- print(" | * Criador:SkayBr * |");
- print(" | |");
- print(" ======================================================\n");
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[MAPEAMENTO]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- new MapaApostar[15];
- MapaApostar[0] = CreateObject(19452, 1911.4056, -1723.7335, 12.3449, 0.0000, 88.4999, 0.0000);
- MapaApostar[1] = CreateObject(19452, 1914.8931, -1723.7335, 12.4362, 0.0000, 88.4999, 0.0000);
- MapaApostar[2] = CreateObject(19452, 1909.6151, -1723.7335, 13.5418, 0.0000, -0.2000, 0.0000);
- MapaApostar[3] = CreateObject(970, 1914.5881, -1728.5179, 12.6890, 0.0000, 0.0000, 0.0000);
- MapaApostar[4] = CreateObject(970, 1910.4577, -1728.5179, 12.6890, 0.0000, 0.0000, 0.0000);
- MapaApostar[5] = CreateObject(970, 1914.5881, -1718.9240, 12.6890, 0.0000, 0.0000, 0.0000);
- MapaApostar[6] = CreateObject(970, 1910.4581, -1718.9240, 12.6890, 0.0000, 0.0000, 0.0000);
- MapaApostar[7] = CreateObject(970, 1916.6401, -1721.0058, 12.6890, 0.0000, 0.0000, -89.3999);
- MapaApostar[8] = CreateObject(970, 1916.6971, -1726.4163, 12.6890, 0.0000, 0.0000, -89.3999);
- MapaApostar[9] = CreateObject(1824, 1914.6516, -1727.1536, 13.0192, 0.0000, 0.0000, 0.0000);
- MapaApostar[10] = CreateObject(1895, 1909.7996, -1725.9998, 14.1395, 0.0000, -0.3999, 89.8999);
- MapaApostar[11] = CreateObject(2779, 1910.1230, -1721.4331, 12.2786, 0.0000, 0.0000, 88.0000);
- MapaApostar[12] = CreateObject(629, 1918.2137, -1729.0646, 12.4425, 0.0000, 0.0000, 0.0000);
- MapaApostar[13] = CreateObject(629, 1918.2137, -1718.4531, 12.4425, 0.0000, 0.0000, 0.0000);
- MapaApostar[14] = CreateObject(19360, 1909.6633, -1722.8590, 12.6609, 0.0000, 0.0000, 0.0000);
- SetObjectMaterialText(MapaApostar[14], "PORTAL SAMP", 0, 90, "Arial", 24, 1, 0xFFFFFFFF, 0x0, 0);
- Create3DTextLabel("Use:/apostar", -1, 1910.9401,-1721.4272,13.4186, 20,0);
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 1917.0459,-1723.6849,13.4939)) return DisablePlayerCheckpoint(playerid);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Msg(playerid,AAA,"[FS] • Aposta ON");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- CMD:apostar(playerid, params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1910.9401,-1721.4272,13.4186)) return Msg(playerid,CCC, "Voce nao enta no local de apostas, use: /laposta");
- if(apostando[playerid] == true) return Msg(playerid,CCC, "[Aposta] • Espere algums segundos para apostar denovo!");
- new numerosorteado = RandomEx(0, 6), numeroapostado, dinheiroapostado;
- if(sscanf(params, "dd", numeroapostado, dinheiroapostado)) return Msg(playerid, CCC, "Use: /apostar [Numero] [Quantia]");
- if(numeroapostado > 6) return Msg(playerid, CCC, "[Aposta] • Numero para aposta 0 a 6");
- if(dinheiroapostado < 1 || dinheiroapostado > 50000) return Msg(playerid, CCC, "[Aposta] • Quantia maxima de aposta: R$50.000");
- if(GetPlayerMoney(playerid) < dinheiroapostado) return Msg(playerid, CCC, "[Aposta] • Voce nao tem dinherio suficiente para fazer essa aposta!");
- SetTimerEx("Aposta", 5000, false, "i", playerid);
- format(Str, 500, "[Aposta] • Voce apostou {DCDCDC}R${32CD32}%s{00C2EC} no Numero %d, aguarde o sorteio", ConvertReal(dinheiroapostado), numeroapostado);
- SendClientMessage(playerid, ZZZ, Str);
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- SetPVarInt(playerid, "NumeroApostado", numeroapostado);
- SetPVarInt(playerid, "DinheiroApostado", dinheiroapostado);
- SetPVarInt(playerid, "NumeroSorteado", numerosorteado);
- GivePlayerMoney(playerid, -dinheiroapostado);
- apostando[playerid] = true;
- return 1;
- }
- CMD:laposta(playerid)
- {
- SetPlayerCheckpoint(playerid, 1917.0459,-1723.6849,13.4939, 3.0);
- Msg(playerid, AAA,"[Gps] • Local de aposta localizado no mapa");
- return 1;
- }
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[PUBLIC CRIADA]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- public Aposta(playerid)
- {
- if(GetPVarInt(playerid, "NumeroSorteado") == GetPVarInt(playerid, "NumeroApostado"))
- {
- SetPVarInt(playerid, "DinheiroGanho", GetPVarInt(playerid, "DinheiroApostado") * 5);
- GivePlayerMoney(playerid, GetPVarInt(playerid, "DinheiroApostado") * 5);
- format(Str,sizeof(Str),"[Aposta] • Sortudo {FFFFFF}%s{FFFF00} apostou {DCDCDC}R${32CD32}%s {FFFF00}e ganhou {DCDCDC}R${32CD32}%s",pName(playerid),ConvertReal(GetPVarInt(playerid, "DinheiroApostado")),ConvertReal(GetPVarInt(playerid, "DinheiroGanho")));
- SendClientMessageToAll(AAA,Str);
- format(Str,sizeof(Str),"Voce apostou {DCDCDC}R${32CD32}%s{FFFFFF} no numero {00BFFF}%d{FFFFFF} a ganhou {DCDCDC}R${32CD32}%s\n\n",ConvertReal(GetPVarInt(playerid, "DinheiroApostado")),GetPVarInt(playerid, "NumeroApostado"),ConvertReal(GetPVarInt(playerid, "DinheiroGanho")));
- strcat(Str,"{FFA500}SORTUDO!");
- Spd(playerid,894,0,"APOSTA",Str,"OK","");
- }
- else
- {
- format(Str, sizeof(Str), "[Aposta] • Voce perdeu, o numero sorteado foi %d", GetPVarInt(playerid, "NumeroSorteado"));
- Msg(playerid, LLL, Str);
- }
- apostando[playerid] = false;
- return 1;
- }
- pName(playerid)/*[RESPONVEL POR GUETAR O NOME DO JOgaDOR]*/
- {
- new Nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nome, MAX_PLAYER_NAME);
- return Nome;
- }
- ConvertReal(value, const text[] = ".")/*[RESPONVEL POR CONVERTER O DINHEIRO PARA REAL]*/
- {
- new Var[20];
- format(Var, sizeof(Var), "%d", value);
- for(new X = strlen(Var) - 3; X > 0; X -= 3)
- strins(Var, text, X);
- format(Var, sizeof(Var), "%s", Var);
- return Var;
- }
- static stock RandomEx(minnum = cellmin, maxnum = cellmax)/*[RESPONVEL POR GERAR UM NUMERO ALEATORIO]*/
- return random(maxnum - minnum + 1) + minnum;
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement