Guest User

Cinto de Segurança Por Lucas Emmanuel

a guest
Nov 25th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Sistema de Cinto de Segurança Criado Por Lucas Emmanuel. */
  2.  
  3. /* Ou Lucas-Fc Forum SAMP. */
  4.  
  5. /* Autorizado a implantação desse sistema em seu Gamemode, Caso Queira */
  6.  
  7.  
  8. /* Minha Primeira FS :P */
  9.  
  10. #include < a_samp.inc >
  11.  
  12. new Cinto[MAX_PLAYERS];
  13.  
  14. public OnFilterScriptInit()
  15. {
  16. print("\n----------------------------------------");
  17. print(" Cinto de Segurança Carregado Com Sucesso ");
  18. print("----------------------------------------\n");
  19. return 1;
  20. }
  21.  
  22. public OnPlayerSpawn(playerid)
  23. {
  24. Cinto[playerid] = 0;
  25. return 1;
  26. }
  27.  
  28. public OnPlayerDeath(playerid, killerid, reason)
  29. {
  30. Cinto[playerid] = 0;
  31. return 1;
  32. }
  33.  
  34. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  35. {
  36. if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  37. {
  38. if( Cinto[playerid] == 0 )
  39. {
  40. new Float: VidaP;
  41. GetPlayerHealth(playerid, VidaP);
  42. SetPlayerHealth(playerid, VidaP - 65);
  43. }
  44.  
  45. if( Cinto[playerid] == 1 )
  46. {
  47. new Float: VidaP;
  48. GetPlayerHealth(playerid, VidaP);
  49. SetPlayerHealth(playerid, VidaP - 10);
  50. }
  51. }
  52. return 1;
  53. }
  54.  
  55. public OnPlayerCommandText(playerid, cmdtext[])
  56. {
  57. if (strcmp("/Cinto", cmdtext, true, 10) == 0)
  58. {
  59. if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Você não está em um carro !");
  60. {
  61. Cinto[playerid] = 1;
  62. SendClientMessage(playerid, -1, "Você colocou seu Cinto de Segurança ! ");
  63. }
  64. return 1;
  65. }
  66. return 0;
  67. }
  68.  
  69. public OnPlayerExitVehicle(playerid, vehicleid)
  70. {
  71. Cinto[playerid] = 0;
  72. return 1;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment