Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- #include <zcmd>
- #include <Dini>
- #include <sscanf>
- //New's
- new Text:Textdraw1[MAX_PLAYERS];
- new Text:Textdraw0[MAX_PLAYERS];
- new Gold[MAX_PLAYERS];
- new tGold[MAX_PLAYERS];
- #define PosPremios 1214.8124,-1675.5703,11.7969
- #define DIALOG_PREMIOS 2095
- public OnFilterScriptInit()
- {
- print("\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
- print("=[FS] Sistema de Gold - v2.0 [CARREGADO]=");
- print("=-=-=-=-=-=[ By: Rhay_Fither ]=-=-=-=-=-=");
- print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
- if(!fexist("Golds.txt")) dini_Create("Golds.txt");
- AddStaticPickup(1247,1,PosPremios);
- Create3DTextLabel("{FFFF00}Premios Gold\n{87CEEB}Aperte 'F' ou 'Enter'", -1, PosPremios, 30.0, 0);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(dini_Isset("Golds.txt",PlayerName(playerid))) Gold[playerid] = (playerid,dini_Int("Golds.txt",PlayerName(playerid)));
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- dini_IntSet("Golds.txt",PlayerName(playerid),Gold[playerid]);
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if ((newkeys == KEY_SECONDARY_ATTACK)) // Key F / Enter
- {
- cmd_premio(playerid);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- //Timer's
- SetTimerEx("Timer",60000,true,"i",playerid); //TROQUE O '10000' PELO TEMPO QUE ELE GANHA [0/3], NO CASO AQUI É 1 MINUTO, NA TEXTDRAWN TEM 0/3, E QUANDO CHEGAR A 3 MINUTOS GANHA 1 GOLD
- SetTimer("ActualizarTextDraws",true,60000);
- //Gold
- Textdraw0[playerid] = TextDrawCreate(551.000000, 291.000000, "Gold: 0");
- TextDrawBackgroundColor(Textdraw0[playerid], 255);
- TextDrawFont(Textdraw0[playerid], 3);
- TextDrawLetterSize(Textdraw0[playerid], 0.500000, 1.000000);
- TextDrawColor(Textdraw0[playerid], 65535);
- TextDrawSetOutline(Textdraw0[playerid], 0);
- TextDrawSetProportional(Textdraw0[playerid], 1);
- TextDrawSetShadow(Textdraw0[playerid], 1);
- //tGold
- Textdraw1[playerid] = TextDrawCreate(551.000000, 268.000000, "0/3");
- TextDrawBackgroundColor(Textdraw1[playerid], 255);
- TextDrawFont(Textdraw1[playerid], 1);
- TextDrawLetterSize(Textdraw1[playerid], 0.280000, 2.100000);
- TextDrawColor(Textdraw1[playerid], -16776961);
- TextDrawSetOutline(Textdraw1[playerid], 0);
- TextDrawSetProportional(Textdraw1[playerid], 1);
- TextDrawSetShadow(Textdraw1[playerid], 1);
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- DisablePlayerCheckpoint(playerid); // Destruirá ao Ficar em Cima Dele.
- GameTextForPlayer(playerid, "~y~] Premios Gold ]~n~~w~Aperte '~b~F~w~' Para Abrir o Menu de Premios", 5000, 3);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_PREMIOS)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(Gold[playerid] >= 10)
- {
- Gold[playerid] -= 10;
- new String[128];
- GivePlayerMoney(playerid, 1000);
- SendClientMessage(playerid, -1, "{7FFFD4} Você ganhou {7CFC00}R${AFEEEE} 1000,00");
- format(String, sizeof(String), "{7FFFD4}Você Gastou {AFEEEE}10{7FFFD4} Gold's, e agora tem {AFEEEE}%d{7FFFD4} de Gold!", Gold[playerid]);
- SendClientMessage(playerid, -1, String);
- }
- else
- {
- SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}Você não tem 10 Gold's!");
- }
- }
- else if (listitem == 1)
- {
- if(Gold[playerid] >= 20)
- {
- Gold[playerid] -= 20;
- new String[128];
- GivePlayerMoney(playerid, 2000);
- SendClientMessage(playerid, -1, "{7FFFD4} Você ganhou {7CFC00}R${AFEEEE} 2000,00");
- format(String, sizeof(String), "{7FFFD4}Você Gastou {AFEEEE}20{7FFFD4} Gold's, e agora tem {AFEEEE}%d{7FFFD4} de Gold!", Gold[playerid]);
- SendClientMessage(playerid, -1, String);
- }
- else
- {
- SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}Você não tem 20 Gold's!");
- }
- }
- else if (listitem == 2)
- {
- if(Gold[playerid] >= 50)
- {
- Gold[playerid] -= 50;
- new String[128];
- GivePlayerMoney(playerid, 10000);
- SendClientMessage(playerid, -1, "{7FFFD4} Você ganhou {7CFC00}R${AFEEEE} 10000,00");
- format(String, sizeof(String), "{7FFFD4}Você Gastou {AFEEEE}50{7FFFD4} Gold's, e agora tem {AFEEEE}%d{7FFFD4} de Gold!", Gold[playerid]);
- SendClientMessage(playerid, -1, String);
- }
- else
- {
- SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}Você não tem 50 Gold's!");
- }
- }
- else if (listitem == 3)
- {
- if(Gold[playerid] >= 100)
- {
- Gold[playerid] -= 100;
- new String[128];
- GivePlayerMoney(playerid, 30000);
- SendClientMessage(playerid, -1, "{7FFFD4} Você ganhou {7CFC00}R${AFEEEE} 30000,00");
- format(String, sizeof(String), "{7FFFD4}Você Gastou {AFEEEE}100{7FFFD4} Gold's, e agora tem {AFEEEE}%d{7FFFD4} de Gold!", Gold[playerid]);
- SendClientMessage(playerid, -1, String);
- }
- else
- {
- SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}Você não tem 100 Gold's!");
- }
- }
- else if (listitem == 4)
- {
- if(Gold[playerid] >= 500)
- {
- Gold[playerid] -= 500;
- new String[128];
- GivePlayerMoney(playerid, 200000);
- SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
- SendClientMessage(playerid, -1, "{7FFFD4} Você ganhou {7CFC00}R${AFEEEE} 200000,00{7FFFD4} e {AFEEEE}1{7FFFD4} Nível");
- format(String, sizeof(String), "{7FFFD4}Você Gastou {AFEEEE}500{7FFFD4} Gold's, e agora tem {AFEEEE}%d{7FFFD4} de Gold!", Gold[playerid]);
- SendClientMessage(playerid, -1, String);
- }
- else
- {
- SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}Você não tem 500 Gold's!");
- }
- }
- else if (listitem == 5)
- {
- if(Gold[playerid] >= 750)
- {
- Gold[playerid] -= 750;
- new String[128];
- GivePlayerMoney(playerid, 500000);
- SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
- SendClientMessage(playerid, -1, "{7FFFD4} Você ganhou {7CFC00}R${AFEEEE} 500000,00{7FFFD4} e {AFEEEE}3{7FFFD4} Níveis");
- format(String, sizeof(String), "{7FFFD4}Você Gastou {AFEEEE}750{7FFFD4} Gold's, e agora tem {AFEEEE}%d{7FFFD4} de Gold!", Gold[playerid]);
- SendClientMessage(playerid, -1, String);
- }
- else
- {
- SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}Você não tem 750 Gold's!");
- }
- }
- else if (listitem == 6)
- {
- if(Gold[playerid] >= 1000)
- {
- Gold[playerid] -= 1000;
- new String[128];
- GivePlayerMoney(playerid, 1000000);
- SetPlayerScore(playerid, GetPlayerScore(playerid) + 10);
- SendClientMessage(playerid, -1, "{7FFFD4} Você ganhou {7CFC00}R${AFEEEE} 1.000.000,00{7FFFD4} e {AFEEEE}10{7FFFD4} Níveis");
- format(String, sizeof(String), "{7FFFD4}Você Gastou {AFEEEE}1000{7FFFD4} Gold's, e agora tem {AFEEEE}%d{7FFFD4} de Gold!", Gold[playerid]);
- SendClientMessage(playerid, -1, String);
- }
- else
- {
- SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}Você não tem 1000 Gold's!");
- }
- }
- }
- return 1;
- }
- return 1;
- }
- //Comandos
- CMD:retirargold(playerid, params[])
- {
- new id, QuantiadeGold;
- if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FFA500}[ERRO]{E0FFFF}Você não é administrador!");
- if (sscanf(params, "ud", id, QuantiadeGold)) return SendClientMessage(playerid, -1, "{FFA500}[ERRO]{E0FFFF} USE: /retirargold [ID] [GOLD]");
- if (!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "{FFA500}[ERRO]{E0FFFF} O Player não está connectado!");
- Gold[id] -= QuantiadeGold;
- return 1;
- }
- CMD:premio(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, PosPremios))
- {
- new ListaPremios[4000];
- strcat(ListaPremios,"{7CFC00}R${F8F8FF} 1.000,00{FFFF00} [10 Gold's]\n");
- strcat(ListaPremios,"{7CFC00}R${F8F8FF} 2.000,00{FFFF00} [20 Gold's]\n");
- strcat(ListaPremios,"{7CFC00}R${F8F8FF} 10.000,00{FFFF00} [50 Gold's]\n");
- strcat(ListaPremios,"{7CFC00}R${F8F8FF} 30.000,00{FFFF00} [100 Gold's]\n");
- strcat(ListaPremios,"{7CFC00}R${F8F8FF} 200.000,00 + 1 Nível{FFFF00} [500 Gold's]\n");
- strcat(ListaPremios,"{7CFC00}R${F8F8FF} 500.000,00 + 3 Níveis{FFFF00} [750 Gold's]\n");
- strcat(ListaPremios,"{7CFC00}R${F8F8FF} 1.000.000,00 + 10 Níveis{FFFF00} [1000 Gold's]");
- ShowPlayerDialog(playerid, DIALOG_PREMIOS, DIALOG_STYLE_LIST, "Premios Gold", ListaPremios, "Selecionar", "Fechar");
- }
- return 1;
- }
- CMD:ajudagold(playerid)
- {
- new AjudaPlayer[1000];
- new AjudaAdmin[1000];
- if (IsPlayerAdmin(playerid))
- {
- strcat(AjudaAdmin,"{FFD700}/dargold {FFFFFF}- {FFEFD5}Para dar Gold ao um Player.\n");
- strcat(AjudaAdmin,"{FFD700}/setargold {FFFFFF}- {FFEFD5}Para setar o Gold de um Player\n");
- strcat(AjudaAdmin,"{FFD700}/retirargold {FFFFFF}- {FFEFD5}Para retirar Gold de um Player.");
- ShowPlayerDialog(playerid, 3442, DIALOG_STYLE_MSGBOX, "{FFD700}Ajuda Gold",AjudaAdmin, "Fechar", "");
- }
- else
- {
- strcat(AjudaPlayer,"{FFA500}Informações:\n");
- strcat(AjudaPlayer,"{7FFFD4}A cada {AFEEEE}3 {7FFFD4}Minutos você ganha um Gold.\n");
- strcat(AjudaPlayer,"{7FFFD4}Você pode pegar premios em um local, digite: {FFD700}/gpsgold {7FFFD4} para encontra-lo\n");
- strcat(AjudaPlayer,"{FFA500} \n");
- strcat(AjudaPlayer,"{FFA500}Comandos:\n");
- strcat(AjudaPlayer,"{FFD700}/meugold {FFFFFF}- {FFEFD5}Para ver a Quantidade de Gold que você tem.\n");
- strcat(AjudaPlayer,"{FFD700}/gpsgold {FFFFFF}- {FFEFD5}Local onde se pega premios (Dependendo de Quantos Gold's Você Tem).\n");
- ShowPlayerDialog(playerid, 3442, DIALOG_STYLE_MSGBOX, "{FFD700}Ajuda Gold",AjudaPlayer, "Fechar", "");
- }
- return 1;
- }
- CMD:gpsgold(playerid)
- {
- SetPlayerCheckpoint(playerid, PosPremios,8.0);//Checkpoint Onde aparecerar
- SendClientMessage(playerid, -1, "{FFD700} Um ponto {FFA500}vermelho {FFD700}foi marcado no mapa, vá até ele!");
- return 1;
- }
- CMD:meugold(playerid)
- {
- new String[128];
- new MyGold;
- MyGold = Gold[playerid];
- format(String, sizeof(String), "{7FFFD4}Você tem {AFEEEE}%d{7FFFD4} de Gold!", MyGold);
- SendClientMessage(playerid, -1, String);
- return 1;
- }
- CMD:setargold(playerid, params[])
- {
- new id, dargold;
- if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}Você não é administrador!");
- if (sscanf(params, "ud", id, dargold)) return SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}USE: /setargold [ID] [GOLD]");
- if (!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF} O Player não está connectado!");
- Gold[id] = dargold;
- return 1;
- }
- CMD:dargold(playerid, params[])
- {
- new ID, GoldQuantia;
- if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}Você não é administrador!");
- if (sscanf(params, "ud", ID, GoldQuantia)) return SendClientMessage(playerid, -1, "{FFA500}[ERRO] {E0FFFF}USE: /dargold [ID] [GOLD]");
- if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "{FFA500}[ERRO]{E0FFFF} O Player não está connectado!");
- Gold[ID] += GoldQuantia;
- return 1;
- }
- //Stock's
- stock PlayerName(playerid)
- {
- new PlayerNameGold[MAX_PLAYERS];
- GetPlayerName(playerid, PlayerNameGold, MAX_PLAYERS);
- return PlayerNameGold;
- }
- //Forward's
- forward ActualizarTextDraws();
- public ActualizarTextDraws()
- {
- new String[100];
- for(new playerid = 0; playerid < MAX_PLAYERS; playerid ++)
- {
- if(IsPlayerConnected(playerid))
- {
- format(String, sizeof(String), "Gold: %d", Gold[playerid]);
- TextDrawSetString(Textdraw0[playerid], String);
- TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
- format(String, sizeof(String), " %d / 3", tGold[playerid]);
- TextDrawSetString(Textdraw1[playerid], String);
- TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
- }
- }
- }
- forward Timer(playerid);
- public Timer(playerid)
- {
- tGold[playerid]++;
- if(tGold[playerid] == 3)
- {
- Gold[playerid]++;
- SendClientMessage(playerid,-1,"{FF3D3D}[INFO]{FFFFFF} Parabéns, você ganhou 1 Gold!");
- tGold[playerid] = 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement