Advertisement
Guest User

Sistema de Fome e Sede - HomeHots

a guest
Jun 10th, 2014
2,876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.50 KB | None | 0 0
  1.  
  2.  
  3. /*
  4.  
  5. |||||||| || || |||||| |||||| ||||||||||| |||||| || |||||||||||| ||||||||
  6. || || || || || || || || || || || || || ||
  7. || || || || || || || || || || || || || || || ||
  8. || || || || || || || || || || || || || || || ||
  9. || || || || || |||| || || || || || || || |||||||||||
  10. || || || || || || ||||||||| || || || || || || ||
  11. || || || || || || || || || || || || || ||
  12. || || || || || || || || || || || || || ||
  13. || || || || || || || || || || || || || || ||
  14. |||||||| || || || || ||||||||||| || |||| |||||||||||| || ||
  15.  
  16. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  17. Sistema de necessidades básicas como Fome, Sede e Sono em ProgressBar com salvamento.
  18. Creditos reservados;
  19. ~ Toribio pela include 'progress'
  20. ~ Steki pela include 'Stewie` Fader'
  21. ~ Créditos ao criador da 'DOF2'
  22. ~ Créditos ao criador da 'zcmd'
  23. *** Restante dos créditos reservados totalmente a mim 'DiiMeNoR' pela total criação do sistema.
  24. ~ Creditos ao meu amigo Alwe.
  25. mateusqzs.wix.com/diimenorstreet
  26. mateusqzs.wix.com/diimenorstreet
  27. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  28. */
  29.  
  30.  
  31. #include a_samp
  32. #include progress
  33. #include zcmd
  34. #include fader
  35. #include DOF2
  36.  
  37. #define CARDAPIO 1978
  38. #define HOTEL 1979
  39. #define PASTA_CONTAS "/DiiMeNoR/%s.ini"
  40.  
  41. // Necessário criar a pasta 'DiiMeNoR' em suas scriptfiles ou o sistema não ira funcionar.
  42.  
  43. new Bar:barfome, Bar:barsede, Bar:barsono;
  44. new Text:TextFome, Text:TextSede, Text:TextSono, Text:Box;
  45. new ContagemSono[MAX_PLAYERS];
  46. new CorrigirVar[MAX_PLAYERS];
  47. new Cercas[12];
  48. new entrada, saida, entradahotel, saidahotel;
  49. new bool:lanchonete[MAX_PLAYERS];
  50. new arquivo[30];
  51.  
  52. new bool:mFome[MAX_PLAYERS], bool:mSede[MAX_PLAYERS];
  53.  
  54. public OnFilterScriptInit()
  55. {
  56. barfome = CreateProgressBar(505.00, 123.00, 84.50, 3.20, 0xFF283DAA, 100.0);
  57. barsede = CreateProgressBar(505.00, 143.00, 84.50, 3.20, 0x384BFFAA, 100.0);
  58. barsono = CreateProgressBar(505.00, 164.00, 84.50, 3.20, 0xF3FF10AA, 100.0);
  59. entrada = CreatePickup(1318, 23, 1352.1377,-1552.8381,13.5469, -1);
  60. saida = CreatePickup(1318, 23, 363.2614, -74.8193, 1001.5078, -1);
  61. entradahotel = CreatePickup(1318, 23, 328.5529,-1513.7094,36.0391, -1);
  62. saidahotel = CreatePickup(1318, 23, 346.7430,309.8346,999.1557, -1);
  63. SetProgressBarValue(barfome, 100);
  64. SetProgressBarValue(barsede, 100);
  65. SetProgressBarValue(barsono, 100);
  66. TextFome = TextDrawCreate(500.000000, 109.000000, "FOME:");
  67. TextSede = TextDrawCreate(500.000000, 129.000000, "SEDE:");
  68. TextSono = TextDrawCreate(500.000000, 150.000000, "SONO:");
  69. Box = TextDrawCreate(603.000000, 105.000000, "_");
  70. TextDrawUseBox(Box, 1);
  71. TextDrawTextSize(Box,493.000000, 1.000000);
  72. TextDrawLetterSize(Box,0.500000, 8.099987);
  73. TextDrawBoxColor(Box,0x00000066);
  74. TextDrawSetShadow(TextFome,0);
  75. TextDrawSetShadow(TextSede,0);
  76. TextDrawSetShadow(TextSono,0);
  77. Objetos();
  78. DisableInteriorEnterExits();
  79. for(new i = 0; i < 12; i++) SetObjectMaterial(Cercas[i], 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF);
  80. return 1;
  81. }
  82. public OnPlayerSpawn(playerid)
  83. {
  84. SetTimerEx("Fome", 20000, true, "i", playerid);
  85. SetTimerEx("Sede", 15000, true, "i", playerid);
  86. ContagemSono[playerid] = SetTimerEx("Sono", 35000, true, "i", playerid);
  87. return 1;
  88. }
  89. public OnFilterScriptExit()
  90. {
  91. DOF2_Exit();
  92. return false;
  93. }
  94. public OnPlayerPickUpPickup(playerid, pickupid)
  95. {
  96. if(pickupid == entrada)
  97. {
  98. SetPlayerInterior(playerid, 10);
  99. SetPlayerPos(playerid, 369.1026,-72.1459,1001.5078);
  100. SendClientMessage(playerid, -1,"|Lanchonete| Use /cardapio para ver a lista de comidas.");
  101. lanchonete[playerid] = true;
  102. CorrigirVar[playerid] = SetTimerEx("Corrigir", 1000, true, "i", playerid);
  103. }
  104. if(pickupid == saida)
  105. {
  106. SetPlayerInterior(playerid, 0);
  107. SetPlayerPos(playerid, 1349.6332, -1551.5751, 13.5469);
  108. lanchonete[playerid] = false;
  109. KillTimer(CorrigirVar[playerid]);
  110. }
  111. if(pickupid == entradahotel)
  112. {
  113. ShowPlayerDialog(playerid, HOTEL, DIALOG_STYLE_MSGBOX,"Hotel Rooms","Para usar o hotel você tem que alugar um quarto\nNo valor de 100R$.\nDeseja alugar?\n\n","Alugar","Cancelar");
  114. }
  115. if(pickupid == saidahotel)
  116. {
  117. if(GetPVarInt(playerid,"Sono") <= 60) return SendClientMessage(playerid,-1,"Você está com sono e não pode sair do Hotel antes de durmir!");
  118. SetPlayerPos(playerid, 335.1270,-1519.3262,35.8672);
  119. SetPlayerInterior(playerid, 0);
  120. }
  121. return 0;
  122. }
  123. public OnPlayerConnect(playerid)
  124. {
  125. static diimenor[80];
  126. RemoveBuildingForPlayer(playerid, 4116, 1345.6250, -1552.9609, 48.5156, 0.25);
  127. RemoveBuildingForPlayer(playerid, 4113, 1345.6250, -1552.9609, 48.5156, 0.25);
  128. SetPlayerMapIcon(playerid, 0, 1352.1377, -1552.8381, 13.5469, 50, 0, MAPICON_GLOBAL);
  129. SetPlayerMapIcon(playerid, 1,335.1270,-1519.3262,35.8672, 40, 0, MAPICON_GLOBAL);
  130. lanchonete[playerid] = false;
  131. for(new i; i < MAX_PLAYERS; i ++)
  132. {
  133. if(IsPlayerConnected(i))
  134. {
  135. ShowProgressBarForPlayer(i, barfome);
  136. ShowProgressBarForPlayer(i, barsede);
  137. ShowProgressBarForPlayer(i, barsono);
  138. TextDrawShowForPlayer(i, TextFome);
  139. TextDrawShowForPlayer(i, TextSede);
  140. TextDrawShowForPlayer(i, TextSono);
  141. TextDrawShowForPlayer(i, Box);
  142. }
  143. }
  144. format(arquivo, sizeof(arquivo), PASTA_CONTAS, PlayerName(playerid));
  145. if(DOF2_FileExists(arquivo))
  146. {
  147. SetPVarInt(playerid,"Fome", DOF2_GetInt(arquivo, "Fome"));
  148. SetPVarInt(playerid,"Sede", DOF2_GetInt(arquivo, "Sede"));
  149. SetPVarInt(playerid,"Sono", DOF2_GetInt(arquivo, "Sono"));
  150. SetProgressBarValue(barfome, DOF2_GetInt(arquivo, "Fome"));
  151. SetProgressBarValue(barsede, DOF2_GetInt(arquivo, "Sede"));
  152. SetProgressBarValue(barsono, DOF2_GetInt(arquivo, "Sono"));
  153. UpdateProgressBar(barfome, playerid);
  154. UpdateProgressBar(barsede, playerid);
  155. UpdateProgressBar(barsono, playerid);
  156. format(diimenor, sizeof(diimenor), "Carregando necessidades de %s", PlayerName(playerid));
  157. print(diimenor);
  158. }
  159. else
  160. {
  161. DOF2_CreateFile(arquivo);
  162. DOF2_SetInt(arquivo, "Fome", 100);
  163. DOF2_SetInt(arquivo, "Sede", 100);
  164. DOF2_SetInt(arquivo, "Sono", 100);
  165. SetPVarInt(playerid,"Fome", DOF2_GetInt(arquivo, "Fome"));
  166. SetPVarInt(playerid,"Sede", DOF2_GetInt(arquivo, "Sede"));
  167. SetPVarInt(playerid,"Sono", DOF2_GetInt(arquivo, "Sono"));
  168. SetProgressBarValue(barfome, DOF2_GetInt(arquivo, "Fome"));
  169. SetProgressBarValue(barsede, DOF2_GetInt(arquivo, "Sede"));
  170. SetProgressBarValue(barsono, DOF2_GetInt(arquivo, "Sono"));
  171. UpdateProgressBar(barfome, playerid);
  172. UpdateProgressBar(barsede, playerid);
  173. UpdateProgressBar(barsono, playerid);
  174. DOF2_SaveFile();
  175. format(diimenor, sizeof(diimenor), "Criando arquivo de necessidades de %s", PlayerName(playerid));
  176. print(diimenor);
  177. }
  178. return 1;
  179. }
  180. forward Fome(playerid);
  181. public Fome(playerid)
  182. {
  183. SetPVarInt(playerid,"Fome", GetPVarInt(playerid,"Fome")-1);
  184. SetProgressBarValue(barfome, GetPVarInt(playerid,"Fome"));
  185. UpdateProgressBar(barfome,playerid);
  186. if(GetPVarInt(playerid,"Fome") <= 10)
  187. {
  188. SendClientMessage(playerid,-1,"Vá até a lanchonete comer ou irá morrer de fome!");
  189. }
  190. if(GetPVarInt(playerid,"Fome") <= 0)
  191. {
  192. SetPlayerHealth(playerid, 0);
  193. SendClientMessage(playerid, -1, "Você morreu de fome. Coma algo na lanchonete!");
  194. mFome[playerid] = true;
  195. }
  196. return 1;
  197. }
  198. forward Sono(playerid);
  199. public Sono(playerid)
  200. {
  201. SetPVarInt(playerid,"Sono",GetPVarInt(playerid,"Sono")-1);
  202. SetProgressBarValue(barsono, GetPVarInt(playerid,"Sono"));
  203. UpdateProgressBar(barsono,playerid);
  204. if(GetPVarInt(playerid,"Sono") <= 10)
  205. {
  206. SendClientMessage(playerid,-1,"Você esta passando mal por excesso de sono, se não durmir podera desmaiar.");
  207. SetPlayerDrunkLevel(playerid, 4000);
  208. }
  209. if(GetPVarInt(playerid,"Sono") <= 0)
  210. {
  211. SetPlayerDrunkLevel(playerid, 0);
  212. ApplyAnimation(playerid,"CRACK", "crckdeth2", 4.0, 1, 1, 1, 1, 0);
  213. fadeIn(playerid, 8000, 0x000000FF);
  214. KillTimer(ContagemSono[playerid]);
  215. SendClientMessage(playerid, -1,"Você desmaiou por excesso de sono...");
  216. SetTimerEx("AcordarDes", 40000, false, "i", playerid);
  217. TogglePlayerControllable(playerid, false);
  218. }
  219. return 1;
  220. }
  221. forward Sede(playerid);
  222. public Sede(playerid)
  223. {
  224. SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")-1);
  225. SetProgressBarValue(barsede, GetPVarInt(playerid,"Sede"));
  226. UpdateProgressBar(barsede,playerid);
  227. if(GetPVarInt(playerid,"Sede") <= 10)
  228. {
  229. SendClientMessage(playerid,-1,"Você está com fome, coma algo na lanchonete ou ira morrer!");
  230. }
  231. if(GetPVarInt(playerid,"Sede")<= 0)
  232. {
  233. SetPlayerHealth(playerid, 0);
  234. SendClientMessage(playerid, -1, "Você morreu desnutrido. Beba algo na lanchonete!");
  235. mSede[playerid] = true;
  236. }
  237. return 1;
  238. }
  239. forward Acordar(playerid);
  240. public Acordar(playerid)
  241. {
  242. TogglePlayerControllable(playerid, true);
  243. fadeOut(playerid, 10000, 0x000000FF);
  244. ClearAnimations(playerid);
  245. ContagemSono[playerid] = SetTimerEx("Sono", 35000, true, "i", playerid);
  246. SetProgressBarValue(barsono, 100);
  247. UpdateProgressBar(barsono, playerid);
  248. SetPVarInt(playerid,"Sono", 100);
  249. return 1;
  250. }
  251. forward AcordarDes(playerid);
  252. public AcordarDes(playerid)
  253. {
  254. TogglePlayerControllable(playerid, true);
  255. fadeOut(playerid, 10000, 0x000000FF);
  256. ClearAnimations(playerid);
  257. ContagemSono[playerid] = SetTimerEx("Sono", 35000, true, "i", playerid);
  258. SetProgressBarValue(barsono, 30);
  259. UpdateProgressBar(barsono, playerid);
  260. SetPVarInt(playerid,"Sono", 30);
  261. SendClientMessage(playerid, -1,"Você acordou, durma (/durmir) para não desmaiar novamente!");
  262. return 1;
  263. }
  264. public OnPlayerDeath(playerid ,killerid, reason)
  265. {
  266. if(mFome[playerid] == true)
  267. {
  268. SetProgressBarValue(barfome, 30);
  269. UpdateProgressBar(barfome, playerid);
  270. SetPVarInt(playerid,"Fome", 30);
  271. mSede[playerid] = false;
  272. }
  273. else if(mSede[playerid] == true)
  274. {
  275. SetProgressBarValue(barsede, 30);
  276. SetPVarInt(playerid,"Sede", 30);
  277. UpdateProgressBar(barsede, playerid);
  278. mSede[playerid] = false;
  279. }
  280. return 1;
  281. }
  282. forward SalvarDiiMeNoR(playerid);
  283. public SalvarDiiMeNoR(playerid)
  284. {
  285. format(arquivo, sizeof(arquivo), PASTA_CONTAS, PlayerName(playerid));
  286. if(DOF2_FileExists(arquivo))
  287. {
  288. DOF2_SetInt(arquivo, "Fome", GetPVarInt(playerid,"Fome"));
  289. DOF2_SetInt(arquivo, "Sede", GetPVarInt(playerid,"Sede"));
  290. DOF2_SetInt(arquivo, "Sono", GetPVarInt(playerid,"Sono"));
  291. DOF2_SaveFile();
  292. }
  293. return 1;
  294. }
  295. public OnPlayerDisconnect(playerid, reason)
  296. {
  297. SalvarDiiMeNoR(playerid);
  298. return 1;
  299. }
  300. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  301. {
  302. if(dialogid == CARDAPIO)
  303. {
  304. if(!response) { return 1; }
  305. switch(listitem)
  306. {
  307. case 0://Pizza
  308. {
  309. if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$50 para comprar!");
  310. if(GetPVarInt(playerid,"Fome") >= 100) return SendClientMessage(playerid,-1,"Você está satisfeito, não precisa mais de comida!");
  311. ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  312. GivePlayerMoney(playerid, -50);
  313. SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Pizza'");
  314. SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+10);
  315. SetProgressBarValue(barfome, GetPVarInt(playerid,"Fome"));
  316. UpdateProgressBar(barfome,playerid);
  317. }
  318. case 1://Macarronada
  319. {
  320. if(GetPlayerMoney(playerid) < 20) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$20 para comprar!");
  321. if(GetPVarInt(playerid,"Fome") >= 100) return SendClientMessage(playerid,-1,"Você está satisfeito, não precisa mais de comida!");
  322. ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  323. GivePlayerMoney(playerid, -20);
  324. SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Macarronada'");
  325. SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+15);
  326. SetProgressBarValue(barfome, GetPVarInt(playerid,"Fome"));
  327. UpdateProgressBar(barfome,playerid);
  328. }
  329. case 2://Marmitex
  330. {
  331. if(GetPlayerMoney(playerid) < 12) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$12 para comprar!");
  332. if(GetPVarInt(playerid,"Fome") >= 100) return SendClientMessage(playerid,-1,"Você está satisfeito, não precisa mais de comida!");
  333. ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  334. GivePlayerMoney(playerid, -12);
  335. SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Marmitéx'");
  336. SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+10);
  337. SetProgressBarValue(barfome, GetPVarInt(playerid,"Fome"));
  338. UpdateProgressBar(barfome,playerid);
  339. }
  340. case 3://Salmão Grelhado
  341. {
  342. if(GetPlayerMoney(playerid) < 20) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$20 para comprar!");
  343. if(GetPVarInt(playerid,"Fome") >= 100) return SendClientMessage(playerid,-1,"Você está satisfeito, não precisa mais de comida!");
  344. ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  345. GivePlayerMoney(playerid, -20);
  346. SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Salmão Grelhado'");
  347. SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+30);
  348. SetProgressBarValue(barfome, GetPVarInt(playerid,"Fome"));
  349. UpdateProgressBar(barfome,playerid);
  350. }
  351. case 4://Bacalhau
  352. {
  353. if(GetPlayerMoney(playerid) < 21) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$21 para comprar!");
  354. if(GetPVarInt(playerid,"Fome") >= 100) return SendClientMessage(playerid,-1,"Você está satisfeito, não precisa mais de comida!");
  355. ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  356. GivePlayerMoney(playerid, -21);
  357. SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Bacalhau'");
  358. SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+20);
  359. SetProgressBarValue(barfome, GetPVarInt(playerid,"Fome"));
  360. UpdateProgressBar(barfome,playerid);
  361. }
  362. case 5://Agua
  363. {
  364. if(GetPlayerMoney(playerid) < 5) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$5 para comprar!");
  365. if(GetPVarInt(playerid,"Sede") >= 100) return SendClientMessage(playerid,-1,"Você está satisfeito, não precisa mais de bebida!");
  366. ApplyAnimation(playerid,"VENDING","VEND_Drink_P",4.1,0,1,1,0,1);
  367. GivePlayerMoney(playerid, -5);
  368. SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de beber 'Água'");
  369. SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")+5);
  370. SetProgressBarValue(barsede, GetPVarInt(playerid,"Sede"));
  371. UpdateProgressBar(barsede,playerid);
  372. }
  373. case 6://Suco
  374. {
  375. if(GetPlayerMoney(playerid) < 12) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$12 para comprar!");
  376. if(GetPVarInt(playerid,"Sede") >= 100) return SendClientMessage(playerid,-1,"Você está satisfeito, não precisa mais de bebida!");
  377. ApplyAnimation(playerid,"VENDING","VEND_Drink_P",4.1,0,1,1,0,1);
  378. GivePlayerMoney(playerid, -12);
  379. SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de beber 'Suco'");
  380. SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")+10);
  381. SetProgressBarValue(barsede, GetPVarInt(playerid,"Sede"));
  382. UpdateProgressBar(barsede, playerid);
  383. }
  384. case 7://Refrigerante
  385. {
  386. if(GetPlayerMoney(playerid) < 17) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$17 para comprar!");
  387. if(GetPVarInt(playerid,"Sede") >= 100) return SendClientMessage(playerid,-1,"Você está satisfeito, não precisa mais de bebida!");
  388. ApplyAnimation(playerid,"VENDING","VEND_Drink_P",4.1,0,1,1,0,1);
  389. GivePlayerMoney(playerid, -17);
  390. SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de beber 'Refrigerante'");
  391. SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")+15);
  392. SetProgressBarValue(barsede, GetPVarInt(playerid,"Sede"));
  393. UpdateProgressBar(barsede,playerid);
  394. }
  395. case 8://Energetico
  396. {
  397. if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$100 para comprar!");
  398. if(GetPVarInt(playerid,"Sede") >= 100) return SendClientMessage(playerid,-1,"Você está satisfeito, não precisa mais de bebida!");
  399. ApplyAnimation(playerid,"VENDING","VEND_Drink_P",4.1,0,1,1,0,1);
  400. GivePlayerMoney(playerid,-100);
  401. SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de beber 'Energetico'");
  402. SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")+40);
  403. SetProgressBarValue(barsede, GetPVarInt(playerid,"Sede"));
  404. UpdateProgressBar(barsede,playerid);
  405. }
  406. }
  407. }
  408. if(dialogid == HOTEL)
  409. {
  410. if(response)
  411. {
  412. if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, -1,"|HOTEL| Você não tem R$100 para alugar!");
  413. if(GetPVarInt(playerid,"Sono") >= 75) return SendClientMessage(playerid,-1,"|INFO| Você não esta com sono!");
  414. SetPlayerPos(playerid, 345.4432,302.6292,999.9382);
  415. SetPlayerInterior(playerid, 6);
  416. SendClientMessage(playerid, -1, "|Hotel| Para dumir use (/durmir), em cima da cama");
  417. GivePlayerMoney(playerid, -100);
  418.  
  419. }
  420. else
  421. {
  422. SendClientMessage(playerid, -1, "Você optou por não alugar, pode durmir em sua casa.");
  423. }
  424. }
  425. return 0;
  426. }
  427. forward Corrigir(playerid);
  428. public Corrigir(playerid)
  429. {
  430. if(GetPVarInt(playerid,"Sede") > 100)
  431. {
  432. SetPVarInt(playerid,"Sede", 100);
  433. SetProgressBarValue(barsede, GetPVarInt(playerid,"Sede"));
  434. UpdateProgressBar(barsede,playerid);
  435. }
  436. if(GetPVarInt(playerid,"Fome") > 100)
  437. {
  438. SetPVarInt(playerid,"Fome", 100);
  439. SetProgressBarValue(barsede, GetPVarInt(playerid,"Fome"));
  440. UpdateProgressBar(barsede, playerid);
  441. }
  442. return false;
  443. }
  444. CMD:cardapio(playerid)
  445. {
  446. if(lanchonete[playerid] == true)
  447. {
  448. ShowPlayerDialog(playerid, CARDAPIO ,DIALOG_STYLE_LIST,"Cardápio Lanchonete","- Pizza\t{00EE76}R$150\n- Macarronada\t{00EE76}R$200\n- Marmitex\t{00EE76}R$120\n- Salmão Grelhado\t{00EE76}R$200\n- Bacalhau\t{00EE76}R$210\n- Água\t{00EE76}R$5\n- Suco\t{00EE76}R$12\n- Refrigerante\t{00EE76}R$17\n- Energetico\t{00EE76}R$100\n\n","Aceitar","Cancelar");
  449. }
  450. else
  451. {
  452. SendClientMessage(playerid, -1,"[ERRO]Você não esta na lanchonete!");
  453. }
  454. return 1;
  455. }
  456. CMD:durmir(playerid)
  457. {
  458. if(!IsPlayerInRangeOfPoint(playerid, 2.0, 345.4432,302.6292,999.9382)) return SendClientMessage(playerid,-1,"|INFO| Você não esta em cima da cama!");
  459. if(GetPVarInt(playerid,"Sono") >= 75) return SendClientMessage(playerid,-1,"|INFO| Você não esta com sono!");
  460. TogglePlayerControllable(playerid, false);
  461. SetPlayerDrunkLevel(playerid, 0);
  462. ApplyAnimation(playerid,"CRACK", "crckdeth2", 4.0, 1, 1, 1, 1, 0);
  463. KillTimer(ContagemSono[playerid]);
  464. fadeIn(playerid, 8000, 0x000000FF);
  465. SetTimerEx("Acordar", 40000, false, "i", playerid);
  466. return 1;
  467. }
  468. stock Objetos()
  469. {
  470. CreateObject(16781, 1355.200000, -1553.700000, 12.400000, 0.000000, 0.000000, 254.000000);
  471. Cercas[0] = CreateObject(1408, 1358.100000, -1570.600000, 13.100000, 0.000000, 0.000000, 345.000000);
  472. Cercas[1] = CreateObject(1408, 1353.100000, -1569.200000, 13.100000, 0.000000, 0.000000, 344.998000);
  473. Cercas[2] = CreateObject(1408, 1348.100000, -1567.800000, 13.100000, 0.000000, 0.000000, 344.998000);
  474. Cercas[3] = CreateObject(1408, 1343.100000, -1566.400000, 13.100000, 0.000000, 0.000000, 344.998000);
  475. Cercas[4] = CreateObject(1408, 1330.300000, -1563.000000, 13.100000, 0.000000, 0.000000, 346.998000);
  476. Cercas[5] = CreateObject(1408, 1325.200000, -1562.300000, 13.100000, 0.000000, 0.000000, 356.998000);
  477. Cercas[6] = CreateObject(1408, 1327.900000, -1537.000000, 13.100000, 0.000000, 0.000000, 248.000000);
  478. Cercas[7] = CreateObject(1408, 1326.100000, -1541.900000, 13.100000, 0.000000, 0.000000, 252.000000);
  479. Cercas[8] = CreateObject(1408, 1324.900000, -1546.900000, 13.100000, 0.000000, 0.000000, 262.000000);
  480. Cercas[9] = CreateObject(1408, 1324.100000, -1552.000000, 13.100000, 0.000000, 0.000000, 260.000000);
  481. Cercas[10] = CreateObject(1408, 1323.300000, -1557.100000, 13.100000, 0.000000, 0.000000, 262.000000);
  482. Cercas[11] = CreateObject(1408, 1323.000000, -1559.500000, 13.100000, 0.000000, 0.000000, 262.000000);
  483. CreateObject(4100, 1336.100000, -1535.000000, 14.200000, 0.000000, 0.000000, 316.000000);
  484. CreateObject(4100, 1349.700000, -1536.200000, 14.200000, 0.000000, 0.000000, 314.000000);
  485. CreateObject(4100, 1363.100000, -1538.900000, 14.200000, 0.000000, 0.000000, 304.000000);
  486. CreateObject(1594, 1325.900000, -1559.800000, 13.000000, 0.000000, 0.000000, 0.000000);
  487. CreateObject(1594, 1330.900000, -1560.000000, 13.000000, 0.000000, 0.000000, 0.000000);
  488. CreateObject(1594, 1346.100000, -1544.600000, 13.000000, 0.000000, 0.000000, 0.000000);
  489. CreateObject(14657, 1334.600000, -1543.400000, 13.100000, 0.000000, 0.000000, 84.000000);
  490. CreateObject(1281, 1334.700000, -1544.000000, 13.300000, 0.000000, 0.000000, 0.000000);
  491. CreateObject(1582, 1334.100000, -1549.500000, 13.400000, 0.000000, 0.000000, 0.000000);
  492. CreateObject(2420, 1341.100000, -1565.900000, 12.800000, 0.000000, 0.000000, 344.000000);
  493. CreateObject(955, 1350.600000, -1555.700000, 12.500000, 0.000000, 0.000000, 256.000000);
  494. }
  495. stock PlayerName(playerid)
  496. {
  497. static name[MAX_PLAYER_NAME];
  498. GetPlayerName(playerid,name,sizeof(name));
  499. return name;
  500. }
  501.  
  502. /*
  503.  
  504. |||||||| || || |||||| |||||| ||||||||||| |||||| || |||||||||||| ||||||||
  505. || || || || || || || || || || || || || ||
  506. || || || || || || || || || || || || || || || ||
  507. || || || || || || || || || || || || || || || ||
  508. || || || || || |||| || || || || || || || |||||||||||
  509. || || || || || || ||||||||| || || || || || || ||
  510. || || || || || || || || || || || || || ||
  511. || || || || || || || || || || || || || ||
  512. || || || || || || || || || || || || || || ||
  513. |||||||| || || || || ||||||||||| || |||| |||||||||||| || ||
  514.  
  515. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  516. Sistema de necessidades básicas como Fome, Sede e Sono em ProgressBar com salvamento.
  517. Creditos reservados;
  518. ~ Toribio pela include 'progress'
  519. ~ Steki pela include 'Stewie` Fader'
  520. ~ Créditos ao criador da 'DOF2'
  521. ~ Créditos ao criador da 'zcmd'
  522. *** Restante dos créditos reservados totalmente a mim 'DiiMeNoR' pela total criação do sistema.
  523. ~ Creditos ao meu amigo Alwe.
  524. mateusqzs.wix.com/diimenorstreet
  525. mateusqzs.wix.com/diimenorstreet
  526. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  527. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement