SHARE
TWEET

!WasteD!

Mi5kas Oct 10th, 2014 1,132 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2.  
  3. //TEXT AND COLOR SETTING:
  4. #define TEXT "~r~WASTED" //Insert your text to be displayed, when player dies and color code before text: ~r~, ~g~, ~b~, ~y~, ~p~(red, green, blue, yellow, purple. ~ are neccesary)
  5.  
  6. new     Text:FadeText;
  7.  
  8.        
  9. forward LetsFade(playerid, proc);
  10.  
  11. public OnFilterScriptInit()
  12. {
  13.         FadeText=TextDrawCreate(0.0,0.0,"~r~");
  14.         TextDrawTextSize(FadeText,640,480);
  15.         TextDrawLetterSize(FadeText,0.0,50.0);
  16.         TextDrawUseBox(FadeText,1);
  17.         return 1;
  18. }
  19. public OnPlayerDeath(playerid, killerid, reason)
  20. {
  21.    SetTimerEx("LetsFade", 100, false, "ii", playerid, 99);
  22.    return 1;
  23. }
  24. public LetsFade(playerid, proc)
  25. {
  26.    if(proc <= 10)
  27.    {
  28.           GameTextForPlayer(playerid, TEXT, 2000, 0);
  29.    }
  30.    else
  31.    {
  32.       new str[16];
  33.       format(str, 16, "0xFF0000%i", proc);
  34.       TextDrawBoxColor(FadeText, HexToInt(str));
  35.       TextDrawShowForPlayer(playerid, FadeText);
  36.       SetTimerEx("LetsFade", 100, false, "ii", playerid, proc-10);
  37.    }
  38. }
  39. public OnPlayerSpawn(playerid)
  40. {
  41.    TextDrawHideForPlayer(playerid, FadeText);
  42.    return 1;
  43. }
  44.    
  45. stock HexToInt(string[])
  46. {
  47.    if (string[0]==0) return 0;
  48.    new i;
  49.    new cur=1;
  50.    new res=0;
  51.    for (i=strlen(string);i>0;i--) {
  52.    if (string[i-1]<58) res=res+cur*(string[i-1]-48); else res=res+cur*(string[i-1]-65+10);
  53.    cur=cur*16;
  54.    }
  55.    return res;
  56.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top