Advertisement
Guest User

Wafffllesss

a guest
Feb 7th, 2010
2,893
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.58 KB | None | 0 0
  1. /*
  2. Timers por player: 1*
  3. Timer por Zombie: 3*
  4.  
  5. *Rodando constantemente.
  6. =====================================================================================================
  7. Este � o Filterscript de Zombies feito por Wafffllesss ( Henrique Pauli ). Este � meu primeiro
  8. Filterscript e meu primeiro trabalho com NPC's. Espero que goste do filterscript e que traga
  9. muita divers�o para seu servidos. Por favor n�o remova os cr�ditos.
  10.  
  11. *Voc� pode modificar este filterscript como quiser.
  12. *Voc� pode usar este filterscript onde quiser.
  13. =====================================================================================================
  14. */
  15.  
  16. // O Skin do Zombie.
  17. // -1: Vai alterar entre os definidos na vari�vel abaixo.
  18. // -2: Randomiza qualquer um dos skins validos do jogo.
  19. // Qualquer outro numero far� o skin ser o numero definido.
  20. static Zombie_Skin = -2;
  21.  
  22. //Se tiver Zombie no nome, ser� um Zombie. ( altere a seu gosto ).
  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 NovaPos(playerid);
  39. forward CheckHP(playerid);
  40. forward KilledBy(playerid,killer);
  41. forward KickZombie(playerid);
  42. forward Atirando(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. // Se o Zombie_Skin for igual a -1, defina os skins abaixo:
  49. new ZombieSkins[]={
  50. 1,
  51. 7,
  52. 9,
  53. 10,
  54. 45
  55. // Aten��o, o ultimo skin n�o leva v�rgula.
  56. };
  57.  
  58.  
  59. enum ZombieEnum{
  60. ZombieSpawned,
  61. ZombieTarget,
  62. ZombieRunning,
  63. ZombieKilling,
  64. NPTIMER,
  65. Ztimers,
  66. Float:LastZombieHealth,
  67. Morrendo,
  68. HPtimer
  69. }
  70. new Zombies[200][ZombieEnum];
  71.  
  72. new AtirandoTimer[200];
  73. new AtirandoClick[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. // Cria as vari�veis Itter para o Foreach quando o script inicia ( se tiverem players/npcs online )
  179. for(new i =0; i<= MAX_PLAYERS;i++){
  180. if(IsPlayerConnected(i) && !IsPlayerNPC(i)){
  181. Itter_Add(Player,i);
  182. AtirandoTimer[i] = SetTimerEx("Atirando",250,1,"i",i);
  183. ZombieKill[i] = -1;
  184. }
  185. else if(IsPlayerConnected(i) && IsPlayerNPC(i)){
  186. Itter_Add(Bot,i);
  187.  
  188. //Se For Zombie, ativa ele.
  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 por Wafffllesss ");
  201. print("=====================================\n");
  202. return 1;
  203. }
  204.  
  205. //=======================================[ Timers ]=========================================//
  206. public Atirando(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(!AtirandoClick[playerid] || Automatic(weapon))
  214. {
  215. AtirandoClick[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][Morrendo]){
  222. SendDeathMessage(playerid,b,weapon);
  223. Zombies[b][Morrendo] = true;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }else{
  230. AtirandoClick[playerid] = false;
  231. }
  232. }
  233. public KickZombie(playerid){
  234. Kick(playerid);
  235. Zombies[playerid][Morrendo]=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){ // Checka o HP do Zombie.
  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][Morrendo] = true;
  259. }
  260. }
  261.  
  262. public NovaPos(playerid){ // Faz com que o zombie Caminhe / Corra
  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){ // Detecta player mais perto e vai atras
  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. GetPlayerHealth(cp,h);
  312. if(GetDistanceToPlayer(playerid,cp) > 1.5){
  313. SetPlayerHealth(cp,h-5.0);
  314. }else{
  315. if(Zombies[playerid][ZombieKilling]==-1){
  316. if(!EstaMorrendo(cp)){
  317. FinishHim(playerid,cp);
  318. }
  319. }
  320. }
  321. }
  322. }
  323. }
  324. }
  325. public KilledBy(playerid,killer){ // Aplica anima��o 'Morrendo' e mata 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. //=======================================[ Fun�es ]=========================================//
  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 EstaMorrendo(playerid){ // Verifica se algum zombie esta executando o golpe final no player
  342. foreach(Bot,b){
  343. if(Zombies[b][ZombieKilling] == playerid) return true;
  344. }
  345. return false;
  346. }
  347. stock SetupZombie(playerid){ // Ativa o 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,"Um Zombie Entrou!");
  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){ // Inicia o golpe final do Zombie
  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){ // Faz o zombie parar de andar
  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){ //Faz o zombie ir para o player designado. modo: 1- Caminha | 2- Corre
  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){ //Caminhar para frente.
  406. Zombies[playerid][ZombieRunning] = 1;
  407. Zombies[playerid][NPTIMER] = SetTimerEx("NovaPos",400,1,"i",playerid);
  408. }
  409.  
  410. stock Correr(playerid){ //Correr para frente.
  411. Zombies[playerid][ZombieRunning] = 2;
  412. Zombies[playerid][NPTIMER] = SetTimerEx("NovaPos",300,1,"i",playerid);
  413. }
  414.  
  415. stock AlvoDeAlguem(alvoid){ // Checka se o player � alvo de algum Zombie
  416. foreach(Bot,b){
  417. if(Zombies[b][ZombieTarget] == alvoid) return b;
  418. }
  419. return false;
  420. }
  421.  
  422. stock KickZombies(){ //Kicka os Zombies.
  423. foreach(Bot,b){
  424. if(!strfind(PlayerName(b),ZOMBIE_NAME,true)) Kick(b);
  425. }
  426. }
  427. stock SetPlayerToFacePlayer(playerid, targetid) // De a_angles.inc ( Tannz0rz )
  428. {
  429.  
  430. new
  431. Float:pX,
  432. Float:pY,
  433. Float:pZ,
  434. Float:X,
  435. Float:Y,
  436. Float:Z,
  437. Float:ang;
  438.  
  439. if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid)) return 0;
  440.  
  441. GetPlayerPos(targetid, X, Y, Z);
  442. GetPlayerPos(playerid, pX, pY, pZ);
  443.  
  444. if( Y > pY ) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
  445. else if( Y < pY && X < pX ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
  446. else if( Y < pY ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
  447.  
  448. if(X > pX) ang = (floatabs(floatabs(ang) + 180.0));
  449. else ang = (floatabs(ang) - 180.0);
  450.  
  451. SetPlayerFacingAngle(playerid, ang);
  452.  
  453. return 0;
  454.  
  455. }
  456.  
  457. stock PlayerName(playerid){
  458. new pname[MAX_PLAYER_NAME];
  459. GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
  460. return pname;
  461. }
  462.  
  463. stock Float:GetDistanceToPlayer(playerid,playerid2) {
  464. new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  465. if (!IsPlayerConnected(playerid) || !IsPlayerConnected(playerid2)) {
  466. return -1.00;
  467. }
  468. GetPlayerPos(playerid,x1,y1,z1);
  469. GetPlayerPos(playerid2,x2,y2,z2);
  470. return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  471. }
  472.  
  473. stock GetClosestPlayer(p1){
  474. new Float:dis,Float:dis2,playerid;
  475. playerid = -1;
  476. dis = 99999.99;
  477. foreach(Player,x){
  478. dis2 = GetDistanceToPlayer(p1,x);
  479. if (dis2 < dis && dis2 != -1.00)
  480. {
  481. dis = dis2;
  482. playerid = x;
  483. }
  484. }
  485. return playerid;
  486. }
  487. stock Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  488. {
  489. new Float:a;
  490. GetPlayerPos(playerid, x, y, a);
  491. if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  492. else GetPlayerFacingAngle(playerid, a);
  493. x += (distance * floatsin(-a, degrees));
  494. y += (distance * floatcos(-a, degrees));
  495. return a;
  496. }
  497.  
  498. stock IsValidSkin(skinid) // N�o � minha. N�o lembro o criador..
  499. {
  500. #define MAX_BAD_SKINS 22
  501. new badSkins[MAX_BAD_SKINS] =
  502. { 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289 };
  503. if (skinid < 0 || skinid > 299) return false;
  504. for (new i = 0; i < MAX_BAD_SKINS; i++) { if (skinid == badSkins[i]) return false; }
  505. #undef MAX_BAD_SKINS
  506. return 1;
  507. }
  508.  
  509. stock Float:GetPlayerSpeed(playerid) // N�o � minha. N�o lembro o criador.. (N�o da a velocidade certa, mais serve para o que eu preciso.)
  510. {
  511. new Float:vX, Float:vY, Float:vZ;
  512. if (!IsPlayerInAnyVehicle(playerid))
  513. {
  514. GetPlayerVelocity(playerid, vX, vY, vZ);
  515. }
  516. else
  517. {
  518. GetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, vZ);
  519. }
  520. return floatsqroot(vX*vX + vY*vY + vZ*vZ)*100;
  521. }
  522. stock Float:GetXYInFrontOfVehicle(vehicleid, &Float:x, &Float:y, Float:distance)
  523. {
  524. new Float:a;
  525. GetVehiclePos(vehicleid, x, y, a);
  526. GetVehicleZAngle(vehicleid, a);
  527. x += (distance * floatsin(-a, degrees));
  528. y += (distance * floatcos(-a, degrees));
  529. return a;
  530. }
  531. stock IsPlayerFacingPlayer(playerid, playerid2, Float:dOffset) // De a_angles.inc ( Tannz0rz )
  532. {
  533.  
  534. new
  535. Float:X,
  536. Float:Y,
  537. Float:Z,
  538. Float:pX,
  539. Float:pY,
  540. Float:pZ,
  541. Float:pA,
  542. Float:ang;
  543.  
  544. if(!IsPlayerConnected(playerid)) return 0;
  545.  
  546. GetPlayerPos(playerid2, pX, pY, pZ);
  547. GetPlayerPos(playerid, X, Y, Z);
  548. GetPlayerFacingAngle(playerid, pA);
  549.  
  550. if( Y > pY ) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
  551. else if( Y < pY && X < pX ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
  552. else if( Y < pY ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
  553.  
  554. if(AngleInRangeOfAngle(-ang, pA, dOffset)) return true;
  555.  
  556. return false;
  557. }
  558.  
  559. stock AngleInRangeOfAngle(Float:a1, Float:a2, Float:range) // De a_angles.inc ( Tannz0rz )
  560. {
  561.  
  562. a1 -= a2;
  563. if((a1 < range) && (a1 > -range)) return true;
  564.  
  565. return false;
  566.  
  567. }
  568. //=======================================[ Callbacks ]=========================================//
  569.  
  570. public OnFilterScriptExit()
  571. {
  572. KickZombies();
  573. return 1;
  574. }
  575.  
  576. public OnPlayerConnect(playerid)
  577. {
  578. if(IsPlayerNPC(playerid)){ SpawnPlayer(playerid); }
  579. else{ AtirandoTimer[playerid] = SetTimerEx("Atirando",250,1,"i",playerid);}
  580. return 1;
  581. }
  582.  
  583. public OnPlayerDisconnect(playerid, reason)
  584. {
  585. if(!IsPlayerNPC(playerid)){
  586. KillTimer(AtirandoTimer[playerid]);
  587. }
  588. return 1;
  589. }
  590.  
  591. public OnPlayerSpawn(playerid)
  592. {
  593. if(IsPlayerNPC(playerid)){
  594. if(!strfind(PlayerName(playerid),ZOMBIE_NAME,true)){
  595. SetupZombie(playerid);
  596. }
  597. }
  598. if(ZombieKill[playerid] != -1){
  599. Zombies[ZombieKill[playerid]][ZombieKilling] = -1;
  600. ZombieKill[playerid] = -1;
  601. return 1;
  602. }
  603. return 1;
  604. }
  605.  
  606. public OnPlayerDeath(playerid, killerid, reason)
  607. {
  608. if(ZombieKill[playerid] != -1){
  609. SendDeathMessage(ZombieKill[playerid],playerid,reason);
  610. return 1;
  611. }
  612. return 1;
  613. }
  614.  
  615. public OnVehicleSpawn(vehicleid)
  616. {
  617. return 1;
  618. }
  619.  
  620. public OnVehicleDeath(vehicleid, killerid)
  621. {
  622. return 1;
  623. }
  624.  
  625. public OnPlayerText(playerid, text[])
  626. {
  627. return 1;
  628. }
  629.  
  630. public OnPlayerCommandText(playerid, cmdtext[])
  631. {
  632. if(strcmp(cmdtext, "/zombie", true) == 0) {
  633. if(!IsPlayerAdmin(playerid)) return false;
  634. Caller = playerid;
  635. new novonome[64];
  636. format(novonome,sizeof(novonome),"%s_%d",ZOMBIE_NAME,LastAdded);
  637. ConnectNPC(novonome,"zombie");
  638. LastAdded++;
  639. return 1;
  640. }
  641. return 0;
  642. }
  643.  
  644. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  645. {
  646. return 1;
  647. }
  648.  
  649. public OnPlayerExitVehicle(playerid, vehicleid)
  650. {
  651. return 1;
  652. }
  653.  
  654. public OnPlayerStateChange(playerid, newstate, oldstate)
  655. {
  656. return 1;
  657. }
  658.  
  659. public OnPlayerEnterCheckpoint(playerid)
  660. {
  661. return 1;
  662. }
  663.  
  664. public OnPlayerLeaveCheckpoint(playerid)
  665. {
  666. return 1;
  667. }
  668.  
  669. public OnPlayerEnterRaceCheckpoint(playerid)
  670. {
  671. return 1;
  672. }
  673.  
  674. public OnPlayerLeaveRaceCheckpoint(playerid)
  675. {
  676. return 1;
  677. }
  678.  
  679. public OnRconCommand(cmd[])
  680. {
  681. return 1;
  682. }
  683.  
  684. public OnPlayerRequestSpawn(playerid)
  685. {
  686. return 1;
  687. }
  688.  
  689. public OnObjectMoved(objectid)
  690. {
  691. return 1;
  692. }
  693.  
  694. public OnPlayerObjectMoved(playerid, objectid)
  695. {
  696. return 1;
  697. }
  698.  
  699. public OnPlayerPickUpPickup(playerid, pickupid)
  700. {
  701. return 1;
  702. }
  703.  
  704. public OnVehicleMod(playerid, vehicleid, componentid)
  705. {
  706. return 1;
  707. }
  708.  
  709. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  710. {
  711. return 1;
  712. }
  713.  
  714. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  715. {
  716. return 1;
  717. }
  718.  
  719. public OnPlayerSelectedMenuRow(playerid, row)
  720. {
  721. return 1;
  722. }
  723.  
  724. public OnPlayerExitedMenu(playerid)
  725. {
  726. return 1;
  727. }
  728.  
  729. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  730. {
  731. return 1;
  732. }
  733.  
  734. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  735. {
  736. return 1;
  737. }
  738.  
  739. public OnRconLoginAttempt(ip[], password[], success)
  740. {
  741. return 1;
  742. }
  743.  
  744. public OnPlayerUpdate(playerid)
  745. {
  746. return 1;
  747. }
  748.  
  749. public OnPlayerStreamIn(playerid, forplayerid)
  750. {
  751. return 1;
  752. }
  753.  
  754. public OnPlayerStreamOut(playerid, forplayerid)
  755. {
  756. return 1;
  757. }
  758.  
  759. public OnVehicleStreamIn(vehicleid, forplayerid)
  760. {
  761. return 1;
  762. }
  763.  
  764. public OnVehicleStreamOut(vehicleid, forplayerid)
  765. {
  766. return 1;
  767. }
  768.  
  769. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  770. {
  771. return 1;
  772. }
  773.  
  774. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  775. {
  776. return 1;
  777. }
  778.  
  779. //=======================================[ Fim do Documento ]=========================================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement