Advertisement
Guest User

Untitled

a guest
Jan 27th, 2010
1,695
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.24 KB | None | 0 0
  1. // Weapon Var
  2.  
  3. #define GivePlayerWeapon(%1,%2,%3) GivePlayerGun(%1,%2,%3)
  4.  
  5. new
  6. Brass[MAX_PLAYERS],
  7. Golf[MAX_PLAYERS],
  8. NiteStick[MAX_PLAYERS],
  9. Knife[MAX_PLAYERS],
  10. BaseBall[MAX_PLAYERS],
  11. Shovel[MAX_PLAYERS],
  12. Pool[MAX_PLAYERS],
  13. Katana[MAX_PLAYERS],
  14. ChainSaw[MAX_PLAYERS],
  15. PurpleDil[MAX_PLAYERS],
  16. SmallWhiteDil[MAX_PLAYERS],
  17. LargeWhiteDil[MAX_PLAYERS],
  18. SilverDil[MAX_PLAYERS],
  19. Flowers[MAX_PLAYERS],
  20. Cane[MAX_PLAYERS],
  21. Grenade[MAX_PLAYERS],
  22. TearGas[MAX_PLAYERS],
  23. Molitov[MAX_PLAYERS],
  24. Ninemm[MAX_PLAYERS],
  25. Silenced9mm[MAX_PLAYERS],
  26. DesertEagle[MAX_PLAYERS],
  27. Shotgun[MAX_PLAYERS],
  28. SawnOffShotgun[MAX_PLAYERS],
  29. CombatShotgun[MAX_PLAYERS],
  30. MicroSMG[MAX_PLAYERS],
  31. SMG[MAX_PLAYERS],
  32. AK47[MAX_PLAYERS],
  33. M4[MAX_PLAYERS],
  34. Tec9[MAX_PLAYERS],
  35. CountryRifle[MAX_PLAYERS],
  36. SniperRifle[MAX_PLAYERS],
  37. Rocket[MAX_PLAYERS],
  38. HeatSeakingRocket[MAX_PLAYERS],
  39. FlameThrower[MAX_PLAYERS],
  40. MiniGun[MAX_PLAYERS],
  41. Satchel[MAX_PLAYERS],
  42. Detonator[MAX_PLAYERS],
  43. SprayCan[MAX_PLAYERS],
  44. Fire[MAX_PLAYERS],
  45. Camera[MAX_PLAYERS],
  46. NightVision[MAX_PLAYERS],
  47. ThermalVision[MAX_PLAYERS],
  48. Parachute[MAX_PLAYERS];
  49.  
  50. stock ResetPlayerWeaponStats(playerid)
  51. {
  52. Parachute[playerid] = 0;
  53. ThermalVision[playerid] = 0;
  54. NightVision[playerid] = 0;
  55. Camera[playerid] = 0;
  56. Fire[playerid] = 0;
  57. SprayCan[playerid] = 0;
  58. Detonator[playerid] = 0;
  59. Satchel[playerid] = 0;
  60. MiniGun[playerid] = 0;
  61. FlameThrower[playerid] = 0;
  62. HeatSeakingRocket[playerid] = 0;
  63. Rocket[playerid] = 0;
  64. SniperRifle[playerid] = 0;
  65. CountryRifle[playerid] = 0;
  66. Tec9[playerid] = 0;
  67. M4[playerid] = 0;
  68. AK47[playerid] = 0;
  69. SMG[playerid] = 0;
  70. MicroSMG[playerid] = 0;
  71. CombatShotgun[playerid] = 0;
  72. SawnOffShotgun[playerid] = 0;
  73. Shotgun[playerid] = 0;
  74. DesertEagle[playerid] = 0;
  75. Silenced9mm[playerid] = 0;
  76. Ninemm[playerid] = 0;
  77. Molitov[playerid] = 0;
  78. TearGas[playerid] = 0;
  79. Grenade[playerid] = 0;
  80. Cane[playerid] = 0;
  81. Flowers[playerid] = 0;
  82. SilverDil[playerid] = 0;
  83. LargeWhiteDil[playerid] = 0;
  84. SmallWhiteDil[playerid] = 0;
  85. PurpleDil[playerid] = 0;
  86. ChainSaw[playerid] = 0;
  87. Katana[playerid] = 0;
  88. Pool[playerid] = 0;
  89. Shovel[playerid] = 0;
  90. BaseBall[playerid] = 0;
  91. Knife[playerid] = 0;
  92. NiteStick[playerid] = 0;
  93. Golf[playerid] = 0;
  94. Brass[playerid] = 0;
  95. }
  96.  
  97. stock StartServerSideWeapon()
  98. {
  99. SetTimer("UpdateWeapons", 1000, 1);
  100. }
  101.  
  102. stock GivePlayerGun(playerid, Gun, Ammo)
  103. {
  104. if(Gun == 1) { Brass[playerid] = 1; }
  105. if(Gun == 2) { Golf[playerid] = 1; }
  106. if(Gun == 3) { NiteStick[playerid] = 1; }
  107. if(Gun == 4) { Knife[playerid] = 1; }
  108. if(Gun == 5) { BaseBall[playerid] = 1; }
  109. if(Gun == 6) { Shovel[playerid] = 1; }
  110. if(Gun == 7) { Pool[playerid] = 1; }
  111. if(Gun == 8) { Katana[playerid] = 1; }
  112. if(Gun == 9) { ChainSaw[playerid] = 1; }
  113. if(Gun == 10) { PurpleDil[playerid] = 1; }
  114. if(Gun == 11) { SmallWhiteDil[playerid] = 1; }
  115. if(Gun == 12) { LargeWhiteDil[playerid] = 1; }
  116. if(Gun == 13) { SilverDil[playerid] = 1; }
  117. if(Gun == 14) { Flowers[playerid] = 1; }
  118. if(Gun == 15) { Cane[playerid] = 1; }
  119. if(Gun == 16) { Grenade[playerid] = 1; }
  120. if(Gun == 17) { TearGas[playerid] = 1; }
  121. if(Gun == 18) { Molitov[playerid] = 1; }
  122. if(Gun == 22) { Ninemm[playerid] = 1; }
  123. if(Gun == 23) { Silenced9mm[playerid] = 1; }
  124. if(Gun == 25) { Shotgun[playerid] = 1; }
  125. if(Gun == 26) { SawnOffShotgun[playerid] = 1; }
  126. if(Gun == 27) { CombatShotgun[playerid] = 1; }
  127. if(Gun == 28) { MicroSMG[playerid] = 1; }
  128. if(Gun == 29) { SMG[playerid] = 1; }
  129. if(Gun == 30) { AK47[playerid] = 1; }
  130. if(Gun == 31) { M4[playerid] = 1; }
  131. if(Gun == 32) { Tec9[playerid] = 1; }
  132. if(Gun == 33) { CountryRifle[playerid] = 1; }
  133. if(Gun == 34) { SniperRifle[playerid] = 1; }
  134. if(Gun == 35) { Rocket[playerid] = 1; }
  135. if(Gun == 36) { HeatSeakingRocket[playerid] = 1; }
  136. if(Gun == 37) { FlameThrower[playerid] = 1; }
  137. if(Gun == 38) { MiniGun[playerid] = 1; }
  138. if(Gun == 39) { Satchel[playerid] = 1; }
  139. if(Gun == 40) { Detonator[playerid] = 1; }
  140. if(Gun == 41) { SprayCan[playerid] = 1; }
  141. if(Gun == 42) { Fire[playerid] = 1; }
  142. if(Gun == 43) { Camera[playerid] = 1; }
  143. if(Gun == 44) { NightVision[playerid] = 1; }
  144. if(Gun == 45) { ThermalVision[playerid] = 1; }
  145. if(Gun == 46) { Parachute[playerid] = 1; }
  146. GivePlayerWeapon(playerid, Gun, Ammo);
  147. }
  148.  
  149. forward UpdateWeapons();
  150. public UpdateWeapons()
  151. {
  152. for(new i=0; i<MAX_PLAYERS; i++)
  153. {
  154. if(IsPlayerConnected(i))
  155. {
  156. if(Brass[i] == 0 && GetPlayerWeapon(i) == 1)
  157. {
  158. BanEx(i, "Weapon Hacks");
  159. }
  160. else if(Golf[i] == 0 && GetPlayerWeapon(i) == 2)
  161. {
  162. BanEx(i, "Weapon Hacks");
  163. }
  164. else if(NiteStick[i] == 0 && GetPlayerWeapon(i) == 3)
  165. {
  166. BanEx(i, "Weapon Hacks");
  167. }
  168. else if(Knife[i] == 0 && GetPlayerWeapon(i) == 4)
  169. {
  170. BanEx(i, "Weapon Hacks");
  171. }
  172. else if(BaseBall[i] == 0 && GetPlayerWeapon(i) == 5)
  173. {
  174. BanEx(i, "Weapon Hacks");
  175. }
  176. else if(Shovel[i] == 0 && GetPlayerWeapon(i) == 6)
  177. {
  178. BanEx(i, "Weapon Hacks");
  179. }
  180. else if(Pool[i] == 0 && GetPlayerWeapon(i) == 7)
  181. {
  182. BanEx(i, "Weapon Hacks");
  183. }
  184. else if(Katana[i] == 0 && GetPlayerWeapon(i) == 8)
  185. {
  186. BanEx(i, "Weapon Hacks");
  187. }
  188. else if(ChainSaw[i] == 0 && GetPlayerWeapon(i) == 9)
  189. {
  190. BanEx(i, "Weapon Hacks");
  191. }
  192. else if(PurpleDil[i] == 0 && GetPlayerWeapon(i) == 10)
  193. {
  194. BanEx(i, "Weapon Hacks");
  195. }
  196. else if(SmallWhiteDil[i] == 0 && GetPlayerWeapon(i) == 11)
  197. {
  198. BanEx(i, "Weapon Hacks");
  199. }
  200. else if(LargeWhiteDil[i] == 0 && GetPlayerWeapon(i) == 12)
  201. {
  202. BanEx(i, "Weapon Hacks");
  203. }
  204. else if(SilverDil[i] == 0 && GetPlayerWeapon(i) == 13)
  205. {
  206. BanEx(i, "Weapon Hacks");
  207. }
  208. else if(Flowers[i] == 0 && GetPlayerWeapon(i) == 14)
  209. {
  210. BanEx(i, "Weapon Hacks");
  211. }
  212. else if(Cane[i] == 0 && GetPlayerWeapon(i) == 15)
  213. {
  214. BanEx(i, "Weapon Hacks");
  215. }
  216. else if(Grenade[i] == 0 && GetPlayerWeapon(i) == 16)
  217. {
  218. BanEx(i, "Weapon Hacks");
  219. }
  220. else if(TearGas[i] == 0 && GetPlayerWeapon(i) == 17)
  221. {
  222. BanEx(i, "Weapon Hacks");
  223. }
  224. else if(Molitov[i] == 0 && GetPlayerWeapon(i) == 18)
  225. {
  226. BanEx(i, "Weapon Hacks");
  227. }
  228. else if(Ninemm[i] == 0 && GetPlayerWeapon(i) == 22)
  229. {
  230. BanEx(i, "Weapon Hacks");
  231. }
  232. else if(Silenced9mm[i] == 0 && GetPlayerWeapon(i) == 23)
  233. {
  234. BanEx(i, "Weapon Hacks");
  235. }
  236. else if(DesertEagle[i] == 0 && GetPlayerWeapon(i) == 24)
  237. {
  238. BanEx(i, "Weapon Hacks");
  239. }
  240. else if(Shotgun[i] == 0 && GetPlayerWeapon(i) == 25)
  241. {
  242. BanEx(i, "Weapon Hacks");
  243. }
  244. else if(SawnOffShotgun[i] == 0 && GetPlayerWeapon(i) == 26)
  245. {
  246. BanEx(i, "Weapon Hacks");
  247. }
  248. else if(CombatShotgun[i] == 0 && GetPlayerWeapon(i) == 27)
  249. {
  250. BanEx(i, "Weapon Hacks");
  251. }
  252. else if(MicroSMG[i] == 0 && GetPlayerWeapon(i) == 28)
  253. {
  254. BanEx(i, "Weapon Hacks");
  255. }
  256. else if(SMG[i] == 0 && GetPlayerWeapon(i) == 29)
  257. {
  258. BanEx(i, "Weapon Hacks");
  259. }
  260. else if(AK47[i] == 0 && GetPlayerWeapon(i) == 30)
  261. {
  262. BanEx(i, "Weapon Hacks");
  263. }
  264. else if(M4[i] == 0 && GetPlayerWeapon(i) == 31)
  265. {
  266. BanEx(i, "Weapon Hacks");
  267. }
  268. else if(Tec9[i] == 0 && GetPlayerWeapon(i) == 32)
  269. {
  270. BanEx(i, "Weapon Hacks");
  271. }
  272. else if(CountryRifle[i] == 0 && GetPlayerWeapon(i) == 33)
  273. {
  274. BanEx(i, "Weapon Hacks");
  275. }
  276. else if(SniperRifle[i] == 0 && GetPlayerWeapon(i) == 34)
  277. {
  278. BanEx(i, "Weapon Hacks");
  279. }
  280. else if(Rocket[i] == 0 && GetPlayerWeapon(i) == 35)
  281. {
  282. BanEx(i, "Weapon Hacks");
  283. }
  284. else if(HeatSeakingRocket[i] == 0 && GetPlayerWeapon(i) == 36)
  285. {
  286. BanEx(i, "Weapon Hacks");
  287. }
  288. else if(FlameThrower[i] == 0 && GetPlayerWeapon(i) == 37)
  289. {
  290. BanEx(i, "Weapon Hacks");
  291. }
  292. else if(MiniGun[i] == 0 && GetPlayerWeapon(i) == 38)
  293. {
  294. BanEx(i, "Weapon Hacks");
  295. }
  296. else if(Satchel[i] == 0 && GetPlayerWeapon(i) == 39)
  297. {
  298. BanEx(i, "Weapon Hacks");
  299. }
  300. else if(Detonator[i] == 0 && GetPlayerWeapon(i) == 40)
  301. {
  302. BanEx(i, "Weapon Hacks");
  303. }
  304. else if(SprayCan[i] == 0 && GetPlayerWeapon(i) == 41)
  305. {
  306. BanEx(i, "Weapon Hacks");
  307. }
  308. else if(Fire[i] == 0 && GetPlayerWeapon(i) == 42)
  309. {
  310. BanEx(i, "Weapon Hacks");
  311. }
  312. else if(Camera[i] == 0 && GetPlayerWeapon(i) == 43)
  313. {
  314. BanEx(i, "Weapon Hacks");
  315. }
  316. else if(NightVision[i] == 0 && GetPlayerWeapon(i) == 44)
  317. {
  318. BanEx(i, "Weapon Hacks");
  319. }
  320. else if(ThermalVision[i] == 0 && GetPlayerWeapon(i) == 45)
  321. {
  322. BanEx(i, "Weapon Hacks");
  323. }
  324. else if(Parachute[i] == 0 && GetPlayerWeapon(i) == 46)
  325. {
  326. BanEx(i, "Weapon Hacks");
  327. }
  328. }
  329. }
  330. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement