Guest User

GPSistem

a guest
Jun 19th, 2012
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.13 KB | None | 0 0
  1. #include <a_samp>
  2. #include <a_fini>
  3. /*Sistema de Grip Súina criado por CrazY_Fenix(Macknamara_Fenix) tem que ir no Hospital de LS para ser vacinado vlw.*/
  4. //#define FILTERSCRIPT
  5. enum pInfo{
  6.     pVacinado,
  7.     pGripado
  8. };//define a variavel pInfo para diminiur nosso trabalho
  9. //new UserInfo[pInfo][MAX_PLAYERS];//acopla o pInfo a variavel UserInfo
  10. forward PlayerNaoVacinado(playerid);
  11. forward CarregarGripe(playerid);
  12. new Float:vida;
  13. new pName[MAX_PLAYERS];
  14. new string[80];
  15. forward PlayerGripado(playerid);
  16. new UserInfo[pInfo][MAX_PLAYERS];
  17. #if defined FILTERSCRIPT
  18. #define COR_AZUL 0x2641FEAA
  19. #define COR_VERMELHO 0xFF0000FF
  20. public OnFilterScriptInit()
  21. {
  22.     print("\n-------------------------------------------------------------------------");
  23.     print(" [FS] Sistema de Gripe Súina");
  24.     print(" [FS] Sistema de Gripe SúinSistema criado por CrazY_Fenix(Mandrack_FreeZe)");
  25.     print(" [FS] Sistema de Gripe Súina carregado com sucesso. Não retire os Créditos");
  26.     print("---------------------------------------------------------------------------\n");
  27.     return 1;
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32.     return 1;
  33. }
  34.  
  35. main()
  36. /*{
  37.     print("\n----------------------------------");
  38.     print(" Blank Gamemode by your name here");
  39.     print("----------------------------------\n");
  40. }*/
  41.  
  42. #endif
  43.  
  44. public OnGameModeInit()
  45. {
  46.     AddStaticPickup(1240, 1, 1172.361572, -1319.914428, 15.395450, -1);
  47.     Create3DTextLabel("Compre a vacina da Gripe Súina aqui\n/comprarvacina", 0x2641FEAA, 1172.361572, -1319.914428, 15.395450, 10, 0, 0);
  48.     return 1;
  49. }
  50.  
  51. public OnGameModeExit()
  52. {
  53.     return 1;
  54. }
  55.  
  56. public OnPlayerRequestClass(playerid, classid)
  57. {
  58.     return 1;
  59. }
  60.  
  61. public OnPlayerRequestSpawn(playerid)
  62. {
  63.     return 1;
  64. }
  65.  
  66. public OnPlayerConnect(playerid)
  67. {
  68.     return 1;
  69. }
  70.  
  71. public OnPlayerDisconnect(playerid, reason)
  72. {
  73.     new string2[160];
  74.     GetPlayerName(playerid, pName, sizeof(pName));
  75.     format(string2, sizeof(string2), "gripe/%s.ini",pName);
  76.     if(Fini_Exists(string2))
  77.     {
  78.         GetPlayerName(playerid, pName, sizeof(pName));
  79.         format(string, sizeof(string), "gripe/%s.ini",pName);
  80.         Fini_OpenFile(string);
  81.         Fini_SetVal("Gripado", UserInfo[pGripado][playerid]);
  82.         Fini_SetVal("Vacinado", UserInfo[pVacinado][playerid]);
  83.         Fini_SaveFile(string);
  84.         Fini_CloseFile();
  85.         }
  86.     return 1;
  87. }
  88.  
  89. public OnPlayerSpawn(playerid)
  90. {
  91.     new string2[160];
  92.     GetPlayerName(playerid, pName, sizeof(pName));
  93.     format(string2, sizeof(string2), "gripe/%s.ini",pName);
  94.     Fini_OpenFile(string2);
  95.     if(Fini_Exists(string2))
  96.     {
  97.         UserInfo[pGripado][playerid] = Fini_GetValue("Gripado");
  98.         UserInfo[pVacinado][playerid] = Fini_GetValue("Vacinado");
  99.     }
  100.     else
  101.     {
  102.         GetPlayerName(playerid, pName, sizeof(pName));
  103.         format(string, sizeof(string), "gripe/%s.ini",pName);
  104.         Fini_Create(string);
  105.         Fini_SetVal("Gripado", UserInfo[pGripado][playerid]);
  106.         Fini_SetVal("Vacinado", UserInfo[pVacinado][playerid]);
  107.     }
  108.     Fini_CloseFile();
  109.     SetTimer("PlayerNaoVacinado",600000,true);
  110.     SetTimer("PlayerGripado",300000,true);
  111.     return 1;
  112. }
  113.  
  114. public OnPlayerDeath(playerid, killerid, reason)
  115. {
  116.     return 1;
  117. }
  118.  
  119. public OnVehicleSpawn(vehicleid)
  120. {
  121.     return 1;
  122. }
  123.  
  124. public OnVehicleDeath(vehicleid, killerid)
  125. {
  126.     return 1;
  127. }
  128.  
  129. public OnPlayerText(playerid, text[])
  130. {
  131.     return 1;
  132. }
  133.  
  134. public OnPlayerCommandText(playerid, cmdtext[])
  135. {
  136.     if (strcmp("/comprarcura", cmdtext, true, 10) == 0)
  137.     {
  138.         if (IsPlayerInRangeOfPoint(playerid, 3.0, 1172.361572, -1319.914428, 15.395450))
  139.         {
  140.         /*playervacinado[playerid] = 1;
  141.         SetPlayerHealth(playerid, 100.0);*/
  142.         SendClientMessage(playerid, 0xFF0000FF, "[Hospital] Ola, escolha seu tipo de Remédio/Vacina.");
  143.         ShowPlayerDialog(playerid, 1111, DIALOG_STYLE_LIST,"Lista de Remédios do Hospital", "Vacina da Gripe Súina\tR$100\nRemédio de Gripe\tR$30","Comprar","Cancelar");
  144.         }
  145.         else {
  146.         SendClientMessage(playerid, 0x2641FEAA, "Você não esta no hospital.");
  147.         }
  148.         return 1;
  149.     }
  150.     return 0;
  151. }
  152.  
  153. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  154. {
  155.     return 1;
  156. }
  157.  
  158. public OnPlayerExitVehicle(playerid, vehicleid)
  159. {
  160.     return 1;
  161. }
  162.  
  163. public OnPlayerStateChange(playerid, newstate, oldstate)
  164. {
  165.     return 1;
  166. }
  167.  
  168. public OnPlayerEnterCheckpoint(playerid)
  169. {
  170.     return 1;
  171. }
  172.  
  173. public OnPlayerLeaveCheckpoint(playerid)
  174. {
  175.     return 1;
  176. }
  177.  
  178. public OnPlayerEnterRaceCheckpoint(playerid)
  179. {
  180.     return 1;
  181. }
  182.  
  183. public OnPlayerLeaveRaceCheckpoint(playerid)
  184. {
  185.     return 1;
  186. }
  187.  
  188. public OnRconCommand(cmd[])
  189. {
  190.     return 1;
  191. }
  192.  
  193. public OnObjectMoved(objectid)
  194. {
  195.     return 1;
  196. }
  197.  
  198. public OnPlayerObjectMoved(playerid, objectid)
  199. {
  200.     return 1;
  201. }
  202.  
  203. public OnPlayerPickUpPickup(playerid, pickupid)
  204. {
  205.     return 1;
  206. }
  207.  
  208. public OnPlayerSelectedMenuRow(playerid, row)
  209. {
  210.     return 1;
  211. }
  212.  
  213. public OnPlayerExitedMenu(playerid)
  214. {
  215.     return 1;
  216. }
  217. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  218. {
  219. if(dialogid == 1111)
  220.    {
  221.       if(response)
  222.       {
  223.           if(listitem == 0)
  224.           {
  225.                 UserInfo[pVacinado][playerid] = 1;
  226.                 SetPlayerHealth(playerid, 100.0);
  227.                 SendClientMessage(playerid, 0xFF0000FF, "[Hospital] Você foi vacinado.");
  228.           }
  229.           if(listitem == 1)
  230.           {
  231.                 UserInfo[pGripado][playerid] = 1;
  232.                 SetPlayerHealth(playerid, 100.0);
  233.                 SendClientMessage(playerid, 0xFF0000FF, "[Hospital] Você tomou o medicamento e sua Gripe passou.");
  234.           }
  235.            }
  236.        }
  237.        //return true;
  238.   }
  239.  
  240. public PlayerNaoVacinado(playerid)
  241. {
  242. if (UserInfo[pVacinado][playerid] == 0)
  243. {
  244.     GetPlayerHealth(playerid, vida);
  245.     SetPlayerHealth(playerid,vida- 10);
  246.     SendClientMessage(playerid, 0xFF0000FF, "[OBS]Você ainda não tomou a vacina da Gripe súina. Vá até o hospital e tome a vacina.");
  247.     }
  248.     else {
  249.  
  250.     }
  251. }
  252.  
  253. public PlayerGripado(playerid)
  254. {
  255. if (UserInfo[pGripado][playerid] == 0)
  256. {
  257.     GetPlayerHealth(playerid, vida);
  258.     SetPlayerHealth(playerid,vida- 5);
  259.     SendClientMessage(playerid, 0xFF0000FF, "[OBS]Você ainda não tomou o remédio de Gripe(Normal). Vá até o hospital e tome a vacina para não perder mais vida.");
  260.     }
  261.     else {
  262.  
  263.     }
  264. }
  265.  
  266. public CarregarGripe(playerid)
  267. {
  268. }
Advertisement
Add Comment
Please, Sign In to add comment