Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - /*
 - Death Message (textdraw) by Jelly23
 - */
 - #define FILTERSCRIPT
 - /*Includes*/
 - #include <a_samp>
 - #include <izcmd>
 - /*TextDraws (Global)*/
 - new Text:Kill_Box;
 - new Text:Kill_IconBox;
 - new Text:Kill_Msg;
 - /*TextDraws (Per-Player)*/
 - new PlayerText:Kill_Name[MAX_PLAYERS];
 - new PlayerText:Kill_Icon[MAX_PLAYERS];
 - /*Strings*/
 - new name[MAX_PLAYER_NAME],globalstr[128];
 - /*Array(s)*/
 - new SelectedIcon[MAX_PLAYERS];
 - #if defined FILTERSCRIPT
 - public OnFilterScriptInit()
 - {
 - print("\n--------------------------------------");
 - print(" Death Message made by Jelly23");
 - print("--------------------------------------\n");
 - /*Creating the TextDraws*/
 - Kill_Box = TextDrawCreate(225.000000, 190.000000, "box");
 - TextDrawLetterSize(Kill_Box, 0.000000, 2.705498);
 - TextDrawTextSize(Kill_Box, 446.989501, 0.000000);
 - TextDrawAlignment(Kill_Box, 1);
 - TextDrawColor(Kill_Box, -1061109505);
 - TextDrawUseBox(Kill_Box, 1);
 - TextDrawBoxColor(Kill_Box, 120);
 - TextDrawSetShadow(Kill_Box, 0);
 - TextDrawSetOutline(Kill_Box, 0);
 - TextDrawBackgroundColor(Kill_Box, 255);
 - TextDrawFont(Kill_Box, 1);
 - TextDrawSetProportional(Kill_Box, 1);
 - TextDrawSetShadow(Kill_Box, 0);
 - Kill_IconBox = TextDrawCreate(225.000000, 190.000000, "box");
 - TextDrawLetterSize(Kill_IconBox, 0.000000, 2.644498);
 - TextDrawTextSize(Kill_IconBox, 250.654998, 0.000000);
 - TextDrawAlignment(Kill_IconBox, 1);
 - TextDrawColor(Kill_IconBox, -1);
 - TextDrawUseBox(Kill_IconBox, 1);
 - TextDrawBoxColor(Kill_IconBox, 100);
 - TextDrawSetShadow(Kill_IconBox, 0);
 - TextDrawSetOutline(Kill_IconBox, 0);
 - TextDrawBackgroundColor(Kill_IconBox, 255);
 - TextDrawFont(Kill_IconBox, 1);
 - TextDrawSetProportional(Kill_IconBox, 1);
 - TextDrawSetShadow(Kill_IconBox, 0);
 - Kill_Msg = TextDrawCreate(261.875000, 204.666702, "KILLED_YOU");
 - TextDrawLetterSize(Kill_Msg, 0.231249, 1.010833);
 - TextDrawAlignment(Kill_Msg, 1);
 - TextDrawColor(Kill_Msg, -2147483393);
 - TextDrawSetShadow(Kill_Msg, 0);
 - TextDrawSetOutline(Kill_Msg, 0);
 - TextDrawBackgroundColor(Kill_Msg, 255);
 - TextDrawFont(Kill_Msg, 1);
 - TextDrawSetProportional(Kill_Msg, 1);
 - TextDrawSetShadow(Kill_Msg, 0);
 - return 1;
 - }
 - public OnFilterScriptExit()
 - {
 - /*Destroys them, so we don't face problems in the future*/
 - TextDrawDestroy(Kill_Box);
 - TextDrawDestroy(Kill_IconBox);
 - TextDrawDestroy(Kill_Msg);
 - return 1;
 - }
 - #else
 - main()
 - {
 - print("\n----------------------------------");
 - print(" Death Message made by Jelly23");
 - print("----------------------------------\n");
 - }
 - #endif
 - /*Callbacks*/
 - public OnPlayerConnect(playerid)
 - {
 - SelectedIcon[playerid] = 0;
 - Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:pm3");
 - PlayerTextDrawLetterSize(playerid, Kill_Icon[playerid], 0.000000, 0.000000);
 - PlayerTextDrawTextSize(playerid, Kill_Icon[playerid], 20.000000, 15.916665);
 - PlayerTextDrawAlignment(playerid, Kill_Icon[playerid], 1);
 - PlayerTextDrawColor(playerid, Kill_Icon[playerid], -1);
 - PlayerTextDrawSetShadow(playerid, Kill_Icon[playerid], 0);
 - PlayerTextDrawSetOutline(playerid, Kill_Icon[playerid], 0);
 - PlayerTextDrawBackgroundColor(playerid, Kill_Icon[playerid], 255);
 - PlayerTextDrawFont(playerid, Kill_Icon[playerid], 4);
 - PlayerTextDrawSetProportional(playerid, Kill_Icon[playerid], 0);
 - PlayerTextDrawSetShadow(playerid, Kill_Icon[playerid], 0);
 - Kill_Name[playerid] = CreatePlayerTextDraw(playerid, 260.000000, 191.166702, "Name");
 - PlayerTextDrawLetterSize(playerid, Kill_Name[playerid], 0.278750, 1.203333);
 - PlayerTextDrawAlignment(playerid, Kill_Name[playerid], 1);
 - PlayerTextDrawColor(playerid, Kill_Name[playerid], -1);
 - PlayerTextDrawSetShadow(playerid, Kill_Name[playerid], 0);
 - PlayerTextDrawSetOutline(playerid, Kill_Name[playerid], 0);
 - PlayerTextDrawBackgroundColor(playerid, Kill_Name[playerid], 255);
 - PlayerTextDrawFont(playerid, Kill_Name[playerid], 1);
 - PlayerTextDrawSetProportional(playerid, Kill_Name[playerid], 1);
 - PlayerTextDrawSetShadow(playerid, Kill_Name[playerid], 0);
 - return 1;
 - }
 - public OnPlayerDeath(playerid, killerid, reason)
 - {
 - if(killerid != INVALID_PLAYER_ID)
 - {
 - TextDrawShowForPlayer(playerid,Kill_Box);
 - TextDrawShowForPlayer(playerid,Kill_IconBox);
 - TextDrawShowForPlayer(playerid,Kill_Msg);
 - GetPlayerName(killerid,name,sizeof(name));
 - format(globalstr,sizeof(globalstr),"%s(%i)",name,killerid);
 - PlayerTextDrawSetString(playerid, Kill_Name[playerid], globalstr);
 - PlayerTextDrawShow(playerid,Kill_Name[playerid]);
 - UpdateIconSprite(killerid,playerid);
 - PlayerTextDrawShow(playerid,Kill_Icon[playerid]);
 - }
 - return 1;
 - }
 - public OnPlayerSpawn(playerid)
 - {
 - TextDrawHideForPlayer(playerid,Kill_Box);
 - TextDrawHideForPlayer(playerid,Kill_IconBox);
 - TextDrawHideForPlayer(playerid,Kill_Msg);
 - PlayerTextDrawHide(playerid,Kill_Name[playerid]);
 - PlayerTextDrawHide(playerid,Kill_Icon[playerid]);
 - return 1;
 - }
 - /*Function(s)*/
 - UpdateIconSprite(killerid,playerid)
 - {
 - PlayerTextDrawDestroy(playerid,Kill_Icon[playerid]);
 - switch(SelectedIcon[killerid])
 - {
 - case 1: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:ps1");
 - case 2: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:ps2");
 - case 3: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:ps3");
 - case 4: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:pm2");
 - case 5: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:pa");
 - default: Kill_Icon[playerid] = CreatePlayerTextDraw(playerid, 227.375000, 193.916656, "ld_shtr:pm3");
 - }
 - PlayerTextDrawLetterSize(playerid, Kill_Icon[playerid], 0.000000, 0.000000);
 - PlayerTextDrawTextSize(playerid, Kill_Icon[playerid], 20.000000, 15.916665);
 - PlayerTextDrawAlignment(playerid, Kill_Icon[playerid], 1);
 - PlayerTextDrawColor(playerid, Kill_Icon[playerid], -1);
 - PlayerTextDrawSetShadow(playerid, Kill_Icon[playerid], 0);
 - PlayerTextDrawSetOutline(playerid, Kill_Icon[playerid], 0);
 - PlayerTextDrawBackgroundColor(playerid, Kill_Icon[playerid], 255);
 - PlayerTextDrawFont(playerid, Kill_Icon[playerid], 4);
 - PlayerTextDrawSetProportional(playerid, Kill_Icon[playerid], 0);
 - PlayerTextDrawSetShadow(playerid, Kill_Icon[playerid], 0);
 - }
 - /*Command(s)*/
 - CMD:seticon(playerid,params[])
 - {
 - if(isnull(params)) return SendClientMessage(playerid,-1,"/seticon [icon id]");
 - if(0 < strval(params) > 5) return SendClientMessage(playerid,-1,"Ids are between 0-5");
 - SelectedIcon[playerid] = strval(params);
 - format(globalstr,sizeof(globalstr),"You have set your icon to %i",strval(params));
 - SendClientMessage(playerid,-1,globalstr);
 - return 1;
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment