Advertisement
MarcioSiqueira

Untitled

Jul 15th, 2015
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.70 KB | None | 0 0
  1. ed
  2. // public usada quando jogadores matam uns aos outros.
  3. public OnPlayerDeath(playerid, killerid, reason)
  4.  
  5. /*
  6. playerid =  Acusado
  7. killerid = Vítima
  8. */  
  9.  
  10. // Obtém o ID do veiculo que o acusado ocupa.
  11. GetPlayerVehicleID(playerid)
  12.  
  13. //Aqui será definido o ID das aeronaves.
  14. IsAAviao(carid)
  15. IsAHelicoptero(carid)  
  16.  
  17. // Nossa string definida com o valor dela.
  18. new string[256]  
  19.  
  20. // Nossa new definida, irá definir o nome do acusado e da vítima.
  21. new acusado[MAX_PLAYER_NAME], vitima[MAX_PLAYER_NAME];  
  22.  
  23. // Obtém o nome do acusado e da vítima.
  24. GetPlayerName(killerid, acusado, MAX_PLAYER_NAME);
  25. GetPlayerName(playerid, vitima, MAX_PLAYER_NAME);
  26.  
  27. // Verifica se o assassino esta em um veículo.
  28. GetPlayerState(killerid) == PLAYER_STATE_DRIVER  
  29.  
  30. // Manda a mensagem para todos online no servidor e assim desmascarando o acusado.
  31. format(string, sizeof(string), "[Anti drive-by]: %s cometeu drive-by em %s e será punido por um admin.", acusado, vitima);
  32. SendClientMessageToAll(0xE60000FF, string);  
  33.  
  34. // Para que os jogadores em aeronaves não sejam acusados, adicione as seguintes stock em seu gamemode!
  35. stock IsAHelicoptero(carid)
  36. {
  37.     new modelid = GetVehicleModel(carid);
  38.     if(modelid == 563 || modelid == 548 || modelid == 497 || modelid == 488 || modelid == 487)
  39.     {
  40.         return 1;
  41.     }
  42.     if(modelid == 425 || modelid == 417 || modelid == 447 || modelid == 469)
  43.     {
  44.         return 1;
  45.     }
  46.     return 0;
  47. }
  48.  
  49. stock IsAAviao(carid)
  50. {
  51.     new modelid = GetVehicleModel(carid);
  52.     if(modelid == 460 || modelid == 476 || modelid == 511 || modelid == 512)
  53.     {
  54.         return 1;
  55.     }
  56.     if(modelid == 513 || modelid == 519 || modelid == 520 || modelid == 553)
  57.     {
  58.         return 1;
  59.     }
  60.     if(modelid == 577 || modelid == 592 || modelid == 593)
  61.     {
  62.         return 1;
  63.     }
  64.     return 0;
  65. }  
  66.  
  67.  
  68. // Nosso anti-drive by foi feito com sucesso, adicione em sua OnPlayerDeath, e adicione também as duas seguintes stock, IsAAviao e IsAHelicoptero em seu gamemode.
  69.  
  70. public OnPlayerDeath(playerid, killerid, reason){
  71.  
  72.     if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER){
  73.    
  74.         if(IsAHelicoptero(GetPlayerVehicleID(killerid)) || IsAAviao(GetPlayerVehicleID(killerid))) return 1;
  75.  
  76.         new string[256], acusado[MAX_PLAYER_NAME], vitima[MAX_PLAYER_NAME];
  77.         GetPlayerName(killerid, acusado, MAX_PLAYER_NAME);
  78.         GetPlayerName(playerid, vitima, MAX_PLAYER_NAME);
  79.         format(string, sizeof(string), "[Anti drive-by]: %s cometeu drive-by em %s e será punido por um admin.", acusado, vitima);
  80.         SendClientMessageToAll(0xE60000FF, string);
  81.     }
  82.     return 1;
  83. }  
  84.  
  85.  
  86. /*
  87. Créditos: Márcio Siqueira///Gáin e a www.HomeHots.com.br
  88. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement