Advertisement
Guest User

Cinto Joao_VS

a guest
Sep 14th, 2011
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
  2. * Sistema de Cinto By: Joao_VS *
  3. * *
  4. * FilterScript Criado Por Joao_VS *
  5. * Se usar, manter os creditos. *
  6. *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  7.  
  8.  
  9. #include <a_samp>
  10. #include <a_players>
  11.  
  12. #define Roxo 0x8013E1FF
  13. #define Verde 0x33AA33A
  14. #define FILTERSCRIPT
  15. #define Amarelo 0xFFFF00AA
  16. #define Vermelho 0xFF000096
  17.  
  18. forward Tontura(playerid);
  19.  
  20. new CINTOSEG[MAX_PLAYERS];
  21. new Float:VeicleHealt ;
  22.  
  23. public OnFilterScriptInit()
  24. {
  25. }
  26.  
  27. public OnPlayerStateChange(playerid, newstate, oldstate)
  28. {
  29. if(newstate == PLAYER_STATE_DRIVER)
  30. {
  31. SendClientMessage(playerid,Amarelo,"Você está sem cinto, use /usar-cinto para se proteger! ");
  32. }
  33. return 1;
  34. }
  35.  
  36. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  37. {
  38. if(CINTOSEG[playerid] == 0)
  39. {
  40. GetPlayerHealth(playerid, VeicleHealt);
  41. SetPlayerHealth(playerid,VeicleHealt-7);
  42. SendClientMessage(playerid,Vermelho,"[BML] Você bateu sem o cinto de segurança, se machucou por isso! ");
  43. SetTimer("Tontura",10000,0);
  44. SetPlayerDrunkLevel(playerid, 30000);
  45. }
  46. return 1;
  47. }
  48.  
  49. public Tontura(playerid)
  50. {
  51. SetPlayerDrunkLevel(playerid, 0);
  52. return 1;
  53. }
  54. public OnPlayerCommandText(playerid, cmdtext[])
  55. {
  56. if(!strcmp(cmdtext, "/usar-cinto", true))
  57. {
  58. CINTOSEG[playerid] = 1;
  59. SendClientMessage(playerid,Verde,"[BML]: Você está usando cinto, agora está protegido! (/tirar-cinto)");
  60. SetPlayerWantedLevel(playerid, 0);
  61. return 1;
  62. }
  63. if(!strcmp(cmdtext, "/tirar-cinto", true))
  64. {
  65. CINTOSEG[playerid] = 0;
  66. SendClientMessage(playerid,Roxo,"[BML]: Cuidado, você está sem cinto, pode se machucar /usar-cinto");
  67. return 1;
  68. }
  69. return 0;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement