Guest User

Untitled

a guest
Jul 18th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. /*
  2. * Created: 02.02.11
  3. * Author: OKStyle
  4. * Description: Armour 2.3
  5. */
  6. #include <a_samp>
  7. #include <zcmd>
  8. #define COLOR_INTERFACE_BODY 0xFDE39DAA
  9. public OnPlayerCommandText(playerid, cmdtext[])
  10. {
  11.  
  12. return 0;
  13. }
  14. public OnPlayerUpdate(playerid)
  15. {
  16. if(GetPVarInt(playerid, "Equipped") == 1)
  17. {
  18. RemovePlayerAttachedObject(playerid, 1);
  19. new Float:ap;
  20. GetPlayerArmour(playerid, ap);
  21. if(ap > 0) SetPlayerAttachedObject(playerid, 1, 19142, 1, 0.1, 0.05, 0.0, 0.0, 0.0, 0.0);
  22. }
  23. return 1;
  24. }
  25. public OnFilterScriptExit()
  26. {
  27. for(new i, j = GetMaxPlayers(); i != j; i++)
  28. {
  29. if(!IsPlayerConnected(i)) continue;
  30. if(IsPlayerNPC(i)) continue;
  31. if(GetPVarInt((i), "Equipped") != 1) continue;
  32. RemovePlayerAttachedObject(i, 1);
  33. RemovePlayerAttachedObject(i, 2);
  34. RemovePlayerAttachedObject(i, 3);
  35. RemovePlayerAttachedObject(i, 4);
  36. }
  37. return 1;
  38. }
  39. CMD:equip(playerid, params[])
  40. {
  41. if(GetPVarInt(playerid, "Equipped") != 0) return SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You are already equipped!");
  42. if(GetPlayerSkin(playerid) < 280 || GetPlayerSkin(playerid) > 288) return SendClientMessage(playerid, COLOR_INTERFACE_BODY, "This command is available only to the servants of the law.");
  43. SetPlayerAttachedObject(playerid, 1, 19142, 1, 0.1, 0.05, 0.0, 0.0, 0.0, 0.0);
  44. SetPlayerAttachedObject(playerid, 2, 19141, 2, 0.11, 0.0, 0.0, 0.0, 0.0, 0.0);
  45. SetPlayerAttachedObject(playerid, 3, 18637, 13, 0.35, 0.0, 0.0, 0.0, 0.0, 180.0);
  46. SetPlayerAttachedObject(playerid, 4, 18642, 7, 0.1, 0.0, -0.11, 0.0, -90.0, 90.0);
  47. GivePlayerWeapon(playerid, 3, 1);
  48. SetPlayerArmour(playerid, 100.0);
  49. SetPVarInt(playerid, "Equipped", 1);
  50. SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You outfits.");
  51. return 1;
  52. }
  53. CMD:equipoff(playerid, params[])
  54. {
  55. if(GetPVarInt(playerid, "Equipped") != 1) return SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You already unequipped!");
  56. new Float:ap;
  57. GetPlayerArmour(playerid, ap);
  58. if(ap > 0)
  59. {
  60. RemovePlayerAttachedObject(playerid, 1);
  61. SetPlayerArmour(playerid, 0.0);
  62. }
  63. RemovePlayerAttachedObject(playerid, 2);
  64. RemovePlayerAttachedObject(playerid, 3);
  65. RemovePlayerAttachedObject(playerid, 4);
  66. new weapons[13][2];
  67. for (new i; i < 13; i++)
  68. {
  69. GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
  70. }
  71. ResetPlayerWeapons(playerid);
  72. for (new i; i < 13; i++)
  73. {
  74. if(i == 1) continue;
  75. GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
  76. }
  77. SetPVarInt(playerid, "Equipped", 0);
  78. SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You undressed and disarmed.");
  79. return 1;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment