Advertisement
Guest User

Cops.inc

a guest
Mar 28th, 2019
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.10 KB | None | 0 0
  1. //Made by lokii.
  2.  
  3. #if !defined _inc_a_samp
  4. #error COPS.inc: Please include a_samp before COPS
  5. #endif
  6.  
  7. #if !defined _inc_colandreas
  8. #error COPS.inc: Please include COLANDREAS before COPS
  9. #endif
  10.  
  11. #if !defined _inc_fcnpc
  12. #error COPS.inc: Please include FCNPC before COPS
  13. #endif
  14.  
  15. #if FCNPC_INCLUDE_VERSION < 200
  16. #error COPS.inc: Please download fcnpc 2.0.0
  17. #endif
  18.  
  19. #if !defined MAX_COPS
  20. #define MAX_COPS (50)
  21. #endif
  22.  
  23. #define cops_version 10
  24.  
  25. /*
  26. native Natives();
  27. native
  28. native CreateCop(skinid, name[], Float:detection_area, Float:health, Float:x, Float:y, Float:z, Float:angle, weapon, Float:accuracy);
  29. native IsCopDead(cop_id);
  30. native IsCopInvulnerable(cop_id);
  31. native IsCopMoving(cop_id);
  32. native IsCopValid(cop_id);
  33. native GetCopHealth(cop_id);
  34. native GetCopTarget(cop_id);
  35. native GetClosestPlayerToCop(cop_id);
  36. native GetCopDetectionArea(cop_id);
  37. native GetCopPos(cop_id, &Float:x, &Float:y, &Float:z);
  38. native GetCopAngle(cop_id, &Float:angle);
  39. native GetCopCreationPos(cop_id, &Float:x, &Float:y, &Float:z);
  40. native GetCopCreationAngle(cop_id, &Float:angle);
  41. native GetCopInterior(cop_id);
  42. native GetCopVirtualWorld(cop_id);
  43. native GetCopSkin(cop_id);
  44. native GetCopCustomSkin(cop_id);
  45. native GetCopWeapon(cop_id);
  46. native SetCopWeapon(cop_id, weaponid);
  47. native SetCopInvulnerable(cop_id, bool:invulnerable);
  48. native SetCopSkin(cop_id, skinid);
  49. native SetCopInterior(cop_id, interiorid);
  50. native SetCopVirtualWorld(cop_id, worldid);
  51. native SetCopHealth(cop_id, Float:health);
  52. native RespawnCop(cop_id);
  53. native DestroyCop(cop_id);
  54. native DestroyAllCops();
  55. native
  56. native Callbacks();
  57. native
  58. native OnCopDeath(cop_id, killerid, weaponid);
  59. native OnCopTakeDamage(cop_id, damagerid, weaponid, bodypart, Float:health_loss);
  60. native OnCopKillPlayer(cop_id, playerid);
  61. native OnCrimeHappenNearCop(playerid, crime);
  62. */
  63.  
  64. #define CRIME_KILL 0
  65. #define CRIME_SHOOT 1
  66. #define CRIME_DAMAGE 2
  67.  
  68. static g_CopReferences[MAX_PLAYERS] = { -1, ... };
  69.  
  70. enum ee_cops
  71. {
  72. bool:cop_exist,
  73. cop_time,
  74. copid,
  75. cop_target,
  76. Float:cop_detection,
  77. Float:cop_pos_x,
  78. Float:cop_pos_y,
  79. Float:cop_pos_z,
  80. Float:cop_angle
  81. }
  82. static e_cops[MAX_COPS][ee_cops];
  83.  
  84. stock SetCopInterior(cop_id, interiorid)
  85. {
  86. if(IsCopValid(cop_id))
  87. {
  88. FCNPC_SetInterior(e_cops[cop_id][copid], interiorid);
  89. return 1;
  90. }
  91. return 0;
  92. }
  93.  
  94. stock GetCopInterior(cop_id)
  95. {
  96. if(IsCopValid(cop_id))
  97. {
  98. return FCNPC_GetInterior(e_cops[cop_id][copid]);
  99. }
  100. return 0;
  101. }
  102.  
  103. stock SetCopVirtualWorld(cop_id, worldid)
  104. {
  105. if(IsCopValid(cop_id))
  106. {
  107. FCNPC_SetVirtualWorld(e_cops[cop_id][copid], worldid);
  108. return 1;
  109. }
  110. return 0;
  111. }
  112.  
  113. stock GetCopVirtualWorld(cop_id)
  114. {
  115. if(IsCopValid(cop_id))
  116. {
  117. return FCNPC_GetVirtualWorld(e_cops[cop_id][copid]);
  118. }
  119. return 0;
  120. }
  121.  
  122. stock GetCopCreationPos(cop_id, &Float:x, &Float:y, &Float:z)
  123. {
  124. if(IsCopValid(cop_id))
  125. {
  126. x = e_cops[cop_id][cop_pos_x];
  127. y = e_cops[cop_id][cop_pos_y];
  128. z = e_cops[cop_id][cop_pos_z];
  129. return 1;
  130. }
  131. return 0;
  132. }
  133.  
  134. stock GetCopCreationAngle(cop_id, &Float:angle)
  135. {
  136. if(IsCopValid(cop_id))
  137. {
  138. angle = e_cops[cop_id][cop_angle];
  139. return 1;
  140. }
  141. return 0;
  142. }
  143.  
  144. stock GetCopAngle(cop_id, &Float:angle)
  145. {
  146. if(IsCopValid(cop_id))
  147. {
  148. angle = FCNPC_GetAngle(e_cops[cop_id][copid]);
  149. return 1;
  150. }
  151. return 0;
  152. }
  153.  
  154. stock bool:IsCopMoving(cop_id)
  155. {
  156. if(IsCopValid(cop_id))
  157. {
  158. return FCNPC_IsMoving(e_cops[cop_id][copid]);
  159. }
  160. return false;
  161. }
  162.  
  163. Float:GetCopDetectionArea(cop_id)
  164. {
  165. if(IsCopValid(cop_id))
  166. {
  167. return e_cops[cop_id][cop_detection];
  168. }
  169. return 0.0;
  170. }
  171.  
  172. IsCopValid(cop_id)
  173. {
  174. if(cop_id < 0 || cop_id >= MAX_COPS) return 0;
  175. return e_cops[cop_id][cop_exist];
  176. }
  177.  
  178. stock CreateCop(skinid, name[], Float:detection_area, Float:health, Float:x, Float:y, Float:z, Float:angle, weapon, Float:accuracy)
  179. {
  180. new id;
  181. for(new i = 0; i < MAX_COPS; i++)
  182. {
  183. if(IsCopValid(i)) continue;
  184. id = FCNPC_Create(name);
  185. if(FCNPC_IsValid(id))
  186. {
  187. e_cops[i][copid] = id;
  188. g_CopReferences[e_cops[i][copid]] = i;
  189. FCNPC_Spawn(e_cops[i][copid], skinid, x, y, z);
  190. FCNPC_SetHealth(e_cops[i][copid], health);
  191. FCNPC_SetAngle(e_cops[i][copid], angle);
  192. FCNPC_SetWeaponAccuracy(e_cops[i][copid], weapon, accuracy);
  193. FCNPC_SetWeapon(e_cops[i][copid], weapon);
  194. FCNPC_UseInfiniteAmmo(e_cops[i][copid], true);
  195. e_cops[i][cop_pos_x] = x;
  196. e_cops[i][cop_pos_y] = y;
  197. e_cops[i][cop_pos_z] = z;
  198. e_cops[i][cop_angle] = angle;
  199. e_cops[i][cop_detection] = detection_area;
  200. e_cops[i][cop_target] = 0xFFFF;
  201. e_cops[i][cop_exist] = true;
  202. return i;
  203. }
  204. }
  205. return 0xFFFF;
  206. }
  207.  
  208. stock SetCopWeapon(cop_id, weaponid)
  209. {
  210. if(IsCopValid(cop_id))
  211. {
  212. FCNPC_SetWeapon(e_cops[cop_id][copid], weaponid);
  213. return 1;
  214. }
  215. return 0;
  216. }
  217.  
  218. stock GetCopWeapon(cop_id)
  219. {
  220. if(IsCopValid(cop_id))
  221. {
  222. return FCNPC_GetWeapon(e_cops[cop_id][copid]);
  223. }
  224. return 0;
  225. }
  226.  
  227. stock GetCopPos(cop_id, &Float:x, &Float:y, &Float:z)
  228. {
  229. if(IsCopValid(cop_id))
  230. {
  231. FCNPC_GetPosition(e_cops[cop_id][copid], x, y, z);
  232. return 1;
  233. }
  234. return 0;
  235. }
  236.  
  237. stock Float:GetCopHealth(cop_id)
  238. {
  239. if(IsCopValid(cop_id))
  240. {
  241. return FCNPC_GetHealth(e_cops[cop_id][copid]);
  242. }
  243. return 0.0;
  244. }
  245.  
  246. stock bool:IsCopDead(cop_id)
  247. {
  248. if(IsCopValid(cop_id))
  249. {
  250. return FCNPC_IsDead(e_cops[cop_id][copid]);
  251. }
  252. return false;
  253. }
  254.  
  255. stock RespawnCop(cop_id)
  256. {
  257. if(IsCopValid(cop_id))
  258. {
  259. FCNPC_Respawn(e_cops[cop_id][copid]);
  260. FCNPC_SetPosition(e_cops[cop_id][copid], e_cops[cop_id][cop_pos_x], e_cops[cop_id][cop_pos_y], e_cops[cop_id][cop_pos_z]);
  261. FCNPC_SetAngle(e_cops[cop_id][copid], e_cops[cop_id][cop_angle]);
  262. return 1;
  263. }
  264. return 0;
  265. }
  266.  
  267. stock DestroyCop(cop_id)
  268. {
  269. if(IsCopValid(cop_id))
  270. {
  271. FCNPC_Destroy(e_cops[cop_id][copid]);
  272. e_cops[cop_id][cop_pos_x] = 0.0;
  273. e_cops[cop_id][cop_pos_y] = 0.0;
  274. e_cops[cop_id][cop_pos_z] = 0.0;
  275. e_cops[cop_id][cop_angle] = 0.0;
  276. e_cops[cop_id][cop_detection] = 0.0;
  277. e_cops[cop_id][cop_target] = 0xFFFF;
  278. g_CopReferences[cop_id] = -1;
  279. e_cops[cop_id][cop_exist] = false;
  280. return 1;
  281. }
  282. return 0;
  283. }
  284.  
  285. CopAttackPlayer(cop_id, playerid)
  286. {
  287. if(IsCopValid(cop_id) && IsPlayerConnected(playerid))
  288. {
  289. FCNPC_AimAtPlayer(e_cops[cop_id][copid], playerid, true, -1, true, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  290. e_cops[cop_id][cop_target] = playerid;
  291. return playerid;
  292. }
  293. return 0xFFFF;
  294. }
  295.  
  296. stock SetCopHealth(cop_id, Float:health)
  297. {
  298. if(IsCopValid(cop_id))
  299. {
  300. FCNPC_SetHealth(e_cops[cop_id][copid], health);
  301. return 1;
  302. }
  303. return 0;
  304. }
  305.  
  306. GetCopTarget(cop_id)
  307. {
  308. if(cop_id < 0 || cop_id >= MAX_COPS) return 0xFFFF;
  309. if(IsCopValid(cop_id))
  310. {
  311. return e_cops[cop_id][cop_target];
  312. }
  313. return 0xFFFF;
  314. }
  315.  
  316. forward OnCopDeath(cop_id, killerid, weaponid);
  317.  
  318. public FCNPC_OnDeath(npcid, killerid, reason)
  319. {
  320. if(g_CopReferences[npcid] != -1 && killerid != 0xFFFF)
  321. CallLocalFunction("OnCopDeath", "iii", g_CopReferences[npcid], killerid, reason);
  322.  
  323. #if defined cops_FCNPC_OnDeath
  324. return cops_FCNPC_OnDeath(npcid, killerid, weaponid);
  325. #else
  326. return 1;
  327. #endif
  328. }
  329. #if defined _ALS_FCNPC_OnDeath
  330. #undef FCNPC_OnDeath
  331. #else
  332. #define _ALS_FCNPC_OnDeath
  333. #endif
  334. #define FCNPC_OnDeath cops_FCNPC_OnDeath
  335. #if defined cops_FCNPC_OnDeath
  336. forward cops_FCNPC_OnDeath(npcid, killerid, weaponid);
  337. #endif
  338.  
  339. stock GetClosestPlayerToCop(cop_id)
  340. {
  341. new id = -1, Float:tmp, Float:last = 99999, Float:x, Float:y, Float:z;
  342. if(IsCopValid(cop_id))
  343. {
  344. FCNPC_GetPosition(e_cops[copid][copid], x, y, z);
  345. for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
  346. {
  347. if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
  348. tmp = GetPlayerDistanceFromPoint(i, x, y, z);
  349. if(tmp >= last) continue;
  350. last = tmp;
  351. id = i;
  352. }
  353. }
  354. return id;
  355. }
  356.  
  357. public FCNPC_OnUpdate(npcid)
  358. {
  359. new Float:x, Float:y, Float:z;
  360. if(g_CopReferences[npcid] != -1)
  361. {
  362. if(e_cops[g_CopReferences[npcid]][cop_time] != gettime())
  363. {
  364. FCNPC_GetPosition(e_cops[g_CopReferences[npcid]][copid], x, y, z);
  365. for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
  366. {
  367. if(!IsPlayerConnected(i) || IsPlayerNPC(i) || GetPlayerInterior(i) != GetCopInterior(g_CopReferences[npcid]) || GetPlayerVirtualWorld(i) != GetCopVirtualWorld(g_CopReferences[npcid])) continue;
  368. if(GetCopTarget(g_CopReferences[npcid]) == i && GetPlayerWantedLevel(i) == 0 || GetCopTarget(g_CopReferences[npcid]) == i && GetPlayerDistanceFromPoint(i, x, y, z) > GetCopDetectionArea(g_CopReferences[npcid]))
  369. {
  370. FCNPC_Stop(e_cops[g_CopReferences[npcid]][copid]);
  371. FCNPC_StopAim(e_cops[g_CopReferences[npcid]][copid]);
  372. e_cops[g_CopReferences[npcid]][cop_target] = 0xFFFF;
  373. e_cops[g_CopReferences[npcid]][cop_time] = gettime();
  374. }
  375. else
  376. {
  377. if(GetPlayerWantedLevel(i) >= 1 && GetPlayerDistanceFromPoint(i, x, y, z) <= GetCopDetectionArea(g_CopReferences[npcid]))
  378. {
  379. CopAttackPlayer(g_CopReferences[npcid], i);
  380. if(GetPlayerDistanceFromPoint(i, x, y, z) >= GetCopDetectionArea(g_CopReferences[npcid])/2)
  381. {
  382. FCNPC_GoToPlayer(e_cops[g_CopReferences[npcid]][copid], i, FCNPC_MOVE_TYPE_AUTO, FCNPC_MOVE_SPEED_AUTO, FCNPC_MOVE_MODE_COLANDREAS, FCNPC_MOVE_PATHFINDING_RAYCAST, 5.0, true, 3.0, 1.5, 250);
  383. e_cops[g_CopReferences[npcid]][cop_time] = gettime();
  384. }
  385. e_cops[g_CopReferences[npcid]][cop_time] = gettime();
  386. }
  387. }
  388. }
  389. }
  390. }
  391.  
  392. #if defined cops_FCNPC_OnUpdate
  393. return cops_FCNPC_OnUpdate(npcid);
  394. #else
  395. return 1;
  396. #endif
  397. }
  398. #if defined _ALS_FCNPC_OnUpdate
  399. #undef FCNPC_OnUpdate
  400. #else
  401. #define _ALS_FCNPC_OnUpdate
  402. #endif
  403. #define FCNPC_OnUpdate cops_FCNPC_OnUpdate
  404. #if defined cops_FCNPC_OnUpdate
  405. forward cops_FCNPC_OnUpdate(npcid);
  406. #endif
  407.  
  408. forward OnCopTakeDamage(cop_id, damagerid, weaponid, bodypart, Float:health_loss);
  409.  
  410. public FCNPC_OnTakeDamage(npcid, issuerid, Float:amount, weaponid, bodypart)
  411. {
  412. if(issuerid == 0xFFFF) return 1;
  413. if(g_CopReferences[npcid] != -1)
  414. {
  415. CallLocalFunction("OnCopTakeDamage", "iiiif", g_CopReferences[npcid], issuerid, weaponid, bodypart, amount);
  416. }
  417.  
  418. #if defined cops_FCNPC_OnTakeDamage
  419. return cops_FCNPC_OnTakeDamage(npcid, issuerid, Float:amount, weaponid, bodypart);
  420. #else
  421. return 1;
  422. #endif
  423. }
  424. #if defined _ALS_FCNPC_OnTakeDamage
  425. #undef FCNPC_OnTakeDamage
  426. #else
  427. #define _ALS_FCNPC_OnTakeDamage
  428. #endif
  429. #define FCNPC_OnTakeDamage cops_FCNPC_OnTakeDamage
  430. #if defined cops_FCNPC_OnTakeDamage
  431. forward cops_FCNPC_OnTakeDamage(npcid, issuerid, Float:amount, weaponid, bodypart);
  432. #endif
  433.  
  434. forward OnCopKillPlayer(cop_id, playerid);
  435.  
  436. public OnPlayerDeath(playerid, killerid, reason)
  437. {
  438. new Float:x, Float:y, Float:z;
  439. if(killerid == 0xFFFF) return 1;
  440. for(new i = 0; i < MAX_COPS; i ++)
  441. {
  442. if(!IsCopValid(i)) continue;
  443. if(!IsPlayerNPC(killerid))
  444. {
  445. GetCopPos(i, x, y, z);
  446. if(!IsPlayerInRangeOfPoint(playerid, GetCopDetectionArea(i), x, y, z)) continue;
  447. CallLocalFunction("OnCrimeHappenNearCop", "ii", killerid, CRIME_KILL);
  448. break;
  449. }
  450. if(IsPlayerNPC(killerid))
  451. {
  452. CallLocalFunction("OnCopKillPlayer", "ii", i, playerid);
  453. break;
  454. }
  455. }
  456.  
  457. #if defined cops_OnPlayerDeath
  458. return cops_OnPlayerDeath(playerid, killerid, reason);
  459. #else
  460. return 1;
  461. #endif
  462. }
  463. #if defined _ALS_OnPlayerDeath
  464. #undef OnPlayerDeath
  465. #else
  466. #define _ALS_OnPlayerDeath
  467. #endif
  468. #define OnPlayerDeath cops_OnPlayerDeath
  469. #if defined cops_OnPlayerDeath
  470. forward cops_OnPlayerDeath(playerid, killerid, reason);
  471. #endif
  472.  
  473. forward OnCrimeHappenNearCop(playerid, crime);
  474.  
  475. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  476. {
  477. new Float:x, Float:y, Float:z;
  478. for(new i = 0; i < MAX_COPS; i ++)
  479. {
  480. if(!IsCopValid(i)) continue;
  481. GetCopPos(i, x, y, z);
  482. if(!IsPlayerInRangeOfPoint(playerid, GetCopDetectionArea(i), x, y, z)) continue;
  483. CallLocalFunction("OnCrimeHappenNearCop", "ii", playerid, CRIME_SHOOT);
  484. break;
  485. }
  486.  
  487. #if defined cops_OnPlayerWeaponShot
  488. return cops_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  489. #else
  490. return 1;
  491. #endif
  492. }
  493. #if defined _ALS_OnPlayerWeaponShot
  494. #undef OnPlayerWeaponShot
  495. #else
  496. #define _ALS_OnPlayerWeaponShot
  497. #endif
  498. #define OnPlayerWeaponShot cops_OnPlayerWeaponShot
  499. #if defined cops_OnPlayerWeaponShot
  500. forward cops_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  501. #endif
  502.  
  503. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  504. {
  505. new Float:x, Float:y, Float:z;
  506. if(issuerid == 0xFFFF || IsPlayerNPC(issuerid)) return 0;
  507. for(new i = 0; i < MAX_COPS; i ++)
  508. {
  509. if(!IsCopValid(i)) continue;
  510. GetCopPos(i, x, y, z);
  511. if(!IsPlayerInRangeOfPoint(playerid, GetCopDetectionArea(i), x, y, z)) continue;
  512. CallLocalFunction("OnCrimeHappenNearCop", "ii", issuerid, CRIME_DAMAGE);
  513. break;
  514. }
  515.  
  516. #if defined cops_OnPlayerTakeDamage
  517. return cops_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  518. #else
  519. return 0;
  520. #endif
  521. }
  522. #if defined _ALS_OnPlayerTakeDamage
  523. #undef OnPlayerTakeDamage
  524. #else
  525. #define _ALS_OnPlayerTakeDamage
  526. #endif
  527. #define OnPlayerTakeDamage cops_OnPlayerTakeDamage
  528. #if defined cops_OnPlayerTakeDamage
  529. forward cops_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  530. #endif
  531.  
  532. DestroyAllCops()
  533. {
  534. for(new i = 0; i < MAX_COPS; i++)
  535. {
  536. if(!IsCopValid(i)) continue;
  537. DestroyCop(i);
  538. }
  539. return 1;
  540. }
  541.  
  542. stock SetCopInvulnerable(cop_id, bool:invulnerable)
  543. {
  544. if(IsCopValid(cop_id))
  545. {
  546. FCNPC_SetInvulnerable(e_cops[cop_id][copid], invulnerable);
  547. return 1;
  548. }
  549. return 0;
  550. }
  551.  
  552. stock bool:IsCopInvulnerable(cop_id)
  553. {
  554. if(IsCopValid(cop_id))
  555. {
  556. return FCNPC_IsInvulnerable(e_cops[cop_id][copid]);
  557. }
  558. return false;
  559. }
  560.  
  561. stock SetCopSkin(cop_id, skinid)
  562. {
  563. if(IsCopValid(cop_id))
  564. {
  565. FCNPC_SetSkin(e_cops[cop_id][copid], skinid);
  566. return 1;
  567. }
  568. return 0;
  569. }
  570.  
  571. stock GetCopSkin(cop_id)
  572. {
  573. if(IsCopValid(cop_id))
  574. {
  575. return FCNPC_GetSkin(e_cops[cop_id][copid]);
  576. }
  577. return -1;
  578. }
  579.  
  580. stock GetCopCustomSkin(cop_id)
  581. {
  582. if(IsCopValid(cop_id))
  583. {
  584. return FCNPC_GetCustomSkin(e_cops[cop_id][copid]);
  585. }
  586. return -1;
  587. }
  588.  
  589. #if defined FILTERSCRIPT
  590.  
  591. public OnFilterScriptInit()
  592. {
  593. CA_Init();
  594. FCNPC_UseMoveMode(FCNPC_MOVE_MODE_COLANDREAS);
  595.  
  596. #if defined cops_OnFilterScriptInit
  597. return cops_OnFilterScriptInit();
  598. #else
  599. return 1;
  600. #endif
  601. }
  602. #if defined _ALS_OnFilterScriptInit
  603. #undef OnFilterScriptInit
  604. #else
  605. #define _ALS_OnFilterScriptInit
  606. #endif
  607. #define OnFilterScriptInit cops_OnFilterScriptInit
  608. #if defined cops_OnFilterScriptInit
  609. forward cops_OnFilterScriptInit();
  610. #endif
  611.  
  612. public OnFilterScriptExit()
  613. {
  614. DestroyAllCops();
  615.  
  616. #if defined cops_OnFilterScriptExit
  617. return cops_OnFilterScriptExit();
  618. #else
  619. return 1;
  620. #endif
  621. }
  622. #if defined _ALS_OnFilterScriptExit
  623. #undef OnFilterScriptExit
  624. #else
  625. #define _ALS_OnFilterScriptExit
  626. #endif
  627. #define OnFilterScriptExit cops_OnFilterScriptExit
  628. #if defined cops_OnFilterScriptExit
  629. forward cops_OnFilterScriptExit();
  630. #endif
  631.  
  632. #else
  633.  
  634. public OnGameModeInit()
  635. {
  636. CA_Init();
  637. FCNPC_UseMoveMode(FCNPC_MOVE_MODE_COLANDREAS);
  638.  
  639. #if defined cops_OnGameModeInit
  640. return cops_OnGameModeInit();
  641. #else
  642. return 1;
  643. #endif
  644. }
  645. #if defined _ALS_OnGameModeInit
  646. #undef OnGameModeInit
  647. #else
  648. #define _ALS_OnGameModeInit
  649. #endif
  650. #define OnGameModeInit cops_OnGameModeInit
  651. #if defined cops_OnGameModeInit
  652. forward cops_OnGameModeInit();
  653. #endif
  654.  
  655. public OnGameModeExit()
  656. {
  657. DestroyAllCops();
  658.  
  659. #if defined cops_OnGameModeExit
  660. return cops_OnGameModeExit();
  661. #else
  662. return 1;
  663. #endif
  664. }
  665. #if defined _ALS_OnGameModeExit
  666. #undef OnGameModeExit
  667. #else
  668. #define _ALS_OnGameModeExit
  669. #endif
  670. #define OnGameModeExit cops_OnGameModeExit
  671. #if defined cops_OnGameModeExit
  672. forward cops_OnGameModeExit();
  673. #endif
  674.  
  675. #endif
  676.  
  677. //EOF.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement