Advertisement
Guest User

[FS] Kaciga System i pojas System

a guest
Jul 18th, 2012
659
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.63 KB | None | 0 0
  1. if(strcmp(cmd, "/kaciga", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. GetPlayerName(playerid, sendername, sizeof(sendername));
  6. new length = strlen(cmdtext);
  7. while ((idx < length) && (cmdtext[idx] <= ' '))
  8. {
  9. idx++;
  10. }
  11. new offset = idx;
  12. new result[64];
  13. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  14. {
  15. result[idx - offset] = cmdtext[idx];
  16. idx++;
  17. }
  18. result[idx - offset] = EOS;
  19. if(!strlen(result) && IsABike(GetPlayerVehicleID(playerid)) == 0)
  20. { //line 124
  21. SendClientMessage(playerid, COLOR_GRAD2, "Moras biti na motoru!");
  22. return 1;
  23. }
  24. if(IsPlayerInAnyVehicle(playerid) == 1 && Pojas[playerid] == 0)
  25. {
  26. Pojas[playerid] = 1;
  27. SendClientMessage(playerid, COLOR_WHITE, "Stavili ste svoju kacigu.");
  28. format(string, sizeof(string), "* %s stavlja svoju kacigu.", sendername);
  29. switch(GetPlayerSkin(playerid))
  30. {
  31. #define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18645, 2, (%0), (%1), (%2), (%3), (%4), (%5));
  32. case 0, 65, 74, 149, 208, 273: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 75.000000, 0.000000}
  33. case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 77.000000, 0.000000}
  34. case 7, 10: SPAO{0.090000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
  35. case 9: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
  36. case 11..13: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
  37. case 15: SPAO{0.059999, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
  38. case 17..21: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  39. case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  40. case 40: SPAO{0.050000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  41. case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  42. case 51..54: SPAO{0.100000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  43. case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  44. case 59..62: SPAO{0.079999, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
  45. case 77: SPAO{0.059999, 0.019999, 0.000000, 87.000000, 82.000000, 0.000000}
  46. case 85, 88, 89: SPAO{0.070000, 0.039999, 0.000000, 88.000000, 82.000000, 0.000000}
  47. case 90..97: SPAO{0.050000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  48. case 132: SPAO{0.000000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  49. case 144..146: SPAO{0.090000, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
  50. case 220: SPAO{0.029999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  51. case 223, 246: SPAO{0.070000, 0.050000, 0.000000, 88.000000, 82.000000, 0.000000}
  52. case 224..245: SPAO{0.070000, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
  53. case 294: SPAO{0.070000, 0.019999, 0.000000, 91.000000, 84.000000, 0.000000}
  54. case 295: SPAO{0.050000, 0.019998, 0.000000, 86.000000, 82.000000, 0.000000}
  55. case 296..298: SPAO{0.064999, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
  56. case 299: SPAO{0.064998, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
  57. }
  58. }
  59. else if(IsPlayerInAnyVehicle(playerid) == 1 && Pojas[playerid] == 1)
  60. {
  61. Pojas[playerid] = 0;
  62. SendClientMessage(playerid, COLOR_WHITE, "Skinuli ste svoju kacigu");
  63. format(string, sizeof(string), "* %s skida svoju kacigu.", sendername);
  64. RemovePlayerAttachedObject(playerid, SLOT);
  65. }
  66. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  67. printf("%s", string);
  68. }
  69. return 1;
  70. }
  71. //-----------[Pojas]------------------
  72. if(strcmp(cmd, "/pojas", true) == 0)
  73. {
  74. if(IsPlayerConnected(playerid))
  75. {
  76. GetPlayerName(playerid, sendername, sizeof(sendername));
  77. new length = strlen(cmdtext);
  78. while ((idx < length) && (cmdtext[idx] <= ' '))
  79. {
  80. idx++;
  81. }
  82. new offset = idx;
  83. new result[64];
  84. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  85. {
  86. result[idx - offset] = cmdtext[idx];
  87. idx++;
  88. }
  89. result[idx - offset] = EOS;
  90. new model = GetVehicleModel(GetPlayerVehicleID(playerid));
  91.  
  92. if(model == 522 || model == 509 || model == 481 || model == 510 || model == 462 || model == 448 || model == 581 || model == 461 || model == 521 || model == 523 || model == 463 || model == 468 || model == 471)
  93. {
  94. SendClientMessage(playerid, COLOR_GRAD2, "Nisi u automobilu!");
  95. return 1;
  96. }
  97.  
  98. if(!strlen(result) && IsPlayerInAnyVehicle(playerid) == 0)
  99. { //line 124
  100. SendClientMessage(playerid, COLOR_GRAD2, "Morate biti u automobilu kako bih koristili ovu komandu.");
  101. return 1;
  102. }
  103. if(IsPlayerInAnyVehicle(playerid) == 1 && Pojas[playerid] == 0)
  104. {
  105. Pojas[playerid] = 1;
  106. SendClientMessage(playerid, COLOR_WHITE, "Stavili ste svoj pojas.");
  107. format(string, sizeof(string), "* %s stavlja svoj pojas.", sendername);
  108. }
  109. else if(IsPlayerInAnyVehicle(playerid) == 1 && Pojas[playerid] == 1)
  110. {
  111. Pojas[playerid] = 0;
  112. SendClientMessage(playerid, COLOR_WHITE, "Skinuli ste svoj pojas.");
  113. format(string, sizeof(string), "* %s skida svoj pojas.", sendername);
  114. }
  115. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  116. printf("%s", string);
  117. }
  118. return 1;
  119. }
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement