Guest User

update

a guest
Mar 16th, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.23 KB | None | 0 0
  1. public OnPlayerUpdate(playerid)
  2. {
  3. if(GetTickCount() - IsAttached[playerid] > 113)
  4. {
  5. new weaponid[13],weaponammo[13],pArmedWeapon;
  6. pArmedWeapon = GetPlayerWeapon(playerid);
  7. GetPlayerWeaponData(playerid,1,weaponid[1],weaponammo[1]);
  8. GetPlayerWeaponData(playerid,2,weaponid[2],weaponammo[2]);
  9. GetPlayerWeaponData(playerid,4,weaponid[4],weaponammo[4]);
  10. GetPlayerWeaponData(playerid,5,weaponid[5],weaponammo[5]);
  11. if(weaponid[1] && weaponammo[1] > 0)
  12. {
  13. if(pArmedWeapon != weaponid[1])
  14. {
  15. if(!IsPlayerAttachedObjectSlotUsed(playerid,0))
  16. {
  17. SetPlayerAttachedObject(playerid,0,GetWeaponModel(weaponid[1]),1, 0.199999, -0.139999, 0.030000, 0.500007, -115.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  18. }
  19. }
  20. else
  21. {
  22. if(IsPlayerAttachedObjectSlotUsed(playerid,0))
  23. {
  24. RemovePlayerAttachedObject(playerid,0);
  25. }
  26. }
  27. }
  28. else if(IsPlayerAttachedObjectSlotUsed(playerid,0))
  29. {
  30. RemovePlayerAttachedObject(playerid,0);
  31. }
  32. if(weaponid[2] && weaponammo[2] > 0)
  33. {
  34. if(pArmedWeapon != weaponid[2])
  35. {
  36. if(!IsPlayerAttachedObjectSlotUsed(playerid,1))
  37. {
  38. SetPlayerAttachedObject(playerid,1,GetWeaponModel(weaponid[2]),8, -0.079999, -0.039999, 0.109999, -90.100006, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  39. }
  40. }
  41. else {
  42. if(IsPlayerAttachedObjectSlotUsed(playerid,1))
  43. {
  44. RemovePlayerAttachedObject(playerid,1);
  45. }
  46. }
  47. }
  48. else if(IsPlayerAttachedObjectSlotUsed(playerid,1))
  49. {
  50. RemovePlayerAttachedObject(playerid,1);
  51. }
  52. if(weaponid[4] && weaponammo[4] > 0)
  53. {
  54. if(pArmedWeapon != weaponid[4])
  55. {
  56. if(!IsPlayerAttachedObjectSlotUsed(playerid,2))
  57. {
  58. SetPlayerAttachedObject(playerid,2,GetWeaponModel(weaponid[4]),7, 0.000000, -0.100000, -0.080000, -95.000000, -10.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  59. }
  60. }
  61. else {
  62. if(IsPlayerAttachedObjectSlotUsed(playerid,2))
  63. {
  64. RemovePlayerAttachedObject(playerid,2);
  65. }
  66. }
  67. }
  68. else if(IsPlayerAttachedObjectSlotUsed(playerid,2))
  69. {
  70. RemovePlayerAttachedObject(playerid,2);
  71. }
  72. if(weaponid[5] && weaponammo[5] > 0)
  73. {
  74. if(pArmedWeapon != weaponid[5])
  75. {
  76. if(!IsPlayerAttachedObjectSlotUsed(playerid,3))
  77. {
  78. SetPlayerAttachedObject(playerid,3,GetWeaponModel(weaponid[5]),1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  79. }
  80. }
  81. else {
  82. if(IsPlayerAttachedObjectSlotUsed(playerid,3))
  83. {
  84. RemovePlayerAttachedObject(playerid,3);
  85. }
  86. }
  87. }
  88. else if(IsPlayerAttachedObjectSlotUsed(playerid,3))
  89. {
  90. RemovePlayerAttachedObject(playerid,3);
  91. }
  92. IsAttached[playerid] = GetTickCount();
  93. }
  94. if(GetPVarInt(playerid, "laser") == 1)
  95. {
  96. RemovePlayerAttachedObject(playerid, 4);
  97. if((IsPlayerInAnyVehicle(playerid)) || (IsPlayerInWater(playerid))) return 1;
  98. switch (GetPlayerWeapon(playerid))
  99. {
  100. case 23:
  101. {
  102. if(IsPlayerAiming(playerid))
  103. {
  104. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  105. {
  106. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);
  107. }
  108. else
  109. {
  110. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);
  111. }
  112. }
  113. else
  114. {
  115. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  116. {
  117. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
  118. }
  119. else
  120. {
  121. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
  122. }
  123. }
  124. }
  125. case 27:
  126. {
  127. if(IsPlayerAiming(playerid))
  128. {
  129. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  130. {
  131. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.588246, -0.022766, 0.138052, -11.531745, 347.712585, 352.784271);
  132. }
  133. else
  134. {
  135. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.588246, -0.022766, 0.138052, 1.468254, 350.712585, 352.784271);
  136. }
  137. }
  138. else
  139. {
  140. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  141. {
  142. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
  143. }
  144. else
  145. {
  146. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
  147. }
  148. }
  149. }
  150. case 30:
  151. {
  152. if(IsPlayerAiming(playerid))
  153. {
  154. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  155. {
  156. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.628249, -0.027766, 0.078052, -6.621746, 352.552642, 355.084289);
  157. }
  158. else
  159. {
  160. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.628249, -0.027766, 0.078052, -1.621746, 356.202667, 355.084289);
  161. }
  162. }
  163. else
  164. {
  165. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  166. {
  167. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
  168. }
  169. else
  170. {
  171. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
  172. }
  173. }
  174. }
  175. case 31:
  176. {
  177. if(IsPlayerAiming(playerid))
  178. {
  179. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  180. {
  181. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);
  182. }
  183. else
  184. {
  185. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);
  186. }
  187. }
  188. else
  189. {
  190. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  191. {
  192. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
  193. }
  194. else
  195. {
  196. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
  197. }
  198. }
  199. }
  200. case 34:
  201. {
  202. if(IsPlayerAiming(playerid))
  203. {
  204. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  205. {
  206. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);
  207. }
  208. else
  209. {
  210. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);
  211. }
  212. }
  213. else
  214. {
  215. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  216. {
  217. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
  218. }
  219. else
  220. {
  221. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
  222. }
  223. }
  224. }
  225. case 29:
  226. {
  227. if(IsPlayerAiming(playerid))
  228. {
  229. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  230. {
  231. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.298249, -0.02776, 0.158052, -11.631746, 359.302673, 357.584259);
  232. }
  233. else
  234. {
  235. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.298249, -0.02776, 0.158052, 8.368253, 358.302673, 352.584259);
  236. }
  237. }
  238. else
  239. {
  240. if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
  241. {
  242. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
  243. }
  244. else
  245. {
  246. SetPlayerAttachedObject(playerid, 4, GetPVarInt(playerid, "color"), 6, 0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
  247. }
  248. }
  249. }
  250. }
  251. }
  252. new COPSKills_String[64] = "COPS : %i";
  253. new TerroristsKills_String[64] = "Terrorist : %i";
  254. if(COPSKills_Var >= 100)
  255. {
  256. COPSKills_Var = 0;
  257. TerroristsKills_Var = 0;
  258. SendClientMessageToAll(COLOR_LIME, "[ROUND] Team COPS Won's this round, all Player of Team COPS get 10Scores, 100$ And 5Cookies, Congratz Team COPS.");
  259. GiveScoreToTeam(TEAM_COPS, 10);
  260. GiveCashToTeam(TEAM_COPS, 100);
  261. GiveCookieToTeam(TEAM_COPS, 5);
  262. }
  263. if(TerroristsKills_Var >= 100)
  264. {
  265. COPSKills_Var = 0;
  266. TerroristsKills_Var = 0;
  267. SendClientMessageToAll(COLOR_LIME, "[ROUND] Team Terrorist Won's this round, all Player of Team Terrorist get 10Scores, 100$ And 5Cookies, Congratz Team Terrorist.");
  268. GiveScoreToTeam(TEAM_TERRORIST, 10);
  269. GiveCashToTeam(TEAM_TERRORIST, 100);
  270. GiveCookieToTeam(TEAM_TERRORIST, 5);
  271. }
  272. format(COPSKills_String, sizeof(COPSKills_String), COPSKills_String, COPSKills_Var);
  273. TextDrawSetString(COPSKills, COPSKills_String);
  274. format(TerroristsKills_String, sizeof(TerroristsKills_String), TerroristsKills_String, TerroristsKills_Var);
  275. TextDrawSetString(TerroristsKills, TerroristsKills_String);
  276. TextDrawShowForAll(COPSKills);
  277. TextDrawShowForAll(TerroristsKills);
  278. return 1;
  279. }
Advertisement
Add Comment
Please, Sign In to add comment