1. #include <a_samp>
  2. #include <zcmd>
  3. #define COLOR_RED 0xAA3333AA
  4. #define COLOR_GREEN 0x33AA33AA
  5. new UsingCamo;
  6. new OnCamoCooldown;
  7. forward CamoCooldown(playerid);
  8. forward CamoTimer(playerid);
  9. #if defined FILTERSCRIPT
  10. public OnFilterScriptInit()
  11. {
  12. print("\n--------------------------------------");
  13. print(" Blank Filterscript by your name here");
  14. print("--------------------------------------\n");
  15. return 1;
  16. }
  17. public OnFilterScriptExit()
  18. {
  19. return 1;
  20. }
  21. #else
  22. main()
  23. {
  24. print("\n----------------------------------");
  25. print(" Blank Gamemode by your name here");
  26. print("----------------------------------\n");
  27. }
  28. #endif
  29. public OnGameModeInit()
  30. {
  31. // Don't use these lines if it's a filterscript
  32. SetGameModeText("Blank Script");
  33. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  34. return 1;
  35. }
  36. public OnGameModeExit()
  37. {
  38. return 1;
  39. }
  40. public OnPlayerRequestClass(playerid, classid)
  41. {
  42. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  43. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  44. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  45. return 1;
  46. }
  47. public OnPlayerConnect(playerid)
  48. {
  49. return 1;
  50. }
  51. public OnPlayerDisconnect(playerid, reason)
  52. {
  53. return 1;
  54. }
  55. public OnPlayerSpawn(playerid)
  56. {
  57. return 1;
  58. }
  59. public OnPlayerDeath(playerid, killerid, reason)
  60. {
  61. return 1;
  62. }
  63. public OnVehicleSpawn(vehicleid)
  64. {
  65. return 1;
  66. }
  67. public OnVehicleDeath(vehicleid, killerid)
  68. {
  69. return 1;
  70. }
  71. public OnPlayerText(playerid, text[])
  72. {
  73. return 1;
  74. }
  75. public OnPlayerCommandText(playerid, cmdtext[])
  76. {
  77. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  78. {
  79. // Do something here
  80. return 1;
  81. }
  82. return 0;
  83. }
  84. stock randomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum;
  85. CMD:camo(playerid, params[])
  86. {
  87. if(UsingCamo == 0)
  88. {
  89. if(OnCamoCooldown == 0)
  90. {
  91. new Vw = randomEx(1,5);
  92. SetPlayerVirtualWorld(playerid, Vw);
  93. SetTimerEx("CamoTimer", 10000, false, "i", playerid);
  94. SetTimerEx("CamoCooldown", 100000, false, "i", playerid);
  95. UsingCamo = 1;
  96. }
  97. else
  98. {
  99. SendClientMessage(playerid, COLOR_RED, "<!>You are on a cooldown!");
  100. }
  101. }
  102. else
  103. {
  104. SendClientMessage(playerid, COLOR_RED, "<!>You are currently using it already!");
  105. }
  106. return 1;
  107. }
  108. public CamoCooldown(playerid)
  109. {
  110. SendClientMessage(playerid, COLOR_GREEN, "<!>Your camo timer has expired. You can now use it again!");
  111. OnCamoCooldown = 0;
  112. return 1;
  113. }
  114. public CamoTimer(playerid)
  115. {
  116. SetPlayerVirtualWorld(playerid, 0);
  117. UsingCamo = 0;
  118. SendClientMessage(playerid, COLOR_GREEN, "<!>Your camo has expired!");
  119. return 1;
  120. }