Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define MAXPLAYERS 40
- #define CorVermelho 0xE31919FF
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" [FS] Sistema de Prêmios\n");
- print(" Desenvolvido por Shickcard\n");
- print("--------------------------------------\n");
- CreatePickup(1276, 1, 1960.5267,1342.8904,15.3746, 0);
- Create3DTextLabel("Prêmio\nPressione 'F' para pegar seu presente!", 0x9400D3FF, 1960.5267,1342.8904,15.3746, 40.0, 0);
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" [FS] Sistema de Prêmios\n");
- print(" Desenvolvido por Shickcard\n");
- print("----------------------------------\n");
- }
- new SPremio[MAXPLAYERS];
- new PremioBloqueado;
- new Random;
- public OnPlayerConnect(playerid)
- {
- SPremio[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SPremio[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp("/bloquearpremios", cmdtext, true) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, CorVermelho, "(!) {FFFFFF}Você não é Admin!");
- if(PremioBloqueado == 0)
- {
- PremioBloqueado = 1;
- SendClientMessage(playerid, CorVermelho, "(!) {FFFFFF}Os Prêmios foram bloqueados com sucesso!");
- }
- else if(PremioBloqueado == 1)
- {
- PremioBloqueado = 0;
- SendClientMessage(playerid, CorVermelho, "(!) {FFFFFF}Os Prêmios foram desbloqueados com sucesso!");
- }
- return true;
- }
- if(strcmp("/creditosfs", cmdtext, true) == 0)
- {
- SendClientMessage(playerid, 0xFFD700FF, "~. Créditos [FS] .~");
- SendClientMessage(playerid, 0xEE7621FF, "- [KoS]Shickcard");
- return true;
- }
- return 0;
- }
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz, Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new string[128];
- if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if(IsPlayerInRangeOfPoint(playerid, 7.0, 1960.5267,1342.8904,15.3746))
- {
- new Dinheiro = 1000 + random(10000);
- if(SPremio[playerid] == 1) return SendClientMessage(playerid, -1, "Você já pegou seu prêmio no intervalo de 5 minutos!");
- if(PremioBloqueado != 1) return SendClientMessage(playerid, -1, "Prêmios bloqueados!");
- Random = random(14);
- if(Random == 0)
- {
- GivePlayerWeapon(playerid, 35, 999);
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 Bazuca", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- SetTimerEx("Bazuca", 300000, false, "playerid", playerid);
- }
- if(Random == 1)
- {
- GivePlayerMoney(playerid, Dinheiro);
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}$%d", pNome(playerid), Dinheiro);
- SendClientMessageToAll(CorVermelho ,string);
- }
- else if(Random == 2)
- {
- SetPlayerHealth(playerid, 100);
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}100 de Health", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- }
- else if(Random == 3)
- {
- SetPlayerArmour(playerid, 100);
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}100 de Colete", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- }
- else if(Random == 4)
- {
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT,".:: Prêmio - Veículo ::.","Seu prêmio foi um veículo insira o modelo na box:","Spawnar","Cancelar");
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 vale veículo", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- }
- else if(Random == 5)
- {
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT,".:: Prêmio - Armas ::.","Seu prêmio foi uma arma insira o modelo na box:","Armar-se","Cancelar");
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 arma", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- }
- else if(Random == 6)
- {
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 100);
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}100 de Health e 100 de Colete", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- }
- else if(Random == 7)
- {
- SetPlayerSpecialAction(playerid, 2);
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 Jetpack", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- }
- else if(Random == 8)
- {
- SetPlayerHealth(playerid, 99999);
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 vale invencibilidade por 10min", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- SetTimerEx("Invencivel", 600000, false, "i", playerid);
- }
- else if(Random == 9)
- {
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 tapa", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- new Float:pX, Float:pY, Float:pZ;
- GetPlayerPos(playerid, pX, pY, pZ);
- SetPlayerPos(playerid, pX, pY, pZ+12);
- }
- else if(Random == 10)
- {
- new Float:bX, Float:bY, Float:bZ;
- GetPlayerPos(playerid, bX, bY, bZ);
- CreateExplosion(bX, bY , bZ+3, 1, 3);
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 explosão", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- }
- else if(Random == 11)
- {
- ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT,".:: Prêmio - Spec ::.","Seu prêmio foi ficar spec em um player por 1 min, Insira o ID do player e aperte em 'Spec' :","Spec","Cancelar");
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 spec", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- }
- else if(Random == 12)
- {
- SetPlayerDrunkLevel(playerid, 5000);
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 minuto alcoolatra", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- SetTimerEx("MinAlcoolatra", 60000, false, "i", playerid);
- }
- else if(Random == 13)
- {
- SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 Score", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- }
- else if(Random == 14)
- {
- ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT,".:: Prêmio - Hora ::.","Seu prêmio foi ficar setar o seu horário no servidor :","Setar","Cancelar");
- format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}setar horário", pNome(playerid));
- SendClientMessageToAll(CorVermelho ,string);
- }
- SPremio[playerid] = 1;
- SetTimerEx("PremiosBlockedS", 300000, false, "i", playerid);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new string[65];
- if(dialogid == 1)
- {
- if(response)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- vehicleid = CreateVehicle(strval(inputtext), 1955.4830,1343.2509,15.3746, 40.5183, 1, 1, -1);
- PutPlayerInVehicle(playerid, vehicleid, 0);
- format(string, sizeof(string), "Você escolheu como veículo o modelo %d, Parabéns pela escolha!", strval(inputtext));
- SendClientMessage(playerid, CorVermelho, string);
- }
- else if(!response) return SendClientMessage(playerid, CorVermelho, "Você não quis resgatar um veículo!");
- }
- if(dialogid == 2)
- {
- if(response)
- {
- GivePlayerWeapon(playerid, strval(inputtext), 999);
- format(string, sizeof(string), "Você escolheu a arma modelo %d, Parabéns pela escolha!", strval(inputtext));
- SendClientMessage(playerid, CorVermelho, string);
- }
- else if(!response) return SendClientMessage(playerid, CorVermelho, "Você não quis resgatar uma arma!");
- }
- if(dialogid == 3)
- {
- if(response)
- {
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, strval(inputtext));
- SetTimer("AcabouSpec", 60000, false);
- }
- else if(!response) return SendClientMessage(playerid, CorVermelho, "Você não quis ficar de spec em um player!");
- }
- if(dialogid == 4)
- {
- if(response)
- {
- SetPlayerTime(playerid, strval(inputtext) ,0);
- format(string, sizeof(string), "Você setou a hora para %d:00, Seu horário foi setado!", strval(inputtext));
- SendClientMessage(playerid, CorVermelho, string);
- }
- else if(!response) return SendClientMessage(playerid, CorVermelho, "Você não quis setar a hora!");
- }
- return 1;
- }
- forward Invencivel(playerid);
- public Invencivel(playerid)
- {
- SendClientMessage(playerid, CorVermelho, "Seu estado de invencibilidade se esgotou!");
- SetPlayerHealth(playerid, 100);
- return 1;
- }
- forward PremiosBlockedS(playerid);
- public PremiosBlockedS(playerid)
- {
- SPremio[playerid] = 0;
- SendClientMessage(playerid, 0x87CEFAFF, "Você já pode pegar outro prêmio!");
- return 1;
- }
- forward AcabouSpec(playerid);
- public AcabouSpec(playerid)
- {
- TogglePlayerSpectating(playerid, 0);
- SendClientMessage(playerid, CorVermelho, "Seu estado de spec se esgotou!");
- return 1;
- }
- forward MinAlcoolatra(playerid);
- public MinAlcoolatra(playerid)
- {
- SendClientMessage(playerid, CorVermelho, "Seu minuto alcoolatra acabou =(");
- SetPlayerDrunkLevel(playerid, 0);
- return 1;
- }
- forward Bazuca(playerid);
- public Bazuca(playerid)
- {
- GivePlayerWeapon(playerid, 35, 0);
- SendClientMessage(playerid, CorVermelho, "Sua bazuca acabou e.e");
- return 1;
- }
- stock pNome(playerid)
- {
- new nome[25];
- GetPlayerName(playerid, nome, sizeof(nome));
- return nome;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement