Guest User

xD

a guest
Aug 5th, 2010
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.03 KB | None | 0 0
  1. //5 new game-text styles by [XST]O_x
  2. //First include!
  3.  
  4. #include <a_samp>
  5.  
  6. forward TextDrawDestroyTimer1(TextDrawID);
  7. forward TextDrawDestroyTimer2(TextDrawID);
  8. forward TextDrawDestroyTimer3(TextDrawID);
  9. forward TextDrawDestroyTimer4(TextDrawID);
  10. forward TextDrawDestroyTimer5(TextDrawID);
  11.  
  12. new Text:gTextStyle1[128];
  13. new Text:gTextStyle2[128];
  14. new Text:gTextStyle3[128];
  15. new Text:gTextStyle4[128];
  16. new Text:gTextStyle5[128];
  17. new textcount;
  18. new textcountP;
  19.  
  20. /*
  21. native GameTextCostumeForPlayer(playerid,msg[],seconds,style);
  22. native GameTextCostumeForAll(msg[],seconds,style);
  23. native GameTextCostumeForRange(Float:x,Float:y,Float:z,range,msg[],seconds,style);
  24. */
  25.  
  26. stock GameTextCostumeForPlayer(playerid,msg[],seconds,style)
  27. {
  28.     textcountP++;
  29.     if(textcountP >= 128) textcountP = 0; //By Seif_
  30.     gTextStyle1[textcountP] = TextDrawCreate(14.000000, 308.000000, msg);
  31.     TextDrawBackgroundColor(gTextStyle1[textcountP], 255);
  32.     TextDrawFont(gTextStyle1[textcountP], 2);
  33.     TextDrawLetterSize(gTextStyle1[textcountP], 1.060000, 3.199999);
  34.     TextDrawColor(gTextStyle1[textcountP], -1);
  35.     TextDrawSetOutline(gTextStyle1[textcountP], 1);
  36.     TextDrawSetProportional(gTextStyle1[textcountP], 1);
  37.    
  38.     gTextStyle2[textcountP] = TextDrawCreate(521.000000, 101.000000, msg);
  39.     TextDrawBackgroundColor(gTextStyle2[textcountP], 255);
  40.     TextDrawFont(gTextStyle2[textcountP], 1);
  41.     TextDrawLetterSize(gTextStyle2[textcountP], 0.480000, 1.000000);
  42.     TextDrawColor(gTextStyle2[textcountP], -1);
  43.     TextDrawSetOutline(gTextStyle2[textcountP], 1);
  44.     TextDrawSetProportional(gTextStyle2[textcountP], 1);
  45.    
  46.     gTextStyle3[textcountP] = TextDrawCreate(291.000000, 431.000000, msg);
  47.     TextDrawBackgroundColor(gTextStyle3[textcountP], 255);
  48.     TextDrawFont(gTextStyle3[textcountP], 3);
  49.     TextDrawLetterSize(gTextStyle3[textcountP], 0.500000, 1.000000);
  50.     TextDrawColor(gTextStyle3[textcountP], -1);
  51.     TextDrawSetOutline(gTextStyle3[textcountP], 1);
  52.     TextDrawSetProportional(gTextStyle3[textcountP], 1);
  53.    
  54.     gTextStyle4[textcountP] = TextDrawCreate(506.000000, 341.000000, msg);
  55.     TextDrawBackgroundColor(gTextStyle4[textcountP], 255);
  56.     TextDrawFont(gTextStyle4[textcountP], 0);
  57.     TextDrawLetterSize(gTextStyle4[textcountP], 1.130000, 3.899999);
  58.     TextDrawColor(gTextStyle4[textcountP], -1);
  59.     TextDrawSetOutline(gTextStyle4[textcountP], 1);
  60.     TextDrawSetProportional(gTextStyle4[textcountP], 1);
  61.    
  62.     gTextStyle5[textcountP] = TextDrawCreate(271.000000, 172.000000, msg);
  63.     TextDrawBackgroundColor(gTextStyle5[textcountP], 255);
  64.     TextDrawFont(gTextStyle5[textcountP], 2);
  65.     TextDrawLetterSize(gTextStyle5[textcountP], 0.679999, 2.199999);
  66.     TextDrawColor(gTextStyle5[textcountP], -1);
  67.     TextDrawSetOutline(gTextStyle5[textcountP], 1);
  68.     TextDrawSetProportional(gTextStyle5[textcountP], 1);
  69.    
  70.     if(style == 1)
  71.     {
  72.         TextDrawShowForPlayer(playerid,gTextStyle1[textcountP]);
  73.         SetTimerEx("TextDrawDestroyTimer1",seconds*1000,0,"d",textcountP);
  74.     }
  75.     else if(style == 2)
  76.     {
  77.         TextDrawShowForPlayer(playerid,gTextStyle2[textcountP]);
  78.         SetTimerEx("TextDrawDestroyTimer2",seconds*1000,0,"d",textcountP);
  79.     }
  80.     else if(style == 3)
  81.     {
  82.         TextDrawShowForPlayer(playerid,gTextStyle3[textcountP]);
  83.         SetTimerEx("TextDrawDestroyTimer3",seconds*1000,0,"d",textcountP);
  84.     }
  85.     else if(style == 4)
  86.     {
  87.         TextDrawShowForPlayer(playerid,gTextStyle4[textcountP]);
  88.         SetTimerEx("TextDrawDestroyTimer4",seconds*1000,0,"d",textcountP);
  89.     }`
  90.     else if(style == 5)
  91.     {
  92.         TextDrawShowForPlayer(playerid,gTextStyle5[textcountP]);
  93.         SetTimerEx("TextDrawDestroyTimer5",seconds*1000,0,"d",textcountP);
  94.     }
  95. }
  96. stock GameTextCostumeForAll(msg[],seconds,style)
  97. {
  98.     textcount++;
  99.     if(textcount >= 128) textcount = 0; //By Seif_
  100.     gTextStyle1[textcount] = TextDrawCreate(14.000000, 308.000000, msg);
  101.     TextDrawBackgroundColor(gTextStyle1[textcount], 255);
  102.     TextDrawFont(gTextStyle1[textcount], 2);
  103.     TextDrawLetterSize(gTextStyle1[textcount], 1.060000, 3.199999);
  104.     TextDrawColor(gTextStyle1[textcount], -1);
  105.     TextDrawSetOutline(gTextStyle1[textcount], 1);
  106.     TextDrawSetProportional(gTextStyle1[textcount], 1);
  107.  
  108.     gTextStyle2[textcount] = TextDrawCreate(521.000000, 101.000000, msg);
  109.     TextDrawBackgroundColor(gTextStyle2[textcount], 255);
  110.     TextDrawFont(gTextStyle2[textcount], 1);
  111.     TextDrawLetterSize(gTextStyle2[textcount], 0.480000, 1.000000);
  112.     TextDrawColor(gTextStyle2[textcount], -1);
  113.     TextDrawSetOutline(gTextStyle2[textcount], 1);
  114.     TextDrawSetProportional(gTextStyle2[textcount], 1);
  115.  
  116.     gTextStyle3[textcount] = TextDrawCreate(291.000000, 431.000000, msg);
  117.     TextDrawBackgroundColor(gTextStyle3[textcount], 255);
  118.     TextDrawFont(gTextStyle3[textcount], 3);
  119.     TextDrawLetterSize(gTextStyle3[textcount], 0.500000, 1.000000);
  120.     TextDrawColor(gTextStyle3[textcount], -1);
  121.     TextDrawSetOutline(gTextStyle3[textcount], 1);
  122.     TextDrawSetProportional(gTextStyle3[textcount], 1);
  123.  
  124.     gTextStyle4[textcount] = TextDrawCreate(506.000000, 341.000000, msg);
  125.     TextDrawBackgroundColor(gTextStyle4[textcount], 255);
  126.     TextDrawFont(gTextStyle4[textcount], 0);
  127.     TextDrawLetterSize(gTextStyle4[textcount], 1.130000, 3.899999);
  128.     TextDrawColor(gTextStyle4[textcount], -1);
  129.     TextDrawSetOutline(gTextStyle4[textcount], 1);
  130.     TextDrawSetProportional(gTextStyle4[textcount], 1);
  131.  
  132.     gTextStyle5[textcount] = TextDrawCreate(271.000000, 172.000000, msg);
  133.     TextDrawBackgroundColor(gTextStyle5[textcount], 255);
  134.     TextDrawFont(gTextStyle5[textcount], 2);
  135.     TextDrawLetterSize(gTextStyle5[textcount], 0.679999, 2.199999);
  136.     TextDrawColor(gTextStyle5[textcount], -1);
  137.     TextDrawSetOutline(gTextStyle5[textcount], 1);
  138.     TextDrawSetProportional(gTextStyle5[textcount], 1);
  139.     if(style == 1)
  140.     {
  141.         TextDrawShowForAll(gTextStyle1[textcount]);
  142.         SetTimerEx("TextDrawDestroyTimer1",seconds*1000,0,"d",textcount);
  143.     }
  144.     else if(style == 2)
  145.     {
  146.         TextDrawShowForAll(gTextStyle2[textcount]);
  147.         SetTimerEx("TextDrawDestroyTimer2",seconds*1000,0,"d",textcount);
  148.     }
  149.     else if(style == 3)
  150.     {
  151.         TextDrawShowForAll(gTextStyle3[textcount]);
  152.         SetTimerEx("TextDrawDestroyTimer3",seconds*1000,0,"d",textcount);
  153.     }
  154.     else if(style == 4)
  155.     {
  156.         TextDrawShowForAll(gTextStyle4[textcount]);
  157.         SetTimerEx("TextDrawDestroyTimer4",seconds*1000,0,"d",textcount);
  158.     }
  159.     else if(style == 5)
  160.     {
  161.         TextDrawShowForAll(gTextStyle5[textcount]);
  162.         SetTimerEx("TextDrawDestroyTimer5",seconds*1000,0,"d",textcount);
  163.     }
  164. }
  165.  
  166. stock GameTextCostumeForRange(Float:x,Float:y,Float:z,range,msg[],seconds,style)
  167. {
  168.     for(new I; I < MAX_PLAYERS; I++)
  169.     {
  170.         if(!IsPlayerConnected(I)) continue;
  171.         if(IsPlayerInRangeOfPoint(I,x,y,z,range) {
  172.             GameTextCostumeForPlayer(I,msg,seconds,style);
  173.         }
  174.     }
  175. }
  176. public TextDrawDestroyTimer1(TextDrawID)
  177. {
  178.     TextDrawDestroy(gTextStyle1[TextDrawID]);
  179.     return 1;
  180. }
  181. public TextDrawDestroyTimer2(TextDrawID)
  182. {
  183.     TextDrawDestroy(gTextStyle2[TextDrawID]);
  184.     return 1;
  185. }
  186. public TextDrawDestroyTimer3(TextDrawID)
  187. {
  188.     TextDrawDestroy(gTextStyle3[TextDrawID]);
  189.     return 1;
  190. }
  191. public TextDrawDestroyTimer4(TextDrawID)
  192. {
  193.     TextDrawDestroy(gTextStyle4[TextDrawID]);
  194.     return 1;
  195. }
  196. public TextDrawDestroyTimer5(TextDrawID)
  197. {
  198.     TextDrawDestroy(gTextStyle5[TextDrawID]);
  199.     return 1;
  200. }
  201.  
  202. ///END///
Advertisement
Add Comment
Please, Sign In to add comment