Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.26 KB | None | 0 0
  1. /*
  2. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  3. ==================================================================================================================
  4.  
  5. Sistema de Fezes v0.3
  6. Creditos:
  7. Shickcard: Inventor
  8. Dr_Pawno: Editor
  9.  
  10. MSN:
  11. Shick: shickcard@hotmail.com
  12. Dr_Pawno: leonardoleal.qm@hotmail.com.br
  13.  
  14. SKYPE:
  15. Shick: shickcard
  16.  
  17. ==================================================================================================================
  18. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  19. */
  20.  
  21. #include <a_samp>
  22.  
  23. #define CORBEMVINDO 0x8080FFAA
  24. #define CORMORREU 0xFF0000AA
  25. #define CORCMDS 0x80FF00AA
  26. #define CORCREDITOS 0xFF00FFAA
  27. #define CORAVISO 0x408080AA
  28. #define SHICK 999
  29.  
  30. #define ENTRAR_COM_F // Remova esta linha para o jogador não entrar ao apertar 'F'.
  31. #define SAIR_COM_F // Remova esta linha para o jogador não sair ao apertar 'F'.
  32.  
  33. enum Banheiro
  34. {
  35. bObjeto,
  36. Float:bX,
  37. Float:bY,
  38. Float:bZ,
  39. Float:bA,
  40. bool:bOcupado,
  41. bool:bSujo,
  42. bCagadas
  43. }
  44.  
  45. enum Jogador
  46. {
  47. Float:jX,
  48. Float:jY,
  49. Float:jZ,
  50. Float:jA,
  51. jVirtualWorld,
  52. jFezes,
  53. jBanheiro,
  54. bool:jDefecando
  55. }
  56.  
  57. new TimerInfeccaoIntestinal[MAX_PLAYERS];
  58. new TimerCagarP[MAX_PLAYERS];
  59. new bool:UsandoCheckpoint[MAX_PLAYERS];
  60.  
  61. new Banheiros[15][Banheiro];
  62. new Jogadores[MAX_PLAYERS][Jogador];
  63. new ObjetosInt[11];
  64.  
  65. forward CarregarBanheiros();
  66. forward MenosVida(playerid);
  67. forward TimerCagar(playerid);
  68. forward Cagando(playerid);
  69.  
  70. //------------------------------------------------------------------------------
  71.  
  72. public OnFilterScriptInit()
  73. {
  74. print("\n--------------------------------------");
  75. print(" [FS] Sistema de Defecação v0.3a");
  76. print(" Criador: Shickcard ");
  77. print("--------------------------------------\n");
  78. //Interior
  79. ObjetosInt[0] = CreateObject(3932,1776.72631836,-1118.29406738,1000.43811035,0.00000000,0.00000000,90.00000000);
  80. ObjetosInt[1] = CreateObject(16000,1775.21960449,-1111.78210449,998.66998291,90.00000000,0.00000000,0.00000000);
  81. ObjetosInt[2] = CreateObject(5837,1780.02832031,-1120.05700684,1000.39093018,0.00000000,270.00000000,0.00000000);
  82. ObjetosInt[3] = CreateObject(5837,1773.48596191,-1120.05700684,1000.39093018,0.00000000,270.00000000,180.00000000);
  83. ObjetosInt[4] = CreateObject(5837,1776.92712402,-1122.58117676,1000.39093018,0.00000000,270.00000000,270.00000000);
  84. ObjetosInt[5] = CreateObject(5837,1780.02832031,-1116.00000000,1000.39093018,0.00000000,270.00000000,0.00000000);
  85. ObjetosInt[6] = CreateObject(5837,1773.48535156,-1116.00000000,1000.39093018,0.00000000,270.00000000,179.99450684);
  86. ObjetosInt[7] = CreateObject(5837,1776.81506348,-1114.43688965,1000.39093018,0.00000000,270.00000000,90.00000000);
  87. ObjetosInt[8] = CreateObject(3504,1776.78393555,-1115.64001465,1000.01580811,0.00000000,0.00000000,180.00000000);
  88. ObjetosInt[9] = CreateObject(14480,1775.56994629,-1118.69995117,999.26788330,0.00000000,0.00000000,180.00000000);
  89. ObjetosInt[10] = CreateObject(2523,1775.71020508,-1117.55456543,998.67346191,0.00000000,0.00000000,90.00000000);
  90. //Banheiros
  91. CarregarBanheiros();
  92. return 1;
  93. }
  94.  
  95. //------------------------------------------------------------------------------
  96.  
  97. public OnFilterScriptExit()
  98. {
  99. for(new i = 0; i < sizeof(Banheiros); i ++)
  100. {
  101. DestroyObject(Banheiros[i][bObjeto]);
  102. }
  103. for(new i = 0; i < sizeof(ObjetosInt); i ++)
  104. {
  105. DestroyObject(ObjetosInt[i]);
  106. }
  107. return 1;
  108. }
  109.  
  110. //------------------------------------------------------------------------------
  111.  
  112. public OnPlayerConnect(playerid)
  113. {
  114. Jogadores[playerid][jFezes] = 0; Jogadores[playerid][jBanheiro] = 0; Jogadores[playerid][jDefecando] = false;
  115. TimerCagarP[playerid] = SetTimerEx("TimerCagar", 300000, true, "i", playerid);
  116. SendClientMessage(playerid, CORBEMVINDO, "[AVISO] Este servidor usa o Sistema de Defecação do Shickcard e do Dr_Pawno");
  117. return 1;
  118. }
  119.  
  120. //------------------------------------------------------------------------------
  121.  
  122. public OnPlayerDisconnect(playerid, reason)
  123. {
  124. if(Jogadores[playerid][jBanheiro] != 0)
  125. {
  126. Banheiros[Jogadores[playerid][jBanheiro]][bOcupado] = false;
  127. }
  128. KillTimer(TimerInfeccaoIntestinal[playerid]);
  129. KillTimer(TimerCagarP[playerid]);
  130. return 1;
  131. }
  132.  
  133. //------------------------------------------------------------------------------
  134.  
  135. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  136. {
  137. if(newkeys == 16)
  138. {
  139. #if defined ENTRAR_COM_F
  140. for(new i = 0; i < sizeof(Banheiros); i ++)
  141. {
  142. if(PlayerToPoint(4.0, playerid, Banheiros[i][bX], Banheiros[i][bY], Banheiros[i][bZ]))
  143. {
  144. OnPlayerCommandText(playerid, "/banheiro");
  145. }
  146. }
  147. #endif
  148. #if defined SAIR_COM_F
  149. if(PlayerToPoint(2.0, playerid, 1776.76611328, -1116.93945312, 999.82519531))
  150. {
  151. OnPlayerCommandText(playerid, "/banheiro");
  152. }
  153. #endif
  154. }
  155.  
  156. return 1;
  157. }
  158.  
  159. //------------------------------------------------------------------------------
  160.  
  161. public OnPlayerDeath(playerid, killerid, reason)
  162. {
  163. if(Jogadores[playerid][jFezes] >= 7)
  164. {
  165. SetPlayerHealth(playerid,0);
  166. SendClientMessage(playerid, CORMORREU, "[LAUDO MÉDICO] Você morreu de infecção intestinal por acumular fezes.");
  167. Jogadores[playerid][jFezes] = 0;
  168. KillTimer(TimerInfeccaoIntestinal[playerid]);
  169. return 1;
  170. }
  171. return 1;
  172. }
  173.  
  174. //------------------------------------------------------------------------------
  175.  
  176. public OnPlayerCommandText(playerid, cmdtext[])
  177. {
  178. if(strcmp("/banheiro", cmdtext, true) == 0)
  179. {
  180. new bool:Perto = false;
  181. new bool:Ocupado = false;
  182. for(new i = 0; i < sizeof(Banheiros); i ++)
  183. {
  184. if(PlayerToPoint(4.0, playerid, Banheiros[i][bX], Banheiros[i][bY], Banheiros[i][bZ]))
  185. {
  186. if(Banheiros[i][bOcupado] == false)
  187. {
  188. GetPlayerPos(playerid, Jogadores[playerid][jX], Jogadores[playerid][jY], Jogadores[playerid][jZ]);
  189. GetPlayerFacingAngle(playerid, Jogadores[playerid][jA]);
  190. Jogadores[playerid][jVirtualWorld] = GetPlayerVirtualWorld(playerid);
  191. SetPlayerPos(playerid, 1776.76611328,-1116.93945312,999.67346191);
  192. SetPlayerVirtualWorld(playerid, i+1);
  193. SendClientMessage(playerid, CORCMDS, "Você entrou em um Banheiro Quimico.");
  194. Banheiros[i][bOcupado] = true;
  195. Jogadores[playerid][jBanheiro] = i;
  196. Perto = true;
  197. return 1;
  198. }
  199. else
  200. {
  201. Ocupado = true;
  202. }
  203. }
  204. }
  205. if(PlayerToPoint(2.0, playerid, 1776.76611328, -1116.93945312, 999.82519531))
  206. {
  207. Banheiros[Jogadores[playerid][jBanheiro]][bOcupado] = false;
  208. SetPlayerPos(playerid, Jogadores[playerid][jX], Jogadores[playerid][jY], Jogadores[playerid][jZ]);
  209. SetPlayerFacingAngle(playerid, Jogadores[playerid][jA] - 180);
  210. SetPlayerVirtualWorld(playerid, Jogadores[playerid][jVirtualWorld]);
  211. SendClientMessage(playerid, CORCMDS, "Você saiu do Banheiro Quimico.");
  212. Perto = true;
  213. return 1;
  214. }
  215. if(Ocupado == true)
  216. {
  217. SendClientMessage(playerid, CORCMDS, "[ERRO] Este banheiro esta Ocupado!");
  218. return 1;
  219. }
  220. if(Perto == false)
  221. {
  222. SendClientMessage(playerid, CORCMDS, "[ERRO] Você não está perto de um Banheiro Quimico!");
  223. return 1;
  224. }
  225. }
  226.  
  227. if(strcmp("/creditos", cmdtext, true) == 0)
  228. {
  229. SendClientMessage(playerid, CORCREDITOS, "[CRÉDITOS] Shickcard: Inventor do Sistema.");
  230. SendClientMessage(playerid, CORCREDITOS, "[CRÉDITOS] Dr_Pawno: Editor do Sistema.");
  231. return 1;
  232. }
  233.  
  234. if(strcmp("/comandosfs", cmdtext, true) == 0)
  235. {
  236. SendClientMessage(playerid, CORCMDS, "[COMANDOS] /banheiro /defecar /nivelfezes /creditos /gpsbanheiro /comandosfs");
  237. return 1;
  238. }
  239.  
  240. if(strcmp("/defecar", cmdtext, true) == 0)
  241. {
  242. if(Jogadores[playerid][jFezes] == 0)
  243. {
  244. SendClientMessage(playerid, CORCMDS, "[ERRO] Você já defecou!");
  245. return 1;
  246. }
  247. if(PlayerToPoint(2.0, playerid, 1776.99121094, -1120.34301758, 998.67346191))
  248. {
  249. if(Banheiros[Jogadores[playerid][jBanheiro]][bCagadas] > 10)
  250. {
  251. SendClientMessage(playerid, CORCMDS, "[ERRO] O Banheiro esta muito sujo! Use /limparbanheiro.");
  252. return 1;
  253. }
  254. SetPlayerPos(playerid, 1776.853344, -1120.289184, 1000.073461);
  255. SetPlayerFacingAngle(playerid, 0.0);
  256. SetPlayerCameraPos(playerid, 1776.853344, -1117.569946, 999.673461);
  257. SetPlayerCameraLookAt(playerid, 1776.853344, -1120.289184, 999.82519531);
  258. SetTimerEx("Cagando", 5000, false, "i", playerid);
  259. SendClientMessage(playerid, CORCMDS, "Você esta defecando!");
  260. Banheiros[Jogadores[playerid][jBanheiro]][bCagadas] ++;
  261. Banheiros[Jogadores[playerid][jBanheiro]][bSujo] = true;
  262. Jogadores[playerid][jDefecando] = true;
  263. TogglePlayerControllable(playerid, false);
  264. ApplyAnimation(playerid, "FOOD", "FF_Dam_Fwd", 4.1, 0, 0, 0, 1, 0);
  265. ApplyAnimation(playerid, "FOOD", "FF_Dam_Fwd", 4.1, 0, 0, 0, 1, 0);
  266. ApplyAnimation(playerid, "FOOD", "FF_Dam_Fwd", 4.1, 0, 0, 0, 1, 0);
  267. return 1;
  268. }
  269. else
  270. {
  271. SendClientMessage(playerid, CORCMDS, "[ERRO] Você não esta em um Banheiro Quimico!");
  272. return 1;
  273. }
  274. }
  275.  
  276. if(strcmp("/limparbanheiro", cmdtext, true) == 0)
  277. {
  278. if(!PlayerToPoint(2.0, playerid, 1776.99121094, -1120.34301758, 998.67346191)) return SendClientMessage(playerid, CORCMDS, "[ERRO] Você não esta em um Banheiro Quimico!");
  279.  
  280. SendClientMessage(playerid, CORCMDS, "Você limpou o Banheiro!");
  281. Banheiros[Jogadores[playerid][jBanheiro]][bCagadas] = 0;
  282. Banheiros[Jogadores[playerid][jBanheiro]][bSujo] = false;
  283. return 1;
  284. }
  285.  
  286. if(strcmp("/gpsbanheiro", cmdtext ,true) == 0)
  287. {
  288. new string[sizeof(Banheiros) * 30], caixaid[30];
  289. SetPlayerCheckpoint(playerid, 1809.86218262,-1688.09643555,12.54815292,8.0);
  290. for(new i = 0; i < sizeof(Banheiros); i++)
  291. {
  292. format(caixaid, sizeof(caixaid), "{0066FF}Banheiro Quimico %d\n", i+1);
  293. strcat(string, caixaid, sizeof(string));
  294. }
  295. ShowPlayerDialog(playerid, SHICK, DIALOG_STYLE_LIST, "{FC69FF}.:: {DDE7FF} GPS Fezes {FC69FF}::.", string, "Selecionar", "Cancelar");
  296. return 1;
  297. }
  298.  
  299. if(strcmp("/nivelfezes", cmdtext, true) == 0)
  300. {
  301. new string[128];
  302. format(string, sizeof(string), "Nível de Fezes: %d", Jogadores[playerid][jFezes]);
  303. SendClientMessageToAll(0xD5E8A8AA, string);
  304. return 1;
  305. }
  306. return 0;
  307. }
  308.  
  309. //------------------------------------------------------------------------------
  310.  
  311. public TimerCagar(playerid)
  312. {
  313. Jogadores[playerid][jFezes] ++;
  314. if(Jogadores[playerid][jFezes] == 1)
  315. {
  316. SendClientMessage(playerid, 0xD5E8A8AA, "[AVISO] Seu nível de fezes acabou de aumentar para 1.");
  317. }
  318. else if(Jogadores[playerid][jFezes] == 2)
  319. {
  320. SendClientMessage(playerid, CORAVISO, "[AVISO] Vá defecar ou você irá morrer por infecção intestinal (Nível Fezes: 2/6)");
  321. }
  322. else if(Jogadores[playerid][jFezes] == 3)
  323. {
  324. SendClientMessage(playerid, CORAVISO, "[AVISO] Vá defecar ou você irá morrer por infecção intestinal (Nível Fezes: 3/6)");
  325. }
  326. else if(Jogadores[playerid][jFezes] == 4)
  327. {
  328. SendClientMessage(playerid, CORAVISO, "[AVISO] Vá defecar ou você irá morrer por infecção intestinal (Nível Fezes: 4/6)");
  329. }
  330. else if(Jogadores[playerid][jFezes] == 5)
  331. {
  332. SendClientMessage(playerid, CORAVISO, "[AVISO] Vá defecar ou você irá morrer por infecção intestinal (Nível Fezes: 5/6)");
  333. }
  334. else if(Jogadores[playerid][jFezes] == 6)
  335. {
  336. SendClientMessage(playerid, CORAVISO, "[AVISO] Vá defecar ou você irá morrer por infecção intestinal (Nível Fezes: 6/6)");
  337. }
  338. else
  339. {
  340. SendClientMessage(playerid, CORAVISO, "[AVISO] Você esta com infecção intestinal.");
  341. TimerInfeccaoIntestinal[playerid] = SetTimerEx("MenosVida", 1000, true, "i", playerid);
  342. }
  343. return 1;
  344. }
  345.  
  346. //------------------------------------------------------------------------------
  347.  
  348. public MenosVida(playerid)
  349. {
  350. new Float:Health;
  351. GetPlayerHealth(playerid, Health);
  352. SetPlayerHealth(playerid, Health-5);
  353. return 1;
  354. }
  355.  
  356. //------------------------------------------------------------------------------
  357.  
  358. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  359. {
  360. new string[126];
  361. if(dialogid == SHICK)
  362. {
  363. if(response)
  364. {
  365. for(new i = 0; i < sizeof(Banheiros); i ++)
  366. {
  367. if(listitem == i)
  368. {
  369. SetPlayerCheckpoint(playerid, Banheiros[i][bX], Banheiros[i][bY], Banheiros[i][bZ], 3.0);
  370. format(string, sizeof(string), "[-] Banheiro Quimico %d - Marcado!", i+1);
  371. SendClientMessage(playerid, 0xFFFFFFAA, string);
  372. UsandoCheckpoint[playerid] = true;
  373. }
  374. }
  375. return 1;
  376. }
  377. }
  378. return 0;
  379. }
  380.  
  381. //------------------------------------------------------------------------------
  382.  
  383. public OnPlayerEnterCheckpoint(playerid)
  384. {
  385. DisablePlayerCheckpoint(playerid);
  386. return 1;
  387. }
  388.  
  389. //------------------------------------------------------------------------------
  390.  
  391. public Cagando(playerid)
  392. {
  393. if(Jogadores[playerid][jFezes] >= 7)
  394. {
  395. KillTimer(TimerInfeccaoIntestinal[playerid]);
  396. }
  397. SetPlayerPos(playerid, 1776.973266, -1119.520019, 999.673461);
  398. SetCameraBehindPlayer(playerid);
  399. Jogadores[playerid][jFezes] = 0;
  400. Jogadores[playerid][jDefecando] = false;
  401. SendClientMessage(playerid, CORCMDS, "Você acaba de defecar!");
  402. //Reset Anim
  403. TogglePlayerControllable(playerid, true);
  404. ApplyAnimation(playerid, "CARRY", "crry_prtial", 0, 0, 0, 0, 0, 0);
  405. ApplyAnimation(playerid, "CARRY", "crry_prtial", 0, 0, 0, 0, 0, 0);
  406. return 1;
  407. }
  408.  
  409. //------------------------------------------------------------------------------
  410.  
  411. public CarregarBanheiros()
  412. {
  413. // New
  414. new string[256], ler[4][64];
  415. new File:quimico;
  416. //File Check
  417. if(fexist("Banheiros.txt")) quimico = fopen("Banheiros.txt", io_read);
  418. else { CriarArquivo(); return 1; }
  419. //File Read
  420. for(new i = 0; i < sizeof(Banheiros); i ++)
  421. {
  422. fread(quimico, string);
  423. split(string, ler, ',');
  424. //File Read and Set Stats
  425. Banheiros[i][bX] = floatstr(ler[0]);
  426. Banheiros[i][bY] = floatstr(ler[1]);
  427. Banheiros[i][bZ] = floatstr(ler[2]);
  428. Banheiros[i][bA] = floatstr(ler[3]);
  429. //Create File Object
  430. Banheiros[i][bObjeto] = CreateObject(3504, Banheiros[i][bX], Banheiros[i][bY], Banheiros[i][bZ], 0, 0, Banheiros[i][bA]);
  431. printf("Banheiro Quimico: ID [%d] ObjectID [%d]", i, Banheiros[i][bObjeto]);
  432. }
  433. fclose(quimico);
  434. return 1;
  435. }
  436.  
  437. //------------------------------------------------------------------------------
  438.  
  439. stock CriarArquivo()
  440. {
  441. if(fexist("Banheiros.txt")) return 1;
  442. new File:quimico = fopen("Banheiros.txt", io_write);
  443. fwrite(quimico, "1546.98364258,-1700.54199219,13.88923836,0.00000000\n");
  444. fwrite(quimico, "1548.38574219,-1700.54309082,13.88923836,0.00000000\n");
  445. fwrite(quimico, "1462.59729004,-1749.74218750,15.78767586,0.00000000\n");
  446. fwrite(quimico, "1498.04211426,-1022.36334229,24.16516685,180.00000000\n");
  447. fwrite(quimico, "1627.60876465,-1171.70141602,24.42048836,179.99450684\n");
  448. fwrite(quimico, "1983.78906250,-1227.45996094,20.37000084,269.99450684\n");
  449. fwrite(quimico, "1186.26379395,-1304.59143066,13.89572144,269.98901367\n");
  450. fwrite(quimico, "1006.13739014,-948.64929199,42.54718018,185.98901367\n");
  451. fwrite(quimico, "1035.03686523,-1024.75085449,32.44392776,179.98754883\n");
  452. fwrite(quimico, "2043.60449219,-1413.31152344,17.50642586,89.98352051\n");
  453. fwrite(quimico, "1916.29223633,-1416.80468750,13.91267586,359.98352051\n");
  454. fwrite(quimico, "2148.98486328,-1011.43402100,62.86999893,345.97802734\n");
  455. fwrite(quimico, "2331.83251953,-1462.97290039,24.34236336,267.97595215\n");
  456. fwrite(quimico, "338.32699585,-1762.79504395,5.59653425,267.97302246\n");
  457. fwrite(quimico, "493.92150879,-1271.64428711,16.13839340,219.97302246\n");
  458. fclose(quimico);
  459. CarregarBanheiros();
  460. return 1;
  461. }
  462.  
  463. //------------------------------------------------------------------------------
  464.  
  465. stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  466. {
  467. new Float:oldposx, Float:oldposy, Float:oldposz;
  468. new Float:tempposx, Float:tempposy, Float:tempposz;
  469. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  470. tempposx = (oldposx - x);
  471. tempposy = (oldposy - y);
  472. tempposz = (oldposz - z);
  473. if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  474. {
  475. return 1;
  476. }
  477. return 0;
  478. }
  479.  
  480. //------------------------------------------------------------------------------
  481.  
  482. stock split(const strsrc[], strdest[][], delimiter)
  483. {
  484. new i, li;
  485. new aNum;
  486. new len;
  487. while(i <= strlen(strsrc))
  488. {
  489. if(strsrc[i] == delimiter || i == strlen(strsrc))
  490. {
  491. len = strmid(strdest[aNum], strsrc, li, i, 128);
  492. strdest[aNum][len] = 0;
  493. li = i + 1;
  494. aNum ++;
  495. }
  496. i ++;
  497. }
  498. return 1;
  499. }
  500.  
  501. /*
  502. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  503. ==================================================================================================================
  504.  
  505. Sistema de Fezes v0.3
  506. Creditos:
  507. Shickcard: Inventor
  508. Dr_Pawno: Editor
  509.  
  510. MSN:
  511. Shick: shickcard@hotmail.com
  512. Dr_Pawno: leonardoleal.qm@hotmail.com.br
  513.  
  514. SKYPE:
  515. Shick: shickcard
  516.  
  517. ==================================================================================================================
  518. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  519. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement