Guest User

dddd

a guest
Nov 12th, 2016
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.69 KB | None | 0 0
  1. /*
  2. Death Message (textdraw) by Jelly23
  3. */
  4. #define FILTERSCRIPT
  5.  
  6. /*Includes*/
  7. #include <a_samp>
  8. #include <izcmd>
  9.  
  10. /*TextDraws (Global)*/
  11. new Text:Kill_Box;
  12. new Text:Kill_IconBox;
  13. new Text:Kill_Msg;
  14.  
  15. /*TextDraws (Per-Player)*/
  16. new PlayerText:Kill_Name[MAX_PLAYERS];
  17. new PlayerText:Kill_Icon[MAX_PLAYERS];
  18.  
  19. /*Strings*/
  20. new name[MAX_PLAYER_NAME],globalstr[128];
  21.  
  22. /*Array(s)*/
  23. new SelectedIcon[MAX_PLAYERS];
  24.  
  25. #if defined FILTERSCRIPT
  26.  
  27. public OnFilterScriptInit()
  28. {
  29. print("\n--------------------------------------");
  30. print(" Death Message made by Jelly23");
  31. print("--------------------------------------\n");
  32.  
  33. /*Creating the TextDraws*/
  34. Kill_Box = TextDrawCreate(225.000000, 190.000000, "box");
  35. TextDrawLetterSize(Kill_Box, 0.000000, 2.705498);
  36. TextDrawTextSize(Kill_Box, 446.989501, 0.000000);
  37. TextDrawAlignment(Kill_Box, 1);
  38. TextDrawColor(Kill_Box, -1061109505);
  39. TextDrawUseBox(Kill_Box, 1);
  40. TextDrawBoxColor(Kill_Box, 120);
  41. TextDrawSetShadow(Kill_Box, 0);
  42. TextDrawSetOutline(Kill_Box, 0);
  43. TextDrawBackgroundColor(Kill_Box, 255);
  44. TextDrawFont(Kill_Box, 1);
  45. TextDrawSetProportional(Kill_Box, 1);
  46. TextDrawSetShadow(Kill_Box, 0);
  47.  
  48. Kill_IconBox = TextDrawCreate(225.000000, 190.000000, "box");
  49. TextDrawLetterSize(Kill_IconBox, 0.000000, 2.644498);
  50. TextDrawTextSize(Kill_IconBox, 250.654998, 0.000000);
  51. TextDrawAlignment(Kill_IconBox, 1);
  52. TextDrawColor(Kill_IconBox, -1);
  53. TextDrawUseBox(Kill_IconBox, 1);
  54. TextDrawBoxColor(Kill_IconBox, 100);
  55. TextDrawSetShadow(Kill_IconBox, 0);
  56. TextDrawSetOutline(Kill_IconBox, 0);
  57. TextDrawBackgroundColor(Kill_IconBox, 255);
  58. TextDrawFont(Kill_IconBox, 1);
  59. TextDrawSetProportional(Kill_IconBox, 1);
  60. TextDrawSetShadow(Kill_IconBox, 0);
  61.  
  62. Kill_Msg = TextDrawCreate(261.875000, 204.666702, "KILLED_YOU");
  63. TextDrawLetterSize(Kill_Msg, 0.231249, 1.010833);
  64. TextDrawAlignment(Kill_Msg, 1);
  65. TextDrawColor(Kill_Msg, -2147483393);
  66. TextDrawSetShadow(Kill_Msg, 0);
  67. TextDrawSetOutline(Kill_Msg, 0);
  68. TextDrawBackgroundColor(Kill_Msg, 255);
  69. TextDrawFont(Kill_Msg, 1);
  70. TextDrawSetProportional(Kill_Msg, 1);
  71. TextDrawSetShadow(Kill_Msg, 0);
  72. return 1;
  73. }
  74.  
  75. public OnFilterScriptExit()
  76. {
  77. /*Destroys them, so we don't face problems in the future*/
  78. TextDrawDestroy(Kill_Box);
  79. TextDrawDestroy(Kill_IconBox);
  80. TextDrawDestroy(Kill_Msg);
  81. return 1;
  82. }
  83.  
  84. #else
  85.  
  86. main()
  87. {
  88. print("\n----------------------------------");
  89. print(" Death Message made by Jelly23");
  90. print("----------------------------------\n");
  91. }
  92.  
  93. #endif
  94.  
  95. /*Callbacks*/
  96. public OnPlayerConnect(playerid)
  97. {
  98. SelectedIcon[playerid] = 0;
  99.  
  100. Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:pm3");
  101. PlayerTextDrawLetterSize(playerid, Kill_Icon[playerid], 0.000000, 0.000000);
  102. PlayerTextDrawTextSize(playerid, Kill_Icon[playerid], 20.000000, 15.916665);
  103. PlayerTextDrawAlignment(playerid, Kill_Icon[playerid], 1);
  104. PlayerTextDrawColor(playerid, Kill_Icon[playerid], -1);
  105. PlayerTextDrawSetShadow(playerid, Kill_Icon[playerid], 0);
  106. PlayerTextDrawSetOutline(playerid, Kill_Icon[playerid], 0);
  107. PlayerTextDrawBackgroundColor(playerid, Kill_Icon[playerid], 255);
  108. PlayerTextDrawFont(playerid, Kill_Icon[playerid], 4);
  109. PlayerTextDrawSetProportional(playerid, Kill_Icon[playerid], 0);
  110. PlayerTextDrawSetShadow(playerid, Kill_Icon[playerid], 0);
  111.  
  112. Kill_Name[playerid] = CreatePlayerTextDraw(playerid, 260.000000, 191.166702, "Name");
  113. PlayerTextDrawLetterSize(playerid, Kill_Name[playerid], 0.278750, 1.203333);
  114. PlayerTextDrawAlignment(playerid, Kill_Name[playerid], 1);
  115. PlayerTextDrawColor(playerid, Kill_Name[playerid], -1);
  116. PlayerTextDrawSetShadow(playerid, Kill_Name[playerid], 0);
  117. PlayerTextDrawSetOutline(playerid, Kill_Name[playerid], 0);
  118. PlayerTextDrawBackgroundColor(playerid, Kill_Name[playerid], 255);
  119. PlayerTextDrawFont(playerid, Kill_Name[playerid], 1);
  120. PlayerTextDrawSetProportional(playerid, Kill_Name[playerid], 1);
  121. PlayerTextDrawSetShadow(playerid, Kill_Name[playerid], 0);
  122. return 1;
  123. }
  124.  
  125. public OnPlayerDeath(playerid, killerid, reason)
  126. {
  127. if(killerid != INVALID_PLAYER_ID)
  128. {
  129. TextDrawShowForPlayer(playerid,Kill_Box);
  130. TextDrawShowForPlayer(playerid,Kill_IconBox);
  131. TextDrawShowForPlayer(playerid,Kill_Msg);
  132. GetPlayerName(killerid,name,sizeof(name));
  133. format(globalstr,sizeof(globalstr),"%s(%i)",name,killerid);
  134. PlayerTextDrawSetString(playerid, Kill_Name[playerid], globalstr);
  135. PlayerTextDrawShow(playerid,Kill_Name[playerid]);
  136. UpdateIconSprite(killerid,playerid);
  137. PlayerTextDrawShow(playerid,Kill_Icon[playerid]);
  138. }
  139. return 1;
  140. }
  141.  
  142. public OnPlayerSpawn(playerid)
  143. {
  144. TextDrawHideForPlayer(playerid,Kill_Box);
  145. TextDrawHideForPlayer(playerid,Kill_IconBox);
  146. TextDrawHideForPlayer(playerid,Kill_Msg);
  147. PlayerTextDrawHide(playerid,Kill_Name[playerid]);
  148. PlayerTextDrawHide(playerid,Kill_Icon[playerid]);
  149. return 1;
  150. }
  151.  
  152. /*Function(s)*/
  153. UpdateIconSprite(killerid,playerid)
  154. {
  155. PlayerTextDrawDestroy(playerid,Kill_Icon[playerid]);
  156. switch(SelectedIcon[killerid])
  157. {
  158. case 1: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:ps1");
  159. case 2: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:ps2");
  160. case 3: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:ps3");
  161. case 4: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:pm2");
  162. case 5: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:pa");
  163. default: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:pm3");
  164. }
  165. PlayerTextDrawLetterSize(playerid, Kill_Icon[playerid], 0.000000, 0.000000);
  166. PlayerTextDrawTextSize(playerid, Kill_Icon[playerid], 20.000000, 15.916665);
  167. PlayerTextDrawAlignment(playerid, Kill_Icon[playerid], 1);
  168. PlayerTextDrawColor(playerid, Kill_Icon[playerid], -1);
  169. PlayerTextDrawSetShadow(playerid, Kill_Icon[playerid], 0);
  170. PlayerTextDrawSetOutline(playerid, Kill_Icon[playerid], 0);
  171. PlayerTextDrawBackgroundColor(playerid, Kill_Icon[playerid], 255);
  172. PlayerTextDrawFont(playerid, Kill_Icon[playerid], 4);
  173. PlayerTextDrawSetProportional(playerid, Kill_Icon[playerid], 0);
  174. PlayerTextDrawSetShadow(playerid, Kill_Icon[playerid], 0);
  175. }
  176.  
  177. /*Command(s)*/
  178. CMD:seticon(playerid,params[])
  179. {
  180. if(isnull(params)) return SendClientMessage(playerid,-1,"/seticon [icon id]");
  181. if(0 < strval(params) > 5) return SendClientMessage(playerid,-1,"Ids are between 0-5");
  182. SelectedIcon[playerid] = strval(params);
  183. format(globalstr,sizeof(globalstr),"You have set your icon to %i",strval(params));
  184. SendClientMessage(playerid,-1,globalstr);
  185. return 1;
  186. }
Advertisement
Add Comment
Please, Sign In to add comment