Guest User

Wafffllesss

a guest
Feb 7th, 2010
10,467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.62 KB | None | 0 0
  1. /*
  2. Timers per player: 1*
  3. Timer per Zombie: 3*
  4.  
  5. *Playing constantly.
  6. =====================================================================================================
  7. This is the Zombie Filterscript by Wafffllesss ( Henrique Pauli ). This is my first Filterscript
  8. And My first npc work. I hope you enjoy this filterscript and make much fun in your server.
  9. Please do not remove the credits.
  10.  
  11. *You can mod this filterscript as you wish.
  12. *You can use this filterscript in anywhere you want to.
  13. =====================================================================================================
  14. */
  15.  
  16. // The Zombie Skin.
  17. // -1: Will random by the skins defined below.
  18. // -2: Will random by any valid game skin.
  19. // Any other number will set the skin as you defined ( if valid ).
  20. static Zombie_Skin=-2;
  21.  
  22. //The zombies name. Eg.: If the npc have Zombie in the name, then he'll be a zombie ( Change as you wish ).
  23. #define ZOMBIE_NAME "Zombie"
  24.  
  25. #include <a_samp>
  26. #include <foreach> // By Y_less
  27. Itter_Create(Vehicle, MAX_VEHICLES);
  28.  
  29.  
  30. #define COLOR_GREY 0xAFAFAFAA
  31. #define COLOR_GREEN 0x33AA33AA
  32. #define COLOR_RED 0xAA3333AA
  33. #define COLOR_YELLOW 0xFFFF00AA
  34. #define COLOR_WHITE 0xFFFFFFAA
  35.  
  36.  
  37. forward CheckCloserPlayers(playerid);
  38. forward NewPos(playerid);
  39. forward CheckHP(playerid);
  40. forward KilledBy(playerid,killer);
  41. forward KickZombie(playerid);
  42. forward Firing(playerid);
  43. forward Float:GetDistanceToPlayer(playerid,playerid2);
  44. forward Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);
  45. forward Float:GetPlayerSpeed(playerid);
  46. forward Float:GetXYInFrontOfVehicle(vehicleid, &Float:x, &Float:y, Float:distance);
  47.  
  48. // If Zombie_Skin is equal to -1 then will random this skins:
  49. new ZombieSkins[]={
  50. 1,
  51. 7,
  52. 9,
  53. 10,
  54. 45
  55. // Atention, the last skin doesn't have comma.
  56. };
  57.  
  58.  
  59. enum ZombieEnum{
  60. ZombieSpawned,
  61. ZombieTarget,
  62. ZombieRunning,
  63. ZombieKilling,
  64. NPTIMER,
  65. Ztimers,
  66. Float:LastZombieHealth,
  67. Dying,
  68. HPtimer
  69. }
  70. new Zombies[200][ZombieEnum];
  71.  
  72. new FiringTimer[200];
  73. new FiringClick[200];
  74.  
  75. new ZombieKill[200];
  76.  
  77. new Caller;
  78. new LastAdded = 0;
  79.  
  80. new WeaponDamage[] = {
  81. 1,
  82. 2,
  83. 4,
  84. 4,
  85. 5,
  86. 4,
  87. 4,
  88. 4,
  89. 6,
  90. 15,
  91. -5,
  92. -5,
  93. -5,
  94. -5,
  95. -100,
  96. 4,
  97. 13,
  98. 2,
  99. 13,
  100. 0,
  101. 0,
  102. 0,
  103. 8,
  104. 9,
  105. 11,
  106. 15,
  107. 17,
  108. 15,
  109. 8,
  110. 9,
  111. 13,
  112. 13,
  113. 6,
  114. 45,
  115. 55,
  116. 40,
  117. 40,
  118. 27,
  119. 35,
  120. 0,
  121. 0,
  122. 0,
  123. 0,
  124. 0,
  125. 0,
  126. 0
  127. };
  128. new Float:WeaponRanges[] = {
  129. 1.0,
  130. 1.0,
  131. 1.2,
  132. 1.2,
  133. 1.1,
  134. 1.2,
  135. 1.2,
  136. 1.3,
  137. 1.2,
  138. 1.3,
  139. 0.5,
  140. 0.5,
  141. 0.5,
  142. 0.5,
  143. 0.5,
  144. 1.4,
  145. 12.0,
  146. 12.0,
  147. 12.0,
  148. 0.0,
  149. 0.0,
  150. 0.0,
  151. 28.0,
  152. 29.0,
  153. 30.0,
  154. 26.0,
  155. 25.0,
  156. 27.0,
  157. 28.0,
  158. 31.0,
  159. 35.0,
  160. 35.0,
  161. 26.0,
  162. 38.0,
  163. 65.0,
  164. 40.0,
  165. 40.0,
  166. 23.0,
  167. 37.0,
  168. 0.0,
  169. 0.0,
  170. 0.0,
  171. 0.0,
  172. 0.0,
  173. 0.0,
  174. 0.0
  175. };
  176. public OnFilterScriptInit()
  177. {
  178. // If there is players / Npcs / Vehicles online, it'll create the Itter.
  179. for(new i =0; i<= MAX_PLAYERS;i++){
  180. if(IsPlayerConnected(i) && !IsPlayerNPC(i)){
  181. Itter_Add(Player,i);
  182. FiringTimer[i] = SetTimerEx("Firing",250,1,"i",i);
  183. ZombieKill[i] = -1;
  184. }
  185. else if(IsPlayerConnected(i) && IsPlayerNPC(i)){
  186. Itter_Add(Bot,i);
  187.  
  188. //If he's a zombie. Activate him.
  189. if(!strfind(PlayerName(i),ZOMBIE_NAME,true)){
  190. SetupZombie(i);
  191. }
  192. }
  193. }
  194. new Float:h;
  195. for(new v=0;v<MAX_VEHICLES;v++){
  196. GetVehicleHealth(v,h);
  197. if(h)Itter_Add(Vehicle,v);
  198. }
  199. print("\n=====================================");
  200. print(" Zombie Filterscript By Wafffllesss ");
  201. print("=====================================\n");
  202. return 1;
  203. }
  204.  
  205. //=======================================[ Timers ]=========================================//
  206. public Firing(playerid){
  207. new up_dw,lf_rg,o_keys,weapon;
  208. new Float:x,Float:y,Float:z;
  209.  
  210. weapon = GetPlayerWeapon(playerid);
  211. GetPlayerKeys(playerid,o_keys,up_dw,lf_rg);
  212. if(o_keys == KEY_FIRE || o_keys == (KEY_FIRE+128) ){
  213. if(!FiringClick[playerid] || Automatic(weapon))
  214. {
  215. FiringClick[playerid] = true;
  216. GetPlayerPos(playerid,x,y,z);
  217. foreach(Bot,b){
  218. if(IsPlayerFacingPlayer(playerid,b,5.0)){
  219. if(IsPlayerInRangeOfPoint(b,WeaponRanges[weapon],x,y,z)){
  220. Zombies[b][LastZombieHealth] -= float(WeaponDamage[weapon]);
  221. if(Zombies[b][LastZombieHealth] <= 0.0 && !Zombies[b][Dying]){
  222. SendDeathMessage(playerid,b,weapon);
  223. Zombies[b][Dying] = true;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }else{
  230. FiringClick[playerid] = false;
  231. }
  232. }
  233. public KickZombie(playerid){
  234. Kick(playerid);
  235. Zombies[playerid][Dying]=false;
  236. KillTimer(Zombies[playerid][HPtimer]); Zombies[playerid][HPtimer] = false;
  237. KillTimer(Zombies[playerid][Ztimers]); Zombies[playerid][Ztimers] = false;
  238. if(Zombies[playerid][NPTIMER]){
  239. KillTimer(Zombies[playerid][NPTIMER]);
  240. Zombies[playerid][NPTIMER] = false;
  241. }
  242. }
  243. public CheckHP(playerid){ // Check the Zombie HP.
  244. new Float:x,Float:y,Float:z;
  245. new cp = GetClosestPlayer(playerid);
  246.  
  247. if(IsPlayerInAnyVehicle(cp)){
  248. new cpc = GetPlayerVehicleID(cp);
  249. GetVehiclePos(cpc,x,y,z);
  250. GetXYInFrontOfVehicle(cpc,x,y,1.5);
  251. if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z) && GetPlayerSpeed(cp) > 10.0){
  252. Zombies[playerid][LastZombieHealth] -= (GetPlayerSpeed(cp)*2);
  253. }
  254. }
  255. if( Zombies[playerid][LastZombieHealth] <= 0.0 && Zombies[playerid][ZombieSpawned]){
  256. ApplyAnimation(playerid,"Knife","KILL_Knife_Ped_Die",1,0,1,0,0,0);
  257. SetTimerEx("KickZombie",1500,0,"i",playerid);
  258. Zombies[playerid][Dying] = true;
  259. }
  260. }
  261.  
  262. public NewPos(playerid){ // Make the zombie Run / Sprint
  263. if( Zombies[playerid][LastZombieHealth] > 0.0 ){
  264. new Float:x,Float:y,Float:z;
  265. new Float:ax,Float:ay,Float:az,Float:dif;
  266. GetPlayerPos(Zombies[playerid][ZombieTarget],ax,ay,az);
  267. GetPlayerPos(playerid,x,y,z);
  268. if( az <= (z+3.0) && az >= (z-3.0)){
  269. if(Zombies[playerid][ZombieRunning] == 1){
  270. ApplyAnimation(playerid,"Muscular","MuscleRun",1,1,1,0,0,0);
  271. GetXYInFrontOfPlayer(playerid,x,y,2.0);
  272. }
  273. else if(Zombies[playerid][ZombieRunning] == 2){
  274. ApplyAnimation(playerid,"Muscular","MuscleSprint",1,1,1,0,0,0);
  275. GetXYInFrontOfPlayer(playerid,x,y,2.8);
  276. }
  277.  
  278. dif = az;
  279. SetPlayerPos(playerid,x,y,dif);
  280. }else{
  281. if(Zombies[playerid][ZombieRunning]) Parar(playerid);
  282. GetPlayerPos(playerid,x,y,z);
  283. SetPlayerPosFindZ(playerid,x,y,z);
  284. }
  285. }
  286. }
  287. public CheckCloserPlayers(playerid){ // Detect the closest player and chase him
  288. if( Zombies[playerid][LastZombieHealth] > 0.0 ){
  289. new cp = GetClosestPlayer(playerid);
  290. new Float:MinDistance = 3.0;
  291. if(IsPlayerInAnyVehicle(cp)){ MinDistance = 5.0; }
  292. Zombies[playerid][ZombieTarget] = cp;
  293. if(GetDistanceToPlayer(playerid,cp) <= 70.0 && GetDistanceToPlayer(playerid,cp) > 15.0){
  294. IrParaPlayer(1,playerid,cp);
  295. }else if(GetDistanceToPlayer(playerid,cp) <= 15.0 && GetDistanceToPlayer(playerid,cp) > MinDistance){
  296. IrParaPlayer(0,playerid,cp);
  297. }else if(GetDistanceToPlayer(playerid,cp) <= MinDistance){
  298. Parar(playerid);
  299. }
  300. if(GetDistanceToPlayer(playerid,cp) <= MinDistance){
  301. new Float:h;
  302. if(IsPlayerInAnyVehicle(cp)){
  303. new cpc = GetPlayerVehicleID(cp);
  304. GetVehicleHealth(cpc,h);
  305. if(GetDistanceToPlayer(playerid,cp) < MinDistance){
  306. SetVehicleHealth(cpc,h-80.0);
  307. ApplyAnimation(playerid,"Gangs","shake_carSH",1,1,1,0,0,0);
  308. }
  309.  
  310. }else{
  311. if(GetDistanceToPlayer(playerid,cp) > 1.5){
  312. GetPlayerHealth(cp,h);
  313. SetPlayerHealth(cp,h-5.0);
  314. }else if(GetDistanceToPlayer(playerid,cp) <= 1.5){
  315. if(Zombies[playerid][ZombieKilling] == -1){
  316. if(!IsDying(cp)){
  317. FinishHim(playerid,cp);
  318. }
  319. }
  320. }
  321. }
  322. }
  323. }
  324. }
  325. public KilledBy(playerid,killer){ // Apply 'dying' animation and kill the player.
  326. if(Zombies[killer][ZombieKilling] == playerid){
  327. ApplyAnimation(playerid,"Knife","KILL_Knife_Ped_Die",1,0,1,0,0,0);
  328. TogglePlayerControllable(playerid,true);
  329. SetPlayerHealth(playerid,0.0);
  330. ClearAnimations(killer);
  331. ZombieKill[playerid] = killer;
  332. }
  333. }
  334. //=======================================[ Functions ]=========================================//
  335. stock Automatic(weaponid){
  336. switch(weaponid){
  337. case 9,22,23,24,27,28,29,30,31,32,37,38: return true;
  338. }
  339. return false;
  340. }
  341. stock IsDying(playerid){ // Verify if a zombie is killing the player
  342. foreach(Bot,b){
  343. if(Zombies[b][ZombieKilling] == playerid) return true;
  344. }
  345. return false;
  346. }
  347. stock SetupZombie(playerid){ // Activate the zombie.
  348. new Float:px,Float:py,Float:pz;
  349. Zombies[playerid][HPtimer] = SetTimerEx("CheckHP",100,1,"i",playerid);
  350. Zombies[playerid][Ztimers] = SetTimerEx("CheckCloserPlayers",1000,1,"i",playerid);
  351. GetPlayerPos(Caller,px,py,pz);
  352. SetPlayerPos(playerid,px,py,pz);
  353. Zombies[playerid][ZombieRunning] = false;
  354. SendClientMessageToAll(COLOR_RED,"A Zombie Connected!");
  355.  
  356. new Zskin=1;
  357. if(Zombie_Skin == -1){
  358. new rd = random(sizeof(ZombieSkins));
  359. if(IsValidSkin(ZombieSkins[rd])){
  360. Zskin = ZombieSkins[rd];
  361. }
  362. }else if(Zombie_Skin == -2){
  363. new rd = random(299);
  364. if(IsValidSkin(rd)){
  365. Zskin = rd;
  366. }
  367. }else if(IsValidSkin(Zombie_Skin)){
  368. Zskin = Zombie_Skin;
  369. }
  370. SetPlayerSkin(playerid,Zskin);
  371.  
  372. Zombies[playerid][ZombieKilling] = -1;
  373. Zombies[playerid][ZombieSpawned] = true;
  374. Zombies[playerid][LastZombieHealth] = 100.0;
  375. }
  376.  
  377. stock FinishHim(playerid,target){ // Do i need to explain that?
  378. Zombies[playerid][ZombieKilling] = target;
  379. TogglePlayerControllable(target,false);
  380. SetPlayerToFacePlayer(playerid,target);
  381. SetPlayerToFacePlayer(target,playerid);
  382.  
  383. ApplyAnimation(target,"Knife","KILL_Knife_Ped_Damage",1,0,1,0,0,0);
  384. ApplyAnimation(playerid,"Knife","KILL_Knife_Player",1,0,1,0,0,0);
  385. SetTimerEx("KilledBy",1500,0,"ii",target,playerid);
  386. }
  387.  
  388. stock Parar(playerid){ // Makes the zombie stop walking.
  389. if(Zombies[playerid][ZombieRunning]){
  390. if(Zombies[playerid][NPTIMER]){
  391. KillTimer(Zombies[playerid][NPTIMER]);
  392. Zombies[playerid][NPTIMER] = false;
  393. }
  394. Zombies[playerid][ZombieRunning] = false;
  395. ClearAnimations(playerid);
  396. }
  397. }
  398.  
  399. stock IrParaPlayer(modo,playerid,paraid){ //Make the zombie chase the targeted player. Mode: 1- Run | 2- Sprint
  400. SetPlayerToFacePlayer(playerid,paraid);
  401. if(modo == 0 && Zombies[playerid][ZombieRunning] != 1) Caminhar(playerid);
  402. else if(modo == 1 && Zombies[playerid][ZombieRunning] != 2) Correr(playerid);
  403. }
  404.  
  405. stock Caminhar(playerid){ //Run forward.
  406. Zombies[playerid][ZombieRunning] = 1;
  407. Zombies[playerid][NPTIMER] = SetTimerEx("NewPos",400,1,"i",playerid);
  408. }
  409.  
  410. stock Correr(playerid){ //Sprint forward.
  411. Zombies[playerid][ZombieRunning] = 2;
  412. Zombies[playerid][NPTIMER] = SetTimerEx("NewPos",300,1,"i",playerid);
  413. }
  414.  
  415. stock AlvoDeAlguem(alvoid){ // Check if the player is target from any zombie.
  416. foreach(Bot,b){
  417. if(Zombies[b][ZombieTarget] == alvoid) return b;
  418. }
  419. return false;
  420. }
  421.  
  422. stock KickZombies(){ //Kick All Zombies.
  423. foreach(Bot,b){
  424. if(!strfind(PlayerName(b),ZOMBIE_NAME,true)){
  425. SetTimerEx("KickZombie",1,0,"i",b);
  426. }
  427. }
  428. }
  429. stock SetPlayerToFacePlayer(playerid, targetid) // From a_angles.inc ( Tannz0rz )
  430. {
  431.  
  432. new
  433. Float:pX,
  434. Float:pY,
  435. Float:pZ,
  436. Float:X,
  437. Float:Y,
  438. Float:Z,
  439. Float:ang;
  440.  
  441. if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid)) return 0;
  442.  
  443. GetPlayerPos(targetid, X, Y, Z);
  444. GetPlayerPos(playerid, pX, pY, pZ);
  445.  
  446. if( Y > pY ) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
  447. else if( Y < pY && X < pX ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
  448. else if( Y < pY ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
  449.  
  450. if(X > pX) ang = (floatabs(floatabs(ang) + 180.0));
  451. else ang = (floatabs(ang) - 180.0);
  452.  
  453. SetPlayerFacingAngle(playerid, ang);
  454.  
  455. return 0;
  456.  
  457. }
  458.  
  459. stock PlayerName(playerid){
  460. new pname[MAX_PLAYER_NAME];
  461. GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
  462. return pname;
  463. }
  464.  
  465. stock Float:GetDistanceToPlayer(playerid,playerid2) {
  466. new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  467. if (!IsPlayerConnected(playerid) || !IsPlayerConnected(playerid2)) {
  468. return -1.00;
  469. }
  470. GetPlayerPos(playerid,x1,y1,z1);
  471. GetPlayerPos(playerid2,x2,y2,z2);
  472. return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  473. }
  474.  
  475. stock GetClosestPlayer(p1){
  476. new Float:dis,Float:dis2,playerid;
  477. playerid = -1;
  478. dis = 99999.99;
  479. foreach(Player,x){
  480. dis2 = GetDistanceToPlayer(p1,x);
  481. if (dis2 < dis && dis2 != -1.00)
  482. {
  483. dis = dis2;
  484. playerid = x;
  485. }
  486. }
  487. //printf("[%d]%s",playerid,PlayerName(playerid));
  488. return playerid;
  489. }
  490. stock Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  491. {
  492. new Float:a;
  493. GetPlayerPos(playerid, x, y, a);
  494. if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  495. else GetPlayerFacingAngle(playerid, a);
  496. x += (distance * floatsin(-a, degrees));
  497. y += (distance * floatcos(-a, degrees));
  498. return a;
  499. }
  500.  
  501. stock IsValidSkin(skinid) // Not mine. Do not remmeber who did it.
  502. {
  503. #define MAX_BAD_SKINS 22
  504. new badSkins[MAX_BAD_SKINS] =
  505. { 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289 };
  506. if (skinid < 0 || skinid > 299) return false;
  507. for (new i = 0; i < MAX_BAD_SKINS; i++) { if (skinid == badSkins[i]) return false; }
  508. #undef MAX_BAD_SKINS
  509. return 1;
  510. }
  511.  
  512. stock Float:GetPlayerSpeed(playerid) // Not mine. Do not remmember who did it. (It dosn't return the right speed, but works for what I need.)
  513. {
  514. new Float:vX, Float:vY, Float:vZ;
  515. if (!IsPlayerInAnyVehicle(playerid))
  516. {
  517. GetPlayerVelocity(playerid, vX, vY, vZ);
  518. }
  519. else
  520. {
  521. GetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, vZ);
  522. }
  523. return floatsqroot(vX*vX + vY*vY + vZ*vZ)*100;
  524. }
  525. stock Float:GetXYInFrontOfVehicle(vehicleid, &Float:x, &Float:y, Float:distance)
  526. {
  527. new Float:a;
  528. GetVehiclePos(vehicleid, x, y, a);
  529. GetVehicleZAngle(vehicleid, a);
  530. x += (distance * floatsin(-a, degrees));
  531. y += (distance * floatcos(-a, degrees));
  532. return a;
  533. }
  534. stock IsPlayerFacingPlayer(playerid, playerid2, Float:dOffset) // From a_angles.inc ( Tannz0rz )
  535. {
  536.  
  537. new
  538. Float:X,
  539. Float:Y,
  540. Float:Z,
  541. Float:pX,
  542. Float:pY,
  543. Float:pZ,
  544. Float:pA,
  545. Float:ang;
  546.  
  547. if(!IsPlayerConnected(playerid)) return 0;
  548.  
  549. GetPlayerPos(playerid2, pX, pY, pZ);
  550. GetPlayerPos(playerid, X, Y, Z);
  551. GetPlayerFacingAngle(playerid, pA);
  552.  
  553. if( Y > pY ) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
  554. else if( Y < pY && X < pX ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
  555. else if( Y < pY ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
  556.  
  557. if(AngleInRangeOfAngle(-ang, pA, dOffset)) return true;
  558.  
  559. return false;
  560. }
  561.  
  562. stock AngleInRangeOfAngle(Float:a1, Float:a2, Float:range) // From a_angles.inc ( Tannz0rz )
  563. {
  564.  
  565. a1 -= a2;
  566. if((a1 < range) && (a1 > -range)) return true;
  567.  
  568. return false;
  569.  
  570. }
  571. //=======================================[ Callbacks ]=========================================//
  572.  
  573. public OnFilterScriptExit()
  574. {
  575. KickZombies();
  576. return 1;
  577. }
  578.  
  579. public OnPlayerConnect(playerid)
  580. {
  581. if(IsPlayerNPC(playerid)){ SpawnPlayer(playerid); }
  582. else{
  583. FiringTimer[playerid] = SetTimerEx("Firing",250,1,"i",playerid);
  584. }
  585. return 1;
  586. }
  587.  
  588. public OnPlayerDisconnect(playerid, reason)
  589. {
  590. if(!IsPlayerNPC(playerid)){
  591. KillTimer(FiringTimer[playerid]);
  592. }
  593. return 1;
  594. }
  595.  
  596. public OnPlayerSpawn(playerid)
  597. {
  598. if(IsPlayerNPC(playerid)){
  599. if(!strfind(PlayerName(playerid),ZOMBIE_NAME,true)){
  600. SetupZombie(playerid);
  601. }
  602. }
  603. if(ZombieKill[playerid] != -1){
  604. Zombies[ZombieKill[playerid]][ZombieKilling] = -1;
  605. ZombieKill[playerid] = -1;
  606. return 1;
  607. }
  608. return 1;
  609. }
  610.  
  611. public OnPlayerDeath(playerid, killerid, reason)
  612. {
  613. if(ZombieKill[playerid] != -1){
  614. SendDeathMessage(ZombieKill[playerid],playerid,reason);
  615. return 1;
  616. }
  617. return 1;
  618. }
  619.  
  620. public OnVehicleSpawn(vehicleid)
  621. {
  622. return 1;
  623. }
  624.  
  625. public OnVehicleDeath(vehicleid, killerid)
  626. {
  627. return 1;
  628. }
  629.  
  630. public OnPlayerText(playerid, text[])
  631. {
  632. return 1;
  633. }
  634.  
  635. public OnPlayerCommandText(playerid, cmdtext[])
  636. {
  637. if(strcmp(cmdtext, "/zombie", true) == 0) {
  638. if(!IsPlayerAdmin(playerid)) return false;
  639. Caller = playerid;
  640. new newname[64];
  641. format(newname,sizeof(newname),"%s_%d",ZOMBIE_NAME,LastAdded);
  642. ConnectNPC(newname,"zombie");
  643. LastAdded++;
  644. return 1;
  645. }
  646. return 0;
  647. }
  648.  
  649. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  650. {
  651. return 1;
  652. }
  653.  
  654. public OnPlayerExitVehicle(playerid, vehicleid)
  655. {
  656. return 1;
  657. }
  658.  
  659. public OnPlayerStateChange(playerid, newstate, oldstate)
  660. {
  661. return 1;
  662. }
  663.  
  664. public OnPlayerEnterCheckpoint(playerid)
  665. {
  666. return 1;
  667. }
  668.  
  669. public OnPlayerLeaveCheckpoint(playerid)
  670. {
  671. return 1;
  672. }
  673.  
  674. public OnPlayerEnterRaceCheckpoint(playerid)
  675. {
  676. return 1;
  677. }
  678.  
  679. public OnPlayerLeaveRaceCheckpoint(playerid)
  680. {
  681. return 1;
  682. }
  683.  
  684. public OnRconCommand(cmd[])
  685. {
  686. return 1;
  687. }
  688.  
  689. public OnPlayerRequestSpawn(playerid)
  690. {
  691. return 1;
  692. }
  693.  
  694. public OnObjectMoved(objectid)
  695. {
  696. return 1;
  697. }
  698.  
  699. public OnPlayerObjectMoved(playerid, objectid)
  700. {
  701. return 1;
  702. }
  703.  
  704. public OnPlayerPickUpPickup(playerid, pickupid)
  705. {
  706. return 1;
  707. }
  708.  
  709. public OnVehicleMod(playerid, vehicleid, componentid)
  710. {
  711. return 1;
  712. }
  713.  
  714. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  715. {
  716. return 1;
  717. }
  718.  
  719. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  720. {
  721. return 1;
  722. }
  723.  
  724. public OnPlayerSelectedMenuRow(playerid, row)
  725. {
  726. return 1;
  727. }
  728.  
  729. public OnPlayerExitedMenu(playerid)
  730. {
  731. return 1;
  732. }
  733.  
  734. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  735. {
  736. return 1;
  737. }
  738.  
  739. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  740. {
  741. return 1;
  742. }
  743.  
  744. public OnRconLoginAttempt(ip[], password[], success)
  745. {
  746. return 1;
  747. }
  748.  
  749. public OnPlayerUpdate(playerid)
  750. {
  751. return 1;
  752. }
  753.  
  754. public OnPlayerStreamIn(playerid, forplayerid)
  755. {
  756. return 1;
  757. }
  758.  
  759. public OnPlayerStreamOut(playerid, forplayerid)
  760. {
  761. return 1;
  762. }
  763.  
  764. public OnVehicleStreamIn(vehicleid, forplayerid)
  765. {
  766. return 1;
  767. }
  768.  
  769. public OnVehicleStreamOut(vehicleid, forplayerid)
  770. {
  771. return 1;
  772. }
  773.  
  774. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  775. {
  776. return 1;
  777. }
  778.  
  779. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  780. {
  781. return 1;
  782. }
  783.  
  784. //=======================================[ End of the File ]=========================================//
Advertisement
Add Comment
Please, Sign In to add comment