Guest User

Untitled

a guest
Jun 7th, 2015
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.37 KB | None | 0 0
  1.  
  2. public OnPlayerDeath(playerid, killerid, reason)
  3. {
  4. new string[256];
  5. for(new i; i<15; i++) {
  6. if(playerid == PlantDestroyer[i]) {
  7. format(string, sizeof(string), "%s (%s) failed to destroy %s's weed plantation because he was killed.", GetName(playerid), NumeFactiune(PlayerInfo[playerid][pMember]), NumeFactiune(i));
  8. SendRadioMessage(1, 0x3350FFFF, string);
  9. SendRadioMessage(2, 0x3350FFFF, string);
  10. SendRadioMessage(3, 0x3350FFFF, string);
  11. SendFamilyMessage(GetPlayerVirtualWorld(PlantDestroyer[i]), 0x3350FFFF, string);
  12. PlantDestroy[i] = 0;
  13. PlantDestroyer[i] = INVALID_PLAYER_ID;
  14. if(PlantPercentage[i] < 96) {
  15. PlantPercentage[i] += 5;
  16. format(string, sizeof(string), "UPDATE `factions` SET `PlantPercentage`='%d' WHERE `ID`='%d'", PlantPercentage[GetPlayerVirtualWorld(PlantDestroyer[i])], GetPlayerVirtualWorld(PlantDestroyer[i]));
  17. mysql_query(SQL, string);
  18. } else {
  19. PlantPercentage[i] = 100;
  20. format(string, sizeof(string), "UPDATE `factions` SET `PlantPercentage`='%d' WHERE `ID`='%d'", PlantPercentage[GetPlayerVirtualWorld(PlantDestroyer[i])], GetPlayerVirtualWorld(PlantDestroyer[i]));
  21. mysql_query(SQL, string);
  22. }
  23. }
  24. }
  25. inDrugs[playerid] = 0;
  26. if(CP[playerid] == 44) {
  27. new engine,lights,alarm,doors,bonnet,boot,objective;
  28. GetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
  29. SetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,0,bonnet,boot,objective);
  30. DestroyVehicle(JobCars[playerid]);
  31. format(string, sizeof(string), "You failed the mission because you got out of the car.");
  32. SendClientMessage(playerid, COLOR_ADMCHAT, string);
  33. CP[playerid] = 0;
  34. DisablePlayerCheckpoint(playerid);
  35. PlayerInfo[playerid][pWorking] = 0;
  36. workerz[4] --;
  37. }
  38. if(CP[playerid] == 45) {
  39. new engine,lights,alarm,doors,bonnet,boot,objective;
  40. GetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
  41. SetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,0,bonnet,boot,objective);
  42. DestroyVehicle(JobCars[playerid]);
  43. format(string, sizeof(string), "You failed the mission because you got out of the car.");
  44. SendClientMessage(playerid, COLOR_ADMCHAT, string);
  45. CP[playerid] = 0;
  46. DisablePlayerCheckpoint(playerid);
  47. PlayerInfo[playerid][pWorking] = 0;
  48. workerz[9] --;
  49. }
  50. if(PlayerInfo[playerid][pWorking] == 6) {
  51. new engine,lights,alarm,doors,bonnet,boot,objective;
  52. GetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
  53. SetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,0,bonnet,boot,objective);
  54. DestroyVehicle(JobCars[playerid]);
  55. format(string, sizeof(string), "You failed the mission because you got out of the car.");
  56. SendClientMessage(playerid, COLOR_ADMCHAT, string);
  57. CP[playerid] = 0;
  58. DisablePlayerCheckpoint(playerid);
  59. PlayerInfo[playerid][pWorking] = 0;
  60. tractor[playerid] = 0;
  61. tractorP[playerid] = 0;
  62. workerz[6] --;
  63. }
  64. if(killerid != INVALID_PLAYER_ID)
  65. {
  66. if(GetDistanceBetweenPlayers(killerid, playerid) > 40 && reason == 24)
  67. {
  68. new string5[472];
  69. format(string5, sizeof(string5), "{f03337}Distance Hack: %s killed %s from %.0f meters with Desert Eagle (40m Max)", GetName(killerid), GetName(playerid), GetDistanceBetweenPlayers(killerid, playerid));
  70. ABroadCast(COLOR_WHITE, string5, 1);
  71. format(string5, sizeof(string5), "{f03333}Distance Hack: %s is in zone %s and %s is in zone %s", GetName(killerid),GetPlayerZone(killerid), GetName(playerid), GetPlayerZone(playerid));
  72. ABroadCast(COLOR_WHITE, string5, 1);
  73. }
  74. if(GetDistanceBetweenPlayers(killerid, playerid) > 100 && reason == 31)
  75. {
  76. new string5[472];
  77. format(string5, sizeof(string5), "{f03337}Distance Hack: %s killed %s from %.0f meters with M4 (100m Max)", GetName(killerid), GetName(playerid), GetDistanceBetweenPlayers(killerid, playerid));
  78. ABroadCast(COLOR_WHITE, string5, 1);
  79. format(string5, sizeof(string5), "{f03333}Distance Hack: %s is in zone %s and %s is in zone %s", GetName(killerid),GetPlayerZone(killerid), GetName(playerid), GetPlayerZone(playerid));
  80. ABroadCast(COLOR_WHITE, string5, 1);
  81. }
  82. if(GetDistanceBetweenPlayers(killerid, playerid) > 35 && reason == 32)
  83. {
  84. new string5[472];
  85. format(string5, sizeof(string5), "{f03337}Distance Hack: %s killed %s from %.0f meters with TEC9 (35m Max)", GetName(killerid), GetName(playerid), GetDistanceBetweenPlayers(killerid, playerid));
  86. ABroadCast(COLOR_WHITE, string5, 1);
  87. format(string5, sizeof(string5), "{f03333}Distance Hack: %s is in zone %s and %s is in zone %s", GetName(killerid),GetPlayerZone(killerid), GetName(playerid), GetPlayerZone(playerid));
  88. ABroadCast(COLOR_WHITE, string5, 1);
  89. }
  90. if(GetDistanceBetweenPlayers(killerid, playerid) > 45 && reason == 27)
  91. {
  92. new string5[472];
  93. format(string5, sizeof(string5), "{f03337}Distance Hack: %s killed %s from %.0f meters with Combat Shotgun (45m Max)", GetName(killerid), GetName(playerid), GetDistanceBetweenPlayers(killerid, playerid));
  94. ABroadCast(COLOR_WHITE, string5, 1);
  95. format(string5, sizeof(string5), "{f03333}Distance Hack: %s is in zone %s and %s is in zone %s", GetName(killerid),GetPlayerZone(killerid), GetName(playerid), GetPlayerZone(playerid));
  96. ABroadCast(COLOR_WHITE, string5, 1);
  97. }
  98. if(GetDistanceBetweenPlayers(killerid, playerid) > 105 && reason == 33)
  99. {
  100. new string5[472];
  101. format(string5, sizeof(string5), "{f03337}Distance Hack: %s killed %s from %.0f meters with Rifle (105m Max)", GetName(killerid), GetName(playerid), GetDistanceBetweenPlayers(killerid, playerid));
  102. ABroadCast(COLOR_WHITE, string5, 1);
  103. format(string5, sizeof(string5), "{f03333}Distance Hack: %s is in zone %s and %s is in zone %s", GetName(killerid),GetPlayerZone(killerid), GetName(playerid), GetPlayerZone(playerid));
  104. ABroadCast(COLOR_WHITE, string5, 1);
  105. }
  106. // anti distance hack
  107. new name[MAX_PLAYER_NAME];
  108. new Float:px,Float:py,Float:pz;
  109. gPlayerUsingLoopingAnim[playerid] = 0;
  110. gPlayerSpawned[playerid] = 0;
  111. GetPlayerName(playerid, name, sizeof(name));
  112. PlayerInfo[playerid][pLocal] = INVALID_PLAYER_ID;
  113. GetPlayerPos(playerid, px, py, pz);
  114. new currentveh = GetPlayerVehicleID(playerid);
  115. printf("DEATH: %s was killed by %s with gun %d",name,GetName(killerid),reason);
  116. playerdeath[playerid] = 0;
  117. curatj[playerid] = 0;
  118. PlayerEnterTime[playerid]+=221;
  119. if(PlayerInfo[playerid][pTraining] == 1 && PlayerInfo[killerid][pTraining] == 1) {
  120. format(string, sizeof(string), "You killed %s.", GetName(playerid));
  121. SCM(killerid, COLOR_LIGHTBLUE, string);
  122. format(string, sizeof(string), "You were killed by %s.", GetName(killerid));
  123. SCM(playerid, COLOR_LIGHTBLUE, string);
  124. }
  125. if(CP[playerid] == 50)
  126. {
  127. CP[playerid] = 0;
  128. RemovePlayerAttachedObject(playerid,0);
  129. DisablePlayerCheckpoint(playerid);
  130. RemovePlayerAttachedObject(playerid,1);
  131.  
  132. format(string, sizeof(string), "Because you succesfully killed the robber you received %.1f% Popularity.", 0.1);
  133. SCM(killerid, COLOR_LIGHTRED, string);
  134. PlayerInfo[killerid][pPopularity] += 0.1;
  135. format(string, sizeof(string), "UPDATE `users` SET `Popularity`='%.1f' WHERE `NormalName`='%s'", PlayerInfo[killerid][pPopularity], PlayerInfo[killerid][pNormalName]);
  136. mysql_query(SQL, string);
  137. }
  138. if(CP[playerid] == 51)
  139. {
  140. CP[playerid] = 0;
  141. RemovePlayerAttachedObject(playerid,0);
  142. DisablePlayerCheckpoint(playerid);
  143. RemovePlayerAttachedObject(playerid,1);
  144. }
  145. if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER && !IsAPlane(currentveh))
  146. {
  147. GetPlayerName(playerid,name,sizeof(name));
  148. new kill[25];
  149. GetPlayerName(killerid,kill,sizeof(kill));
  150. format(string, sizeof(string), "{f03337}Warning: Player %s(%d) was killed by %s(%d) with drive-by.", name,playerid,kill,killerid);
  151. ABroadCast(COLOR_WHITE,string,1);
  152. }
  153. if(XDeaths[playerid] == 0)
  154. {
  155. LastDeath[playerid] = gettime();
  156. }
  157. XDeaths[playerid]++;
  158. if(XDeaths[playerid] == 2)
  159. {
  160. if((gettime() - LastDeath[playerid]) <= 2)
  161. {
  162. KickEx(playerid);
  163. return 1;
  164. }else
  165. if((gettime() - LastDeath[playerid]) > 2)
  166. {
  167. XDeaths[playerid]=0;
  168. }
  169. }
  170. if(killerid == playerid)
  171. {
  172. KickEx(killerid);
  173. return 1;
  174. }
  175. if(PlayerCuffed2[playerid] == 1)
  176. {
  177. PlayerCuffed2[playerid] = 0;
  178. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
  179. RemovePlayerAttachedObject(playerid,1);
  180. }
  181. if(PlayerInfo[killerid][pJailed] > 0)
  182. {
  183. format(string, sizeof(string), "{f03337}Warning: Player %s(%d) was killed by Jailed Player %s(%d).", GetName(playerid),playerid,GetName(killerid),killerid);
  184. ABroadCast(COLOR_WHITE,string,1);
  185. return 1;
  186. }
  187. if(reason == 38 && GetPlayerState(killerid) != PLAYER_STATE_DRIVER)
  188. {
  189. new kickname[25];
  190. if(IsPlayerConnected(killerid))
  191. {
  192. GetPlayerName(killerid, kickname, sizeof(kickname));
  193. format(string, 256, "{f03337}Warning: [%d]%s just killed a player with minigun, be sure he's not fake-killing.",killerid,kickname);
  194. ABroadCast(COLOR_WHITE,string,1);
  195. }
  196. }
  197. if(IsAMember(killerid) && IsACop(playerid) && PlayerInfo[killerid][pWantedLevel] > 0 && OnDuty[playerid] == 1) {
  198. format(string, sizeof(string), "Because you killed a cop on duty and you were having wanted you received %.1f% Popularity.", 0.1);
  199. SCM(killerid, COLOR_LIGHTGREEN, string);
  200. PlayerInfo[killerid][pPopularity] += 0.1;
  201. format(string, sizeof(string), "UPDATE `users` SET `Popularity`='%.1f' WHERE `NormalName`='%s'", PlayerInfo[killerid][pPopularity], PlayerInfo[killerid][pNormalName]);
  202. mysql_query(SQL, string);
  203.  
  204. format(string, sizeof(string), "Because you were on duty and got killed by a gangster with wanted you lost %.1f% Popularity.", 0.1);
  205. SCM(playerid, COLOR_LIGHTGREEN, string);
  206. PlayerInfo[playerid][pPopularity] -= 0.1;
  207. format(string, sizeof(string), "UPDATE `users` SET `Popularity`='%.1f' WHERE `NormalName`='%s'", PlayerInfo[playerid][pPopularity], PlayerInfo[playerid][pNormalName]);
  208. mysql_query(SQL, string);
  209. }
  210. if(IsAMember(playerid) && IsACop(killerid) && PlayerInfo[playerid][pWantedLevel] > 0 && OnDuty[killerid] == 1) {
  211. format(string, sizeof(string), "Because you killed a gangster with wanted and were on duty you received %.1f% Popularity.", 0.1);
  212. SCM(killerid, COLOR_LIGHTGREEN, string);
  213. PlayerInfo[killerid][pPopularity] += 0.1;
  214. format(string, sizeof(string), "UPDATE `users` SET `Popularity`='%.1f' WHERE `NormalName`='%s'", PlayerInfo[killerid][pPopularity], PlayerInfo[killerid][pNormalName]);
  215. mysql_query(SQL, string);
  216.  
  217. format(string, sizeof(string), "Because you had been on the police wanted list and got killed by an on-duty cop you lost %.1f% Popularity.", 0.1);
  218. SCM(playerid, COLOR_LIGHTGREEN, string);
  219. PlayerInfo[playerid][pPopularity] -= 0.1;
  220. format(string, sizeof(string), "UPDATE `users` SET `Popularity`='%.1f' WHERE `NormalName`='%s'", PlayerInfo[playerid][pPopularity], PlayerInfo[playerid][pNormalName]);
  221. mysql_query(SQL, string);
  222. }
  223. if(fight2[playerid] != 999)
  224. {
  225. SetPlayerVirtualWorld(fight2[playerid],0);
  226. fight2[fight2[playerid]] = 999;
  227. GivePlayerCash(fight2[playerid],2000);
  228. Update(fight2[playerid],pCashx);
  229. SCM(fight2[playerid],COLOR_LIGHTBLUE,"You won the fight and received $2,000.");
  230. new randomrp = random(6);
  231. if(randomrp == 5)
  232. {
  233. PlayerInfo[fight2[playerid]][pExp] += 1;
  234. Update(fight2[playerid],pRP);
  235. SCM(fight2[playerid],COLOR_LIGHTBLUE,"You received one respect points for win this race.");
  236. }
  237. new fightname[25];
  238. GetPlayerName(fight2[playerid],fightname,sizeof(fightname));
  239. for(new i=0; i < MAX_PLAYERS; i++)
  240. {
  241. if(IsPlayerInRangeOfPoint(i,15.0,1510.2313,-1058.1528,25.0625))
  242. {
  243. format(string,sizeof(string),"** %s won the fight.",fightname);
  244. SendClientMessage(i,COLOR_WHITE,string);
  245. }
  246. }
  247. if(PlayerInfo[fight2[playerid]][pChar] > 0)
  248. {
  249. SetPlayerSkin(fight2[playerid], PlayerInfo[fight2[playerid]][pChar]);
  250. }
  251. else
  252. {
  253. SetPlayerSkin(fight2[playerid], PlayerInfo[fight2[playerid]][pModel]);
  254. }
  255. TogglePlayerControllable(fight2[playerid], 1);
  256. SetPlayerPos(fight2[playerid],1510.46,-1059.55,25.0625);
  257. fighta = 0;
  258. fight2[playerid] = 999;
  259. fightr[playerid] = 1;
  260. return 1;
  261. }
  262. if(fight2n[playerid] != 999)
  263. {
  264. SetPlayerVirtualWorld(fight2n[playerid],0);
  265. fight2n[fight2n[playerid]] = 999;
  266. GivePlayerCash(fight2n[playerid],2000);
  267. Update(fight2n[playerid],pCashx);
  268. SCM(fight2n[playerid],COLOR_LIGHTBLUE,"You won the fight and received $2,000.");
  269. new randomrp = random(6);
  270. if(randomrp == 5)
  271. {
  272. PlayerInfo[fight2n[playerid]][pExp] += 1;
  273. Update(fight2n[playerid],pRP);
  274. SCM(fight2n[playerid],COLOR_LIGHTBLUE,"You received one respect points for win this race.");
  275. }
  276. new fightname[25];
  277. GetPlayerName(fight2n[playerid],fightname,sizeof(fightname));
  278. for(new i=0; i < MAX_PLAYERS; i++)
  279. {
  280. if(IsPlayerInRangeOfPoint(i,15.0,1328.1801,-1558.2500,13.5469))
  281. {
  282. format(string,sizeof(string),"** %s won the ninja fight.",fightname);
  283. SendClientMessage(i,COLOR_WHITE,string);
  284. }
  285. }
  286. ResetPlayerWeaponsEx(fight2n[playerid]);
  287. ResetPlayerWeapons(fight2n[playerid]);
  288. if(PlayerInfo[fight2n[playerid]][pChar] > 0)
  289. {
  290. SetPlayerSkin(fight2n[playerid], PlayerInfo[fight2n[playerid]][pChar]);
  291. }
  292. else
  293. {
  294. SetPlayerSkin(fight2n[playerid], PlayerInfo[fight2n[playerid]][pModel]);
  295. }
  296. TogglePlayerControllable(fight2n[playerid], 1);
  297. SetPlayerPos(fight2n[playerid],1328.1801,-1558.2500,13.5469);
  298. fightnin = 0;
  299. fight2n[playerid] = 999;
  300. fightrn[playerid] = 1;
  301. return 1;
  302. }
  303. if(startrace == 1 && playerrace[playerid] != 0)
  304. {
  305. playerrace[playerid] = 0;
  306. for(new i=0; i < MAX_PLAYERS; i++)
  307. {
  308. if(playerrace[i] != 0)
  309. {
  310. playerrace[i] = 0;
  311. SetPlayerPos(i, SBizzInfo[23][sbEntranceX],SBizzInfo[23][sbEntranceY],SBizzInfo[23][sbEntranceZ]);
  312. SetPlayerInterior(i, 0);
  313. DisablePlayerCheckpoint(i);
  314. }
  315. }
  316. startrace=0;
  317. racewinner=999;
  318. SetVehicleToRespawn(hotc[1]);
  319. SetVehicleToRespawn(hotc[2]);
  320. Gas[hotc[1]] = GasMax;
  321. Gas[hotc[1]] = GasMax;
  322. }
  323. if(startsrace == 1 && playerraces[playerid] != 0)
  324. {
  325. playerraces[playerid] = 0;
  326. for(new i=0; i < MAX_PLAYERS; i++)
  327. {
  328. if(playerraces[i] != 0)
  329. {
  330. playerraces[i] = 0;
  331. SetPlayerPos(i, SBizzInfo[25][sbEntranceX],SBizzInfo[25][sbEntranceY],SBizzInfo[25][sbEntranceZ]);
  332. SetPlayerInterior(i, 0);
  333. DisablePlayerCheckpoint(i);
  334. }
  335. }
  336. startsrace=0;
  337. raceswinner=999;
  338. SetVehicleToRespawn(sanr[1]);
  339. SetVehicleToRespawn(sanr[2]);
  340. Gas[sanr[1]] = GasMax;
  341. Gas[sanr[1]] = GasMax;
  342. }
  343. if(TakingLesson[playerid] == 1)
  344. {
  345. TakingLesson[playerid] = 0;
  346. DisablePlayerCheckpoint(playerid);
  347. SetVehicleToRespawn(currentveh);
  348. }
  349. if(gPlayerUsingLoopingAnim[playerid])
  350. {
  351. gPlayerUsingLoopingAnim[playerid] = 0;
  352. }
  353. if(PlayerInfo[playerid][pCarLicT] == 0 && PlayerInfo[playerid][pCarLic] == 1)
  354. {
  355. PlayerInfo[playerid][pCarLic] = 0;
  356. PlayerInfo[playerid][pCarLicT] = 0;
  357. new str[128];
  358. format(str,128,"UPDATE users SET `CarLic`='0',`CarLicT`='0' WHERE `NormalName`='%s'",PlayerInfo[playerid][pNormalName]);
  359. mysql_query(SQL,str);
  360. SCM(playerid,COLOR_GRAD1,"Your driving license has expired.");
  361. }
  362. if(PlayerInfo[playerid][pFlyLicT] == 0 && PlayerInfo[playerid][pFlyLic] == 1)
  363. {
  364. PlayerInfo[playerid][pFlyLic] = 0;
  365. PlayerInfo[playerid][pFlyLicT] = 0;
  366. new str[128];
  367. format(str,128,"UPDATE users SET `FlyLic`='0',`FlyLicT`='0' WHERE `NormalName`='%s'", PlayerInfo[playerid][pNormalName]);
  368. mysql_query(SQL,str);
  369. SCM(playerid,COLOR_GRAD1,"Your flying license has expired.");
  370. }
  371. if(PlayerInfo[playerid][pBoatLicT] == 0 && PlayerInfo[playerid][pBoatLic] == 1)
  372. {
  373. PlayerInfo[playerid][pBoatLic] = 0;
  374. PlayerInfo[playerid][pBoatLic] = 0;
  375. new str[128];
  376. format(str,128,"UPDATE users SET `BoatLic`='0',`BoatLicT`='0' WHERE `NormalName`='%s'", PlayerInfo[playerid][pNormalName]);
  377. mysql_query(SQL,str);
  378. SCM(playerid,COLOR_GRAD1,"Your boat license has expired.");
  379. }
  380. if(PlayerInfo[playerid][pFishLicT] == 0 && PlayerInfo[playerid][pFishLic] == 1)
  381. {
  382. PlayerInfo[playerid][pFishLic] = 0;
  383. PlayerInfo[playerid][pFishLicT] = 0;
  384. new str[128];
  385. format(str,128,"UPDATE users SET `FishLic`='0',`FishLicT`='0' WHERE `NormalName`='%s'", PlayerInfo[playerid][pNormalName]);
  386. mysql_query(SQL,str);
  387. SCM(playerid,COLOR_GRAD1,"Your fish license has expired.");
  388. }
  389. if(PlayerInfo[playerid][pGunLicT] == 0 && PlayerInfo[playerid][pGunLic] == 1)
  390. {
  391. PlayerInfo[playerid][pGunLic] = 0;
  392. PlayerInfo[playerid][pGunLicT] = 0;
  393. new str[128];
  394. format(str,128,"UPDATE users SET `GunLic`='0',`GunLicT`='0' WHERE `NormalName`='%s'", PlayerInfo[playerid][pNormalName]);
  395. mysql_query(SQL,str);
  396. SCM(playerid,COLOR_GRAD1,"Your gun license has expired.");
  397. }
  398. new fpm,fkm,var[128];
  399. fpm = PlayerInfo[playerid][pMember];
  400. fkm = PlayerInfo[killerid][pMember];
  401. for(new turf = 1; turf < sizeof(TurfInfo); turf++)
  402. {
  403. if(GetPlayerVirtualWorld(playerid) == 420) {
  404. if(IsPlayerInTurf(playerid, turf) && IsPlayerInTurf(killerid, turf))
  405. {
  406. if(IsAMember(playerid) && IsAMember(killerid))
  407. {
  408. if(WarInfo[turf][wFaction] == fpm && WarInfo[turf][wAttacker] == fkm || WarInfo[turf][wFaction] == fkm && WarInfo[turf][wAttacker] == fpm)
  409. {
  410. if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER) return SCM(playerid,COLOR_WHITE, "No points for you.");
  411. if(fkm == WarInfo[turf][wAttacker] || fkm == WarInfo[turf][wFaction])
  412. {
  413. WarScoreF[fkm][turf] += 1.0;
  414. }
  415. ucideri[killerid] ++;
  416. decese[playerid] ++;
  417. format(var, sizeof(var), "UPDATE `users` SET `k`='%d' WHERE `NormalName`='%s'",ucideri[killerid], PlayerInfo[killerid][pNormalName]);
  418. mysql_query(SQL ,var);
  419. format(var, sizeof(var), "UPDATE `users` SET `d`='%d' WHERE `NormalName`='%s'",decese[playerid], PlayerInfo[playerid][pNormalName]);
  420. mysql_query(SQL ,var);
  421.  
  422. if(PlayerInfo[killerid][pMember] == WarInfo[turf][wAttacker])
  423. {
  424. if(ucideri[killerid] > bestscoreat[turf])
  425. {
  426. bestscoreat[turf] = ucideri[killerid];
  427. bestmemberat[turf] = killerid;
  428. }
  429. }
  430. if(PlayerInfo[killerid][pMember] == WarInfo[turf][wFaction])
  431. {
  432. if(ucideri[killerid] > bestscoredf[turf])
  433. {
  434. bestscoredf[turf] = ucideri[killerid];
  435. bestmemberdf[turf] = killerid;
  436. }
  437. }
  438. if(PlayerInfo[playerid][pMember] == WarInfo[turf][wAttacker])
  439. {
  440. if(decese[playerid] > worstscoreat[turf])
  441. {
  442. worstscoreat[turf] = decese[playerid];
  443. worstmemberat[turf] = playerid;
  444. }
  445. }
  446. if(PlayerInfo[playerid][pMember] == WarInfo[turf][wFaction])
  447. {
  448. if(decese[playerid] > worstscoredf[turf])
  449. {
  450. worstscoredf[turf] = decese[playerid];
  451. worstmemberdf[turf] = playerid;
  452. }
  453. }
  454. format(string, sizeof(string), "Turf %s (%d): You killed %s", TurfName(turf),turf,GetName(playerid));
  455. SCM(killerid, TEAM_AZTECAS_COLOR, string);
  456. format(string, sizeof(string), "Turf %s (%d): You were killed by %s", TurfName(turf),turf,GetName(killerid));
  457. SCM(playerid, TEAM_AZTECAS_COLOR, string);
  458. new Float:HPP[MAX_PLAYERS];
  459. GetPlayerHealth(killerid, HPP[killerid]);
  460. if(HPP[killerid] + 10 >= 100) {
  461. SetPlayerHealthEx(killerid, 100);
  462. } else {
  463. SetPlayerHealthEx(killerid, HPP[killerid] + 10);
  464. }
  465. new weap[128];
  466. SendClientMessage(killerid, COLOR_LIGHTBLUE, "You received 10 Health Points.");
  467.  
  468. if(GetPlayerWeapon(playerid) == 24 || GetPlayerWeapon(playerid) == 27 || GetPlayerWeapon(playerid) == 32 || GetPlayerWeapon(playerid) == 31 || GetPlayerWeapon(playerid) == 33) {
  469. new faw[MAX_PLAYERS];
  470. faw[killerid] = GetPlayerWeapon(killerid);
  471. GivePlayerWeaponEx(killerid, GetPlayerWeapon(playerid), 150);
  472. GetWeaponName(GetPlayerWeapon(playerid), weap, sizeof(weap));
  473. format(string,sizeof(string), "You received a %s with 150 ammo.", weap);
  474. SendClientMessage(killerid, COLOR_LIGHTBLUE, string);
  475. SetPlayerArmedWeapon(killerid, faw[killerid]);
  476. }
  477. for(new i=0; i < MAX_PLAYERS; i++)
  478. {
  479. if(PlayerInfo[i][pMember] == WarInfo[turf][wAttacker] || PlayerInfo[i][pMember] == WarInfo[turf][wFaction])
  480. SendDeathMessageToPlayer(i, killerid, playerid, reason);
  481. }
  482. return 1;
  483. }
  484. }
  485. }
  486. }
  487. }
  488. if(IsACop(killerid) && OnDuty[killerid] == 1)
  489. {
  490. if(PlayerInfo[playerid][pWantedLevel] >= 1)
  491. {
  492. new price = PlayerInfo[playerid][pWantedLevel] * 1000;
  493. new count;
  494. new wantedlost2 = PlayerInfo[playerid][pWantedLevel];
  495. for(new i=0; i < MAX_PLAYERS; i++)
  496. {
  497. if(IsACop(i) && CrimInRange(30.0, playerid,i) && OnDuty[i] == 1)
  498. {
  499. count = 1;
  500. format(string, sizeof(string), "~w~Running Suspect ~r~Killed~n~~r~Bonus ~g~$%d", price);
  501. GameTextForPlayer(i, string, 5000, 1);
  502. ConsumingMoney[i] = 1;
  503. GivePlayerCash(i, price/2);
  504. Update(i, pCashx);
  505. }
  506. }
  507. if(count == 1)
  508. {
  509. GivePlayerCash(playerid, - price);
  510. PlayerInfo[playerid][pWantedDeaths] += 1;
  511. PlayerInfo[playerid][pJailed] = 1;
  512. PlayerInfo[playerid][pJailTime] = (PlayerInfo[playerid][pWantedLevel])*(150);
  513. new sendername[30];
  514. GetPlayerName(killerid,sendername,sizeof(sendername));
  515. format(string, sizeof(string), "* You are in Jail for %d Seconds and lose $%d because of running away and getting shot by the Officer %s.", PlayerInfo[playerid][pJailTime], price,sendername);
  516. SendClientMessage(playerid, COLOR_YELLOW, string);
  517. TogglePlayerControllable(playerid, 0);
  518. SetTimerEx("UnFreezeStation", 1000, false, "i", playerid);
  519. WantedPoints[playerid] = 0;
  520. PlayerInfo[playerid][pWantedLevel] = 0;
  521. SetPlayerWantedLevel(playerid, 0);
  522. Update(playerid,pWantedLevelx);
  523. Update(playerid,pJailedx);
  524. Update(playerid,pJailTimex);
  525. ClearCrime(playerid);
  526. new deathname[25];
  527. GetPlayerName(playerid,deathname,sizeof(deathname));
  528. if(PlayerInfo[killerid][pMember] == 1 || PlayerInfo[killerid][pLeader] == 1)
  529. {
  530. format(string, sizeof(string), "HQ: All Units. LSPD Officer %s has completed assignment",sendername);
  531. SendTeamMessage(1, COLOR_DBLUE, string);
  532. SendTeamMessage(2, COLOR_DBLUE, string);
  533. SendTeamMessage(3, COLOR_DBLUE, string);
  534. format(string, sizeof(string), "HQ: %s has been processed, got killed having wanted %d",deathname,wantedlost2);
  535. SendTeamMessage(1, COLOR_DBLUE, string);
  536. SendTeamMessage(2, COLOR_DBLUE, string);
  537. SendTeamMessage(3, COLOR_DBLUE, string);
  538. }
  539. else if(PlayerInfo[killerid][pMember] == 2 || PlayerInfo[killerid][pLeader] == 2)
  540. {
  541. format(string, sizeof(string), "HQ: All Units. FBI Agent %s has completed assignment",sendername);
  542. SendTeamMessage(1, COLOR_DBLUE, string);
  543. SendTeamMessage(2, COLOR_DBLUE, string);
  544. SendTeamMessage(3, COLOR_DBLUE, string);
  545. format(string, sizeof(string), "HQ: %s has been processed, got killed having wanted %d",deathname,wantedlost2);
  546. SendTeamMessage(1, COLOR_DBLUE, string);
  547. SendTeamMessage(2, COLOR_DBLUE, string);
  548. SendTeamMessage(3, COLOR_DBLUE, string);
  549. }
  550. else if(PlayerInfo[killerid][pMember] == 3 || PlayerInfo[killerid][pLeader] == 3)
  551. {
  552. format(string, sizeof(string), "HQ: All Units. NG Soldier %s has completed assignment",sendername);
  553. SendTeamMessage(1, COLOR_DBLUE, string);
  554. SendTeamMessage(2, COLOR_DBLUE, string);
  555. SendTeamMessage(3, COLOR_DBLUE, string);
  556. format(string, sizeof(string), "HQ: %s has been processed, got killed having wanted %d",deathname,wantedlost2);
  557. SendTeamMessage(1, COLOR_DBLUE, string);
  558. SendTeamMessage(2, COLOR_DBLUE, string);
  559. SendTeamMessage(3, COLOR_DBLUE, string);
  560. }
  561. }
  562. }
  563. }
  564. if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
  565. {
  566. DisablePlayerCheckpoint(playerid);
  567. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  568. }
  569. new caller = Mobile[playerid];
  570. if(caller != INVALID_PLAYER_ID)
  571. {
  572. SendClientMessage(caller, COLOR_GRAD2, "The line just went dead....");
  573. CellTime[caller] = 0;
  574. CellTime[playerid] = 0;
  575. Mobile[caller] = INVALID_PLAYER_ID;
  576. Mobile[playerid] = INVALID_PLAYER_ID;
  577. CellTime[playerid] = 0;
  578. }
  579. if(PlayerPaintballing[playerid] != 0)
  580. {
  581. format(string, sizeof(string), "{ffc000}[Paintball]: You killed %s.",GetName(playerid));
  582. SendClientMessage(killerid, COLOR_WHITE, string);
  583.  
  584. format(string, sizeof(string), "{ffc000}[Paintball]: You were killed by %s.",GetName(killerid));
  585. SendClientMessage(playerid, COLOR_WHITE, string);
  586.  
  587. foreach(Player, i) {
  588. if(PlayerPaintballing[i] != 0)
  589. SendDeathMessageToPlayer(i, killerid, playerid, reason);
  590. }
  591.  
  592. new pinfo[128];
  593. KillP[killerid]++;
  594. format(pinfo,sizeof(pinfo),"You have %d kills and %d deaths.", KillP[killerid],DeathP[killerid]);
  595. PlayerTextDrawSetString(killerid, Paintball[2][killerid], pinfo);
  596. PlayerTextDrawShow(killerid, Paintball[2][killerid]);
  597.  
  598. DeathP[playerid]++;
  599. format(pinfo,sizeof(pinfo),"You have %d kills and %d deaths.", KillP[playerid],DeathP[playerid]);
  600. PlayerTextDrawSetString(playerid, Paintball[2][playerid], pinfo);
  601. PlayerTextDrawShow(playerid, Paintball[2][playerid]);
  602.  
  603. PlayerPaintballScore[killerid] = KillP[killerid]-DeathP[killerid];
  604. if(PlayerPaintballScore[killerid] > PaintballWinnerScore)
  605. {
  606. PaintballWinner = killerid;
  607. PaintballWinnerScore = PlayerPaintballScore[killerid];
  608. for(new i=0; i < MAX_PLAYERS; i++)
  609. {
  610. if(IsPlayerConnected(i))
  611. {
  612. if(PlayerPaintballing[i] != 0)
  613. {
  614. format(pinfo,sizeof(pinfo),"Lead is %s with %d score.",GetName(PaintballWinner),PaintballWinnerScore);
  615. PlayerTextDrawSetString(i, Paintball[1][i], pinfo);
  616. PlayerTextDrawShow(i, Paintball[1][i]);
  617. }
  618. }
  619. }
  620. }
  621. return 1;
  622. }
  623. if(PlayerInfo[playerid][pHeadValue] > 0)
  624. {
  625. if(IsPlayerConnected(killerid))
  626. {
  627. if(PlayerInfo[killerid][pMember] == 11)
  628. {
  629. if(GoChase[killerid] == playerid)
  630. {
  631. new killer[MAX_PLAYER_NAME];
  632. GetPlayerName(killerid, killer, sizeof(killer));
  633. GivePlayerCash(killerid, PlayerInfo[playerid][pHeadValue]);
  634. format(string,128,"<< Hitman %s has fulfilled the contract on %s (%.2f meters) and collected $%s. >>",killer,name,GetDistanceBetweenPlayers(killerid, playerid),FormatNumber(PlayerInfo[playerid][pHeadValue]));
  635. SendFamilyMessage(11, COLOR_YELLOW, string);
  636. PlayerInfo[playerid][pHeadValue] = 0;
  637. GotHit[playerid] = 0;
  638. GetChased[playerid] = 999;
  639. GoChase[killerid] = 999;
  640. new str[256];
  641. format(str,sizeof(str),"UPDATE users SET `HeadValue`='0' WHERE `NormalName`='%s'",PlayerInfo[playerid][pNormalName]);
  642. mysql_query(SQL,str);
  643. Update(killerid, pCashx);
  644. for(new i=0; i < MAX_PLAYERS; i++)
  645. {
  646. ShowPlayerNameTagForPlayer(i, killerid, 1);
  647. }
  648. togfind[killerid] = 0;
  649. PlayerInfo[killerid][pHitT] = 600;
  650. format(string, sizeof(string), "UPDATE users SET `HitT`='%d' WHERE `NormalName`='%s'", PlayerInfo[killerid][pHitT], PlayerInfo[killerid][pNormalName]);
  651. mysql_query(SQL,string);
  652. if(PlayerInfo[killerid][pWantedLevel] >= 6) { }
  653. else { WantedPoints[killerid] += 2; }
  654. if(WantedPoints[killerid] > 13)
  655. {
  656. WantedPoints[killerid] = 13;
  657. }
  658. if(reason != 49)
  659. {
  660. SetPlayerCriminal(killerid,INVALID_PLAYER_ID, "First Degree Murder");
  661. }
  662. else if(reason == 49)
  663. {
  664. SetPlayerCriminal(killerid,INVALID_PLAYER_ID, "Hit And Run");
  665. }
  666. }
  667. }
  668. }
  669. return 1;
  670. }
  671. if(gTeam[playerid] == 3)
  672. {
  673. if(IsPlayerConnected(killerid))
  674. {
  675. if(gTeam[killerid] == 3 || gTeam[killerid] == 4 || gTeam[killerid] == 5 || (gTeam[killerid] == 11 && GoChase[killerid] == 999))
  676. {
  677. new namekill[25];
  678. GetPlayerName(killerid,namekill,sizeof(namekill));
  679. strmid(WantedName[playerid], namekill, 0, strlen(namekill), 255);
  680. WantedReason[playerid] = reason;
  681. format(string,sizeof(string),"{9b2d2d}%s murdered you, use /call 112. You have 60 seconds to announce the police.",GetName(killerid));
  682. SCM(playerid,COLOR_WHITE,string);
  683. WantedTimer[playerid] = SetTimerEx("ClearWanted",60000,false,"d",playerid);
  684. }
  685. }
  686. return 1;
  687. }
  688. if(gTeam[playerid] == 2)
  689. {
  690. if(IsPlayerConnected(killerid))
  691. {
  692. if(gTeam[killerid] == 3 || gTeam[killerid] == 4 || gTeam[killerid] == 5 || (gTeam[killerid] == 11 && GoChase[killerid] == 999))
  693. {
  694. new namekill[25];
  695. GetPlayerName(killerid,namekill,sizeof(namekill));
  696. strmid(WantedName[playerid], namekill, 0, strlen(namekill), 255);
  697. WantedReason[playerid] = reason;
  698. format(string,sizeof(string),"{9b2d2d}%s murdered you, use /call 112. You have 60 seconds to announce the police.",GetName(killerid));
  699. SCM(playerid,COLOR_WHITE,string);
  700. WantedTimer[playerid] = SetTimerEx("ClearWanted",60000,false,"d",playerid);
  701. }
  702. }
  703. return 1;
  704. }
  705. if(gTeam[playerid] == 4)
  706. {
  707. if(IsPlayerConnected(killerid))
  708. {
  709. if(gTeam[killerid] == 3 || gTeam[killerid] == 4 || gTeam[killerid] == 5 || (gTeam[killerid] == 11 && GoChase[killerid] == 999))
  710. {
  711. new namekill[25];
  712. GetPlayerName(killerid,namekill,sizeof(namekill));
  713. strmid(WantedName[playerid], namekill, 0, strlen(namekill), 255);
  714. WantedReason[playerid] = reason;
  715. format(string,sizeof(string),"{9b2d2d}%s murdered you, use /call 112. You have 60 seconds to announce the police.",GetName(killerid));
  716. SCM(playerid,COLOR_WHITE,string);
  717. WantedTimer[playerid] = SetTimerEx("ClearWanted",60000,false,"d",playerid);
  718. }
  719. }
  720. return 1;
  721. }
  722. if(gTeam[playerid] == 5)
  723. {
  724. if(IsPlayerConnected(killerid))
  725. {
  726. if(gTeam[killerid] == 3 || gTeam[killerid] == 4 || (gTeam[killerid] == 11 && GoChase[killerid] == 999))
  727. {
  728. new namekill[25];
  729. GetPlayerName(killerid,namekill,sizeof(namekill));
  730. strmid(WantedName[playerid], namekill, 0, strlen(namekill), 255);
  731. WantedReason[playerid] = reason;
  732. format(string,sizeof(string),"{9b2d2d}%s murdered you, use /call 112. You have 60 seconds to announce the police.",GetName(killerid));
  733. SCM(playerid,COLOR_WHITE,string);
  734. WantedTimer[playerid] = SetTimerEx("ClearWanted",60000,false,"d",playerid);
  735. }
  736. }
  737. return 1;
  738. }
  739. if(gTeam[playerid] == 11)
  740. {
  741. if(IsPlayerConnected(killerid))
  742. {
  743. if(gTeam[killerid] == 3 || gTeam[killerid] == 4 || gTeam[killerid] == 5)
  744. {
  745. new namekill[25];
  746. GetPlayerName(killerid,namekill,sizeof(namekill));
  747. strmid(WantedName[playerid], namekill, 0, strlen(namekill), 255);
  748. WantedReason[playerid] = reason;
  749. format(string,sizeof(string),"{9b2d2d}%s murdered you, use /call 112. You have 60 seconds to announce the police.",GetName(killerid));
  750. SCM(playerid,COLOR_WHITE,string);
  751. WantedTimer[playerid] = SetTimerEx("ClearWanted",60000,false,"d",playerid);
  752. }
  753. }
  754. return 1;
  755. }
  756. killerid = INVALID_PLAYER_ID;
  757. }
  758. return 1;
  759. }
Advertisement
Add Comment
Please, Sign In to add comment