Guest User

MJ's Helmet v1.0

a guest
Feb 3rd, 2012
885
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. /*
  2.  
  3. MasterJoker's Helmet System v1.0
  4. Created by MasterJoker
  5. Copyright (2012), February
  6.  
  7. */
  8.  
  9. #include <a_samp>
  10.  
  11. new IsPlayerWearingHelmet[MAX_PLAYERS];
  12.  
  13. #define COLOR_RED 0xFF0000FF
  14. #define COLOR_GREEN 0x008000FF
  15.  
  16. /* -------------------------------------------------------------------------- */
  17.  
  18. #if defined FILTERSCRIPT
  19.  
  20. #else
  21.  
  22. public OnFilterScriptInit()
  23. {
  24. print("--------------------------------------");
  25. print(" MasterJoker's Helmet System Loaded! ");
  26. print("--------------------------------------");
  27. return 1;
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32. print("--------------------------------------");
  33. print(" MasterJoker's Helmet System Unloaded!");
  34. print("--------------------------------------");
  35. return 1;
  36. }
  37.  
  38. #endif
  39.  
  40. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  41. {
  42. new vid = GetVehicleModel(vehicleid);
  43. new string[128],pname[MAX_PLAYER_NAME];
  44. GetPlayerName(playerid, pname, sizeof(pname));
  45. if(vid == 448 || vid == 461 || vid == 462 || vid == 463 || vid == 468 || vid == 471 ||
  46. vid == 481 || vid == 509 || vid == 510 || vid == 521 || vid == 522 || vid == 523 ||
  47. vid == 571 || vid == 581 || vid == 586)
  48. {
  49. if(IsPlayerWearingHelmet[playerid] == 0)
  50. {
  51. IsPlayerWearingHelmet[playerid] = 1;
  52. format(string, sizeof(string), "%s has wear his helmet (Safety Recommended!)", pname);
  53. SendClientMessageToAll(COLOR_RED, string);
  54. SendClientMessage(playerid, COLOR_GREEN, "Helmet sucessfully suit!");
  55. SetPlayerAttachedObject(playerid, 1, 18645, 2, 0.07, 0, 0, 88, 75, 0);
  56. }
  57. }
  58. return 1;
  59. }
  60.  
  61. public OnPlayerExitVehicle(playerid, vehicleid)
  62. {
  63. new string[128],pname[MAX_PLAYER_NAME];
  64. GetPlayerName(playerid, pname, sizeof(pname));
  65. if(IsPlayerWearingHelmet[playerid] == 1)
  66. {
  67. if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
  68. IsPlayerWearingHelmet[playerid] = 0;
  69. format(string, sizeof(string), "%s has remove his helmet", pname);
  70. SendClientMessageToAll(COLOR_RED, string);
  71. SendClientMessage(playerid, COLOR_GREEN, "Helmet sucessfully remove!");
  72. }
  73. return 1;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment