Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Prohibido TOTALMENTE el Robo de Créditos o la
- Publicación de este FILTERSCRIPT sin Mi Permiso.
- SIMPLE FILTERSCRIPT --> Simple Sistema de Lotería BASE
- CREDITOS: OTACON ;)
- NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
- */
- // ========== [ -|- FUNCION -|- ] ==========
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #define ID_LOTERIA (1) //El id del menu de la loteria.
- #define VALOR_TICKET (500) //El valor el ticket.
- #define TIEMPO_LOTERIA (30) //cada 30 Minutos sorteara.
- #define PREMIO_INICIAL (100) //el pozo inicial de la loteria, se multiplicada segun la cantidad de ticket's vendidos.
- #define POZO_LIMITE (200) //el limite para ke volvera al pozo inicial.
- new NumeroLoteria[MAX_PLAYERS];
- new PozoLoteria=PREMIO_INICIAL;
- new bool:TicketLoteria[MAX_PLAYERS]=false;
- new MatarLoteria;
- new PozoLoteriaLimite=0;
- public OnFilterScriptInit() {
- MatarLoteria=SetTimer("Loteria", TIEMPO_LOTERIA*60000, true);
- return true;
- }
- public OnFilterScriptExit() {
- KillTimer(MatarLoteria);
- return true;
- }
- COMMAND:ticket(playerid, params[]) {
- ShowPlayerDialog(playerid,ID_LOTERIA+0, DIALOG_STYLE_INPUT, "Simple Sistema de Lotería BASE", "Introduzca un número entre 0 y 100:", "Comprar", "Salir");
- return true;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
- new str[128];
- switch(dialogid) {
- case ID_LOTERIA+0: {
- if(response) {
- if(sscanf(inputtext, "d", inputtext[0])) return ShowPlayerDialog(playerid,ID_LOTERIA+0, DIALOG_STYLE_INPUT, "Simple Sistema de Lotería BASE", "Introduzca un número entre 0 y 100: \nValor numérico que se permite", "Comprar", "Salir");
- if(inputtext[0]<0 || inputtext[0]>100) return ShowPlayerDialog(playerid,ID_LOTERIA+0, DIALOG_STYLE_INPUT, "Simple Sistema de Lotería BASE", "Introduzca un número entre 0 y 100: \nno ir por debajo de 0 o por encima de 100", "Comprar", "Salir");
- if(TicketLoteria[playerid]==true) return ShowPlayerDialog(playerid,ID_LOTERIA+0, DIALOG_STYLE_INPUT, "Simple Sistema de Lotería BASE", "Introduzca un número entre 0 y 100: \nya ha comprado un billete", "Comprar", "Salir");
- if(GetPlayerMoney(playerid)<VALOR_TICKET) return ShowPlayerDialog(playerid,ID_LOTERIA+0, DIALOG_STYLE_INPUT, "Simple Sistema de Lotería BASE", "Introduzca un número entre 0 y 100: \nno tienen suficiente dinero para comprar un billete", "Comprar", "Salir");
- NumeroLoteria[playerid]=inputtext[0];
- TicketLoteria[playerid]=true;
- GivePlayerMoney(playerid,(0-VALOR_TICKET));
- PozoLoteriaLimite++;
- format(str, sizeof(str), "Ha comprado un billete de lotería con el número %d, a un valor de %d dólares.", NumeroLoteria[playerid], VALOR_TICKET);
- SendClientMessage(playerid, -1, str);
- new count=0;
- for(new i=0; i<GetMaxPlayers(); i++) {
- if(!IsPlayerConnected(i)) continue;
- if(IsPlayerConnected(i) && TicketLoteria[i]==true) { count++; break; }
- }
- if(count==POZO_LIMITE) PozoLoteriaLimite=0;
- }
- }
- }
- return false;
- }
- forward Loteria();
- public Loteria() {
- new str[200];
- for(new player=0; player<GetMaxPlayers(); player++) {
- if(!IsPlayerConnected(player) || TicketLoteria[player]!=true) continue;
- if(IsPlayerConnected(player) && TicketLoteria[player]!=false) {
- new numero=random(100);
- if(NumeroLoteria[player]==numero) {
- format(str, sizeof(str), "~y~Loteria Sorteada~n~~w~Numero sorteado fue el ~g~%d~w~~n~con a pozo de ~g~$%d~w~ Dolares.~n~~g~Haz ganado la loteria, Felicitaciones!.", numero, PozoLoteria*PozoLoteriaLimite);
- GameTextForPlayer(player, str, 15*1000, 3);
- GivePlayerMoney(player,(0+PozoLoteria*PozoLoteriaLimite));
- NumeroLoteria[player]=0;
- TicketLoteria[player]=false;
- } else {
- format(str, sizeof(str), "~y~Loteria Sorteada~n~~w~Numero sorteado fue el ~g~%d~w~~n~con un pozo de ~g~$%d~w~ Dolares.~n~~r~Haz perdido la loteria, Suerte!.", numero, PozoLoteria*PozoLoteriaLimite);
- GameTextForPlayer(player, str, 15*1000, 3);
- NumeroLoteria[player]=0;
- TicketLoteria[player]=false;
- }
- }
- }
- }
- // ========== [ -|- FUNCION -|- ] ==========
- /*
- Prohibido TOTALMENTE el Robo de Créditos o la
- Publicación de este FILTERSCRIPT sin Mi Permiso.
- SIMPLE FILTERSCRIPT --> Sistema de Lotería BASE
- CREDITOS: OTACON ;)
- NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement