Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ==================================================================================================================
- Sistema de Fezes v0.3
- Creditos:
- Shickcard: Inventor
- Dr_Pawno: Editor
- MSN:
- Shickcard: shickcard@hotmail.com
- Dr_Pawno: leonardoleal.qm@hotmail.com.br
- SKYPE:
- Shickcard: shickcard
- ==================================================================================================================
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- */
- #include <a_samp>
- #define CORBEMVINDO 0x8080FFAA
- #define CORMORREU 0xFF0000AA
- #define CORCMDS 0x80FF00AA
- #define CORCREDITOS 0xFF00FFAA
- #define CORAVISO 0x408080AA
- #define SHICK 999
- #define ENTRAR_COM_F // Remova esta linha para o jogador não entrar ao apertar 'F'.
- #define SAIR_COM_F // Remova esta linha para o jogador não sair ao apertar 'F'.
- enum Banheiro
- {
- bObjeto,
- Float:bX,
- Float:bY,
- Float:bZ,
- Float:bA,
- bool:bOcupado,
- bool:bSujo,
- bCagadas
- }
- enum Jogador
- {
- Float:jX,
- Float:jY,
- Float:jZ,
- Float:jA,
- jVirtualWorld,
- jFezes,
- jBanheiro,
- bool:jDefecando
- }
- new TimerInfeccaoIntestinal[MAX_PLAYERS];
- new TimerCagarP[MAX_PLAYERS];
- new bool:UsandoCheckpoint[MAX_PLAYERS];
- new Banheiros[15][Banheiro];
- new Jogadores[MAX_PLAYERS][Jogador];
- new ObjetosInt[11];
- forward CarregarBanheiros();
- forward MenosVida(playerid);
- forward TimerCagar(playerid);
- forward Cagando(playerid);
- //------------------------------------------------------------------------------
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" [FS] Sistema de Defecação v0.3a");
- print(" Criador: Shickcard ");
- print("--------------------------------------\n");
- //Interior
- ObjetosInt[0] = CreateObject(3932,1776.72631836,-1118.29406738,1000.43811035,0.00000000,0.00000000,90.00000000);
- ObjetosInt[1] = CreateObject(16000,1775.21960449,-1111.78210449,998.66998291,90.00000000,0.00000000,0.00000000);
- ObjetosInt[2] = CreateObject(5837,1780.02832031,-1120.05700684,1000.39093018,0.00000000,270.00000000,0.00000000);
- ObjetosInt[3] = CreateObject(5837,1773.48596191,-1120.05700684,1000.39093018,0.00000000,270.00000000,180.00000000);
- ObjetosInt[4] = CreateObject(5837,1776.92712402,-1122.58117676,1000.39093018,0.00000000,270.00000000,270.00000000);
- ObjetosInt[5] = CreateObject(5837,1780.02832031,-1116.00000000,1000.39093018,0.00000000,270.00000000,0.00000000);
- ObjetosInt[6] = CreateObject(5837,1773.48535156,-1116.00000000,1000.39093018,0.00000000,270.00000000,179.99450684);
- ObjetosInt[7] = CreateObject(5837,1776.81506348,-1114.43688965,1000.39093018,0.00000000,270.00000000,90.00000000);
- ObjetosInt[8] = CreateObject(3504,1776.78393555,-1115.64001465,1000.01580811,0.00000000,0.00000000,180.00000000);
- ObjetosInt[9] = CreateObject(14480,1775.56994629,-1118.69995117,999.26788330,0.00000000,0.00000000,180.00000000);
- ObjetosInt[10] = CreateObject(2523,1775.71020508,-1117.55456543,998.67346191,0.00000000,0.00000000,90.00000000);
- //Banheiros
- CarregarBanheiros();
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnFilterScriptExit()
- {
- for(new i = 0; i < sizeof(Banheiros); i ++)
- {
- DestroyObject(Banheiros[i][bObjeto]);
- }
- for(new i = 0; i < sizeof(ObjetosInt); i ++)
- {
- DestroyObject(ObjetosInt[i]);
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerConnect(playerid)
- {
- Jogadores[playerid][jFezes] = 0; Jogadores[playerid][jBanheiro] = 0; Jogadores[playerid][jDefecando] = false;
- TimerCagarP[playerid] = SetTimerEx("TimerCagar", 300000, true, "i", playerid);
- SendClientMessage(playerid, CORBEMVINDO, "[AVISO] Este servidor usa o Sistema de Defecação do Shickcard e do Dr_Pawno");
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerDisconnect(playerid, reason)
- {
- if(Jogadores[playerid][jBanheiro] != 0)
- {
- Banheiros[Jogadores[playerid][jBanheiro]][bOcupado] = false;
- }
- KillTimer(TimerInfeccaoIntestinal[playerid]);
- KillTimer(TimerCagarP[playerid]);
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == 16)
- {
- #if defined ENTRAR_COM_F
- for(new i = 0; i < sizeof(Banheiros); i ++)
- {
- if(PlayerToPoint(4.0, playerid, Banheiros[i][bX], Banheiros[i][bY], Banheiros[i][bZ]))
- {
- OnPlayerCommandText(playerid, "/banheiro");
- }
- }
- #endif
- #if defined SAIR_COM_F
- if(PlayerToPoint(2.0, playerid, 1776.76611328, -1116.93945312, 999.82519531))
- {
- OnPlayerCommandText(playerid, "/banheiro");
- }
- #endif
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(Jogadores[playerid][jFezes] >= 7)
- {
- SetPlayerHealth(playerid,0);
- SendClientMessage(playerid, CORMORREU, "[LAUDO MÉDICO] Você morreu de infecção intestinal por acumular fezes.");
- Jogadores[playerid][jFezes] = 0;
- KillTimer(TimerInfeccaoIntestinal[playerid]);
- return 1;
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp("/banheiro", cmdtext, true) == 0)
- {
- new bool:Perto = false;
- new bool:Ocupado = false;
- for(new i = 0; i < sizeof(Banheiros); i ++)
- {
- if(PlayerToPoint(4.0, playerid, Banheiros[i][bX], Banheiros[i][bY], Banheiros[i][bZ]))
- {
- if(Banheiros[i][bOcupado] == false)
- {
- GetPlayerPos(playerid, Jogadores[playerid][jX], Jogadores[playerid][jY], Jogadores[playerid][jZ]);
- GetPlayerFacingAngle(playerid, Jogadores[playerid][jA]);
- Jogadores[playerid][jVirtualWorld] = GetPlayerVirtualWorld(playerid);
- SetPlayerPos(playerid, 1776.76611328,-1116.93945312,999.67346191);
- SetPlayerVirtualWorld(playerid, i+1);
- SendClientMessage(playerid, CORCMDS, "Você entrou em um Banheiro Quimico.");
- Banheiros[i][bOcupado] = true;
- Jogadores[playerid][jBanheiro] = i;
- Perto = true;
- return 1;
- }
- else
- {
- Ocupado = true;
- }
- }
- }
- if(PlayerToPoint(2.0, playerid, 1776.76611328, -1116.93945312, 999.82519531))
- {
- Banheiros[Jogadores[playerid][jBanheiro]][bOcupado] = false;
- SetPlayerPos(playerid, Jogadores[playerid][jX], Jogadores[playerid][jY], Jogadores[playerid][jZ]);
- SetPlayerFacingAngle(playerid, Jogadores[playerid][jA] - 180);
- SetPlayerVirtualWorld(playerid, Jogadores[playerid][jVirtualWorld]);
- SendClientMessage(playerid, CORCMDS, "Você saiu do Banheiro Quimico.");
- Perto = true;
- return 1;
- }
- if(Ocupado == true)
- {
- SendClientMessage(playerid, CORCMDS, "[ERRO] Este banheiro esta Ocupado!");
- return 1;
- }
- if(Perto == false)
- {
- SendClientMessage(playerid, CORCMDS, "[ERRO] Você não está perto de um Banheiro Quimico!");
- return 1;
- }
- }
- if(strcmp("/creditos", cmdtext, true) == 0)
- {
- SendClientMessage(playerid, CORCREDITOS, "[CRÉDITOS] Shickcard: Invertor do FilterScript.");
- SendClientMessage(playerid, CORCREDITOS, "[CRÉDITOS] Dr_Pawno: Editor do FilterScript.");
- return 1;
- }
- if(strcmp("/comandosfs", cmdtext, true) == 0)
- {
- SendClientMessage(playerid, CORCMDS, "[COMANDOS] /banheiro /defecar /nivelfezes /creditos /gpsbanheiro /comandosfs");
- return 1;
- }
- if(strcmp("/defecar", cmdtext, true) == 0)
- {
- if(Jogadores[playerid][jFezes] == 0)
- {
- SendClientMessage(playerid, CORCMDS, "[ERRO] Você já defecou!");
- return 1;
- }
- if(PlayerToPoint(2.0, playerid, 1776.99121094, -1120.34301758, 998.67346191))
- {
- if(Banheiros[Jogadores[playerid][jBanheiro]][bCagadas] > 10)
- {
- SendClientMessage(playerid, CORCMDS, "[ERRO] O Banheiro esta muito sujo! Use /limparbanheiro.");
- return 1;
- }
- SetPlayerPos(playerid, 1776.853344, -1120.289184, 1000.073461);
- SetPlayerFacingAngle(playerid, 0.0);
- SetPlayerCameraPos(playerid, 1776.853344, -1117.569946, 999.673461);
- SetPlayerCameraLookAt(playerid, 1776.853344, -1120.289184, 999.82519531);
- SetTimerEx("Cagando", 5000, false, "i", playerid);
- SendClientMessage(playerid, CORCMDS, "Você esta defecando!");
- Banheiros[Jogadores[playerid][jBanheiro]][bCagadas] ++;
- Banheiros[Jogadores[playerid][jBanheiro]][bSujo] = true;
- Jogadores[playerid][jDefecando] = true;
- TogglePlayerControllable(playerid, false);
- ApplyAnimation(playerid, "FOOD", "FF_Dam_Fwd", 4.1, 0, 0, 0, 1, 0);
- ApplyAnimation(playerid, "FOOD", "FF_Dam_Fwd", 4.1, 0, 0, 0, 1, 0);
- ApplyAnimation(playerid, "FOOD", "FF_Dam_Fwd", 4.1, 0, 0, 0, 1, 0);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, CORCMDS, "[ERRO] Você não esta em um Banheiro Quimico!");
- return 1;
- }
- }
- if(strcmp("/limparbanheiro", cmdtext, true) == 0)
- {
- if(!PlayerToPoint(2.0, playerid, 1776.99121094, -1120.34301758, 998.67346191)) return SendClientMessage(playerid, CORCMDS, "[ERRO] Você não esta em um Banheiro Quimico!");
- SendClientMessage(playerid, CORCMDS, "Você limpou o Banheiro!");
- Banheiros[Jogadores[playerid][jBanheiro]][bCagadas] = 0;
- Banheiros[Jogadores[playerid][jBanheiro]][bSujo] = false;
- return 1;
- }
- if(strcmp("/gpsbanheiro", cmdtext ,true) == 0)
- {
- new string[sizeof(Banheiros) * 30], caixaid[30];
- SetPlayerCheckpoint(playerid, 1809.86218262,-1688.09643555,12.54815292,8.0);
- for(new i = 0; i < sizeof(Banheiros); i++)
- {
- format(caixaid, sizeof(caixaid), "{0066FF}Banheiro Quimico %d\n", i+1);
- strcat(string, caixaid, sizeof(string));
- }
- ShowPlayerDialog(playerid, SHICK, DIALOG_STYLE_LIST, "{FC69FF}.:: {DDE7FF} GPS Fezes {FC69FF}::.", string, "Selecionar", "Cancelar");
- return 1;
- }
- if(strcmp("/nivelfezes", cmdtext, true) == 0)
- {
- new string[128];
- format(string, sizeof(string), "Nível de Fezes: %d", Jogadores[playerid][jFezes]);
- SendClientMessageToAll(0xD5E8A8AA, string);
- return 1;
- }
- return 0;
- }
- //------------------------------------------------------------------------------
- public TimerCagar(playerid)
- {
- Jogadores[playerid][jFezes] ++;
- if(Jogadores[playerid][jFezes] == 1)
- {
- SendClientMessage(playerid, 0xD5E8A8AA, "[AVISO] Seu nível de fezes acabou de aumentar para 1.");
- }
- else if(Jogadores[playerid][jFezes] == 2)
- {
- SendClientMessage(playerid, CORAVISO, "[AVISO] Vá defecar ou você irá morrer por infecção intestinal (Nível Fezes: 2/6)");
- }
- else if(Jogadores[playerid][jFezes] == 3)
- {
- SendClientMessage(playerid, CORAVISO, "[AVISO] Vá defecar ou você irá morrer por infecção intestinal (Nível Fezes: 3/6)");
- }
- else if(Jogadores[playerid][jFezes] == 4)
- {
- SendClientMessage(playerid, CORAVISO, "[AVISO] Vá defecar ou você irá morrer por infecção intestinal (Nível Fezes: 4/6)");
- }
- else if(Jogadores[playerid][jFezes] == 5)
- {
- SendClientMessage(playerid, CORAVISO, "[AVISO] Vá defecar ou você irá morrer por infecção intestinal (Nível Fezes: 5/6)");
- }
- else if(Jogadores[playerid][jFezes] == 6)
- {
- SendClientMessage(playerid, CORAVISO, "[AVISO] Vá defecar ou você irá morrer por infecção intestinal (Nível Fezes: 6/6)");
- }
- else
- {
- SendClientMessage(playerid, CORAVISO, "[AVISO] Você esta com infecção intestinal.");
- TimerInfeccaoIntestinal[playerid] = SetTimerEx("MenosVida", 1000, true, "i", playerid);
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- public MenosVida(playerid)
- {
- new Float:Health;
- GetPlayerHealth(playerid, Health);
- SetPlayerHealth(playerid, Health-5);
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new string[126];
- if(dialogid == SHICK)
- {
- if(response)
- {
- for(new i = 0; i < sizeof(Banheiros); i ++)
- {
- if(listitem == i)
- {
- SetPlayerCheckpoint(playerid, Banheiros[i][bX], Banheiros[i][bY], Banheiros[i][bZ], 3.0);
- format(string, sizeof(string), "[-] Banheiro Quimico %d - Marcado!", i+1);
- SendClientMessage(playerid, 0xFFFFFFAA, string);
- UsandoCheckpoint[playerid] = true;
- }
- }
- return 1;
- }
- }
- return 0;
- }
- //------------------------------------------------------------------------------
- public OnPlayerEnterCheckpoint(playerid)
- {
- DisablePlayerCheckpoint(playerid);
- return 1;
- }
- //------------------------------------------------------------------------------
- public Cagando(playerid)
- {
- if(Jogadores[playerid][jFezes] >= 7)
- {
- KillTimer(TimerInfeccaoIntestinal[playerid]);
- }
- SetPlayerPos(playerid, 1776.973266, -1119.520019, 999.673461);
- SetCameraBehindPlayer(playerid);
- Jogadores[playerid][jFezes] = 0;
- Jogadores[playerid][jDefecando] = false;
- SendClientMessage(playerid, CORCMDS, "Você acaba de defecar!");
- //Reset Anim
- TogglePlayerControllable(playerid, true);
- ApplyAnimation(playerid, "CARRY", "crry_prtial", 0, 0, 0, 0, 0, 0);
- ApplyAnimation(playerid, "CARRY", "crry_prtial", 0, 0, 0, 0, 0, 0);
- return 1;
- }
- //------------------------------------------------------------------------------
- public CarregarBanheiros()
- {
- // New
- new string[256], ler[4][64];
- new File:quimico;
- //File Check
- if(fexist("Banheiros.txt")) quimico = fopen("Banheiros.txt", io_read);
- else { CriarArquivo(); return 1; }
- //File Read
- for(new i = 0; i < sizeof(Banheiros); i ++)
- {
- fread(quimico, string);
- split(string, ler, ',');
- //File Read and Set Stats
- Banheiros[i][bX] = floatstr(ler[0]);
- Banheiros[i][bY] = floatstr(ler[1]);
- Banheiros[i][bZ] = floatstr(ler[2]);
- Banheiros[i][bA] = floatstr(ler[3]);
- //Create File Object
- Banheiros[i][bObjeto] = CreateObject(3504, Banheiros[i][bX], Banheiros[i][bY], Banheiros[i][bZ], 0, 0, Banheiros[i][bA]);
- printf("Banheiro Quimico: ID [%d] ObjectID [%d]", i, Banheiros[i][bObjeto]);
- }
- fclose(quimico);
- return 1;
- }
- //------------------------------------------------------------------------------
- stock CriarArquivo()
- {
- if(fexist("Banheiros.txt")) return 1;
- new File:quimico = fopen("Banheiros.txt", io_write);
- fwrite(quimico, "1546.98364258,-1700.54199219,13.88923836,0.00000000\n");
- fwrite(quimico, "1548.38574219,-1700.54309082,13.88923836,0.00000000\n");
- fwrite(quimico, "1462.59729004,-1749.74218750,15.78767586,0.00000000\n");
- fwrite(quimico, "1498.04211426,-1022.36334229,24.16516685,180.00000000\n");
- fwrite(quimico, "1627.60876465,-1171.70141602,24.42048836,179.99450684\n");
- fwrite(quimico, "1983.78906250,-1227.45996094,20.37000084,269.99450684\n");
- fwrite(quimico, "1186.26379395,-1304.59143066,13.89572144,269.98901367\n");
- fwrite(quimico, "1006.13739014,-948.64929199,42.54718018,185.98901367\n");
- fwrite(quimico, "1035.03686523,-1024.75085449,32.44392776,179.98754883\n");
- fwrite(quimico, "2043.60449219,-1413.31152344,17.50642586,89.98352051\n");
- fwrite(quimico, "1916.29223633,-1416.80468750,13.91267586,359.98352051\n");
- fwrite(quimico, "2148.98486328,-1011.43402100,62.86999893,345.97802734\n");
- fwrite(quimico, "2331.83251953,-1462.97290039,24.34236336,267.97595215\n");
- fwrite(quimico, "338.32699585,-1762.79504395,5.59653425,267.97302246\n");
- fwrite(quimico, "493.92150879,-1271.64428711,16.13839340,219.97302246\n");
- fclose(quimico);
- CarregarBanheiros();
- return 1;
- }
- //------------------------------------------------------------------------------
- stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new 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;
- }
- //------------------------------------------------------------------------------
- stock split(const strsrc[], strdest[][], delimiter)
- {
- new i, li;
- new aNum;
- new len;
- while(i <= strlen(strsrc))
- {
- if(strsrc[i] == delimiter || i == strlen(strsrc))
- {
- len = strmid(strdest[aNum], strsrc, li, i, 128);
- strdest[aNum][len] = 0;
- li = i + 1;
- aNum ++;
- }
- i ++;
- }
- return 1;
- }
- /*
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ==================================================================================================================
- Sistema de Fezes v0.3
- Creditos:
- Shickcard: Inventor
- Dr_Pawno: Editor
- MSN:
- Shickcard: shickcard@hotmail.com
- Dr_Pawno: leonardoleal.qm@hotmail.com.br
- SKYPE:
- Shickcard: shickcard
- ==================================================================================================================
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement