Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.13 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define Set(%1,%2) \
  4.     format(%1,sizeof(%1),%2)
  5.  
  6. public OnFilterScriptInit() return Init();
  7. public OnGameModeInit() return Init();
  8. public OnFilterScriptExit() return Exit();
  9. public OnGameModeExit() return Exit();
  10.  
  11. // -- Deaths box -- //
  12. new Text:Death_bg;
  13. new Text:Death_line1;
  14. new Text:Death_line2;
  15. new Text:Death_line3;
  16. new Death_text[3][100];
  17. new bool:Death_show;
  18.  
  19. forward CreateDeathTextdraws();
  20. forward DestroyDeathTextdraws();
  21. forward Init();
  22. forward Exit();
  23.  
  24. public Init()
  25. {
  26.     Death_text[0] = "";
  27.     Death_text[1] = "";
  28.     Death_text[2] = "";
  29.    
  30.     Death_show = false;
  31.     return 1;
  32. }
  33.  
  34. public Exit()
  35. {
  36.     TextDrawHideForAll(Death_bg);
  37.     TextDrawHideForAll(Death_line1);
  38.     TextDrawHideForAll(Death_line2);
  39.     TextDrawHideForAll(Death_line3);
  40.     TextDrawDestroy(Death_bg);
  41.     TextDrawDestroy(Death_line1);
  42.     TextDrawDestroy(Death_line2);
  43.     TextDrawDestroy(Death_line3);
  44.     return 1;
  45. }
  46.  
  47. public OnPlayerDeath(playerid, killerid, reason)
  48. {
  49.     if(!Death_show)
  50.     {
  51.         CreateDeathTextdraws();
  52.         TextDrawShowForAll(Death_bg);
  53.         TextDrawShowForAll(Death_line1);
  54.         TextDrawShowForAll(Death_line2);
  55.         TextDrawShowForAll(Death_line3);
  56.         Death_show = true;
  57.     }
  58.    
  59.     new test[15];
  60.     format(test,15,"reason: %i",reason);
  61.     GameTextForPlayer(killerid,test,2000,5);
  62.    
  63.     format(Death_text[2],100,Death_text[1]);
  64.     format(Death_text[1],100,Death_text[0]);
  65.     if(killerid != INVALID_PLAYER_ID)
  66.     {
  67.         format(Death_text[0],100,"~b~%s ~w~killed ~b~%s ~w~(%s)",ReturnPname(killerid),ReturnPname(playerid),GetDeathReason(reason));
  68.     }
  69.     else format(Death_text[0],100,"~b~%s ~w~is death ~w~(%s)",ReturnPname(playerid),GetDeathReason(reason));
  70.    
  71.     TextDrawSetString(Death_line3,Death_text[2]);
  72.     TextDrawSetString(Death_line2,Death_text[1]);
  73.     TextDrawSetString(Death_line1,Death_text[0]);
  74.     return 1;
  75. }
  76.  
  77. stock ReturnPname(id)
  78. {
  79.     new name[MAX_PLAYER_NAME];
  80.     GetPlayerName(id,name,MAX_PLAYER_NAME);
  81.     return name;
  82. }
  83.  
  84. stock GetDeathReason(reason)
  85. {
  86.     new string[25];
  87.     switch(reason)
  88.     {
  89.         case 0: Set(string,"Fists");
  90.         case 1: Set(string,"Knuckles");
  91.         case 2: Set(string,"Golf Club");
  92.         case 3: Set(string,"Nite Stick");
  93.         case 4: Set(string,"Knife");
  94.         case 5: Set(string,"Baseball Bat");
  95.         case 6: Set(string,"Shovel");
  96.         case 7: Set(string,"Pool Cue");
  97.         case 8: Set(string,"Katana");
  98.         case 9: Set(string,"Chainsaw");
  99.         case 10: Set(string,"Dildo");
  100.         case 11: Set(string,"Vibrator");
  101.         case 12: Set(string,"Vibrator");
  102.         case 13: Set(string,"Vibrator");
  103.         case 14: Set(string,"Flowers");
  104.         case 15: Set(string,"Cane");
  105.         case 16: Set(string,"Grenade");
  106.         case 17: Set(string,"Tear Gas");
  107.         case 18: Set(string,"Molotov Cocktail");
  108.         case 22: Set(string,"9mm");
  109.         case 23: Set(string,"9mm Silenced");
  110.         case 24: Set(string,"Desert Eagle");
  111.         case 25: Set(string,"Shotgun");
  112.         case 26: Set(string,"Sawn-off");
  113.         case 27: Set(string,"Spas-12");
  114.         case 28: Set(string,"UZI");
  115.         case 29: Set(string,"MP5");
  116.         case 30: Set(string,"Ak-47");
  117.         case 31: Set(string,"M4 Carabine");
  118.         case 32: Set(string,"Tec-9");
  119.         case 33: Set(string,"Rifle");
  120.         case 34: Set(string,"Sniper");
  121.         case 35: Set(string,"Bazooka");
  122.         case 36: Set(string,"Stinger");
  123.         case 37: Set(string,"Flamethrower");
  124.         case 38: Set(string,"Minigun");
  125.         case 39: Set(string,"C4");
  126.         case 40: Set(string,"C4");
  127.         case 41: Set(string,"Sptaycan");
  128.         case 42: Set(string,"Fire Extinguisher");
  129.         case 43: Set(string,"Camera");
  130.         case 44: Set(string,"Nightvision");
  131.         case 45: Set(string,"Thermal");
  132.         case 46: Set(string,"Parachute");
  133.         case 47: Set(string,"Explosion");
  134.         case 49: Set(string,"Vehicle");
  135.         case 50: Set(string,"Helicopter");
  136.         case 51: Set(string,"Explosion");
  137.         case 53: Set(string,"Drowned");
  138.         case 54: Set(string,"Fall");
  139.         case 200: Set(string,"Connect");
  140.         case 201: Set(string,"Disconnect");
  141.         default: Set(string,"Unknown");
  142.     }
  143.     return string;
  144. }
  145.  
  146. public OnPlayerSpawn(playerid)
  147. {
  148.     TextDrawShowForPlayer(playerid,Death_bg);
  149.     TextDrawShowForPlayer(playerid,Death_line1);
  150.     TextDrawShowForPlayer(playerid,Death_line2);
  151.     TextDrawShowForPlayer(playerid,Death_line3);
  152.     return 1;
  153. }
  154.  
  155. public OnPlayerDisconnect(playerid, reason)
  156. {
  157.     TextDrawHideForPlayer(playerid,Death_bg);
  158.     TextDrawHideForPlayer(playerid,Death_line1);
  159.     TextDrawHideForPlayer(playerid,Death_line2);
  160.     TextDrawHideForPlayer(playerid,Death_line3);
  161.     return 1;
  162. }
  163.  
  164. public CreateDeathTextdraws()
  165. {
  166.     // -- Deaths box -- //
  167.     Death_bg = TextDrawCreate(446.000000,411.000000," ~n~ ~n~");
  168.     Death_line1 = TextDrawCreate(449.000000,412.000000," ");
  169.     Death_line2 = TextDrawCreate(449.000000,421.000000," ");
  170.     Death_line3 = TextDrawCreate(449.000000,430.000000," ");
  171.     // -- Background @ Deaths box -- //
  172.     TextDrawUseBox(Death_bg,1);
  173.     TextDrawBoxColor(Death_bg,0x00000066);
  174.     TextDrawTextSize(Death_bg,628.000000,143.000000);
  175.     TextDrawAlignment(Death_bg,0);
  176.     TextDrawBackgroundColor(Death_bg,0x000000ff);
  177.     TextDrawFont(Death_bg,3);
  178.     TextDrawLetterSize(Death_bg,1.200000,1.699998);
  179.     TextDrawColor(Death_bg,0xffffffff);
  180.     TextDrawSetOutline(Death_bg,1);
  181.     TextDrawSetProportional(Death_bg,1);
  182.     TextDrawSetShadow(Death_bg,1);
  183.     // -- Line 1 @ Deaths box -- //
  184.     TextDrawAlignment(Death_line1,0);
  185.     TextDrawBackgroundColor(Death_line1,0x000000ff);
  186.     TextDrawFont(Death_line1,1);
  187.     TextDrawLetterSize(Death_line1,0.299999,1.000000);
  188.     TextDrawColor(Death_line1,0xffffffff);
  189.     TextDrawSetOutline(Death_line1,1);
  190.     TextDrawSetProportional(Death_line1,1);
  191.     TextDrawSetShadow(Death_line1,1);
  192.     // -- Line 2 @ Deaths box -- //
  193.     TextDrawAlignment(Death_line2,0);
  194.     TextDrawBackgroundColor(Death_line2,0x000000ff);
  195.     TextDrawFont(Death_line2,1);
  196.     TextDrawLetterSize(Death_line2,0.299999,1.000000);
  197.     TextDrawColor(Death_line2,0xffffffff);
  198.     TextDrawSetOutline(Death_line2,1);
  199.     TextDrawSetProportional(Death_line2,1);
  200.     TextDrawSetShadow(Death_line2,1);
  201.     // -- Line 3 @ Deaths box -- //
  202.     TextDrawAlignment(Death_line3,0);
  203.     TextDrawBackgroundColor(Death_line3,0x000000ff);
  204.     TextDrawFont(Death_line3,1);
  205.     TextDrawLetterSize(Death_line3,0.299999,1.000000);
  206.     TextDrawColor(Death_line3,0xffffffff);
  207.     TextDrawSetOutline(Death_line3,1);
  208.     TextDrawSetProportional(Death_line3,1);
  209.     TextDrawSetShadow(Death_line3,1);
  210.     return 1;
  211. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement