Guest User

Movable3dText

a guest
Apr 2nd, 2011
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. /*
  2. Movable 3d Text Labels
  3.  
  4. Created
  5. by _TeraN_
  6.  
  7. Updated and edited for Incognito's Streamer plugin
  8. by Nexotronix
  9. */
  10.  
  11. #include <streamer>
  12.  
  13. new Text3D:textue[250], txtid, tcolor[sizeof(textue)], stringetc1[256][sizeof(textue)], texton3dtext[256][sizeof(textue)];
  14.  
  15. stock CreateMoveable3DText(string[], color, Float:x, Float:y, Float:z, Float:distance, speed)
  16. {
  17. if(txtid < sizeof(textue))
  18. {
  19. if(speed < 1) return printf("Maximum Moveable 3DText's - %d", sizeof(textue));
  20. txtid++;
  21. tcolor[txtid] = color;
  22. format(texton3dtext[txtid], sizeof(texton3dtext), string);
  23. textue[txtid] = CreateDyanmic3DTextLabel(texton3dtext[txtid], tcolor[txtid], x,y,z, distance);
  24. SetTimerEx("Move3DText", speed*100, true, "i",txtid);
  25. }
  26. return true;
  27. }
  28.  
  29. stock AttachMoveable3DTextToVehicle(vehid, string[], color, Float:x, Float:y, Float:z, Float:distance, speed)
  30. {
  31. if(txtid < sizeof(textue))
  32. {
  33. if(speed < 1) return printf("Maximum Moveable 3DText's - %d", sizeof(textue));
  34. txtid++;
  35. tcolor[txtid] = color;
  36. format(texton3dtext[txtid], sizeof(texton3dtext), string);
  37. textue[txtid] = CreateDynamic3DTextLabel(texton3dtext[txtid], tcolor[txtid], x,y,z, distance, -1, vehid);
  38. SetTimerEx("Move3DText", speed*100, true, "i",txtid);
  39. }
  40. return true;
  41. }
  42.  
  43. stock AttachMoveable3DTextToPlayer(playerid, string[], color, Float:x, Float:y, Float:z, Float:distance, speed)
  44. {
  45. if(txtid < sizeof(textue))
  46. {
  47. if(speed < 1) return printf("Maximum Moveable 3DText's - %d", sizeof(textue));
  48. txtid++;
  49. tcolor[txtid] = color;
  50. format(texton3dtext[txtid], sizeof(texton3dtext), string);
  51. textue[txtid] = CreateDynamic3DTextLabel(texton3dtext[txtid], tcolor[txtid], x,y,z, distance, playerid);
  52. SetTimerEx("Move3DText", speed*100, true, "i",txtid);
  53. }
  54. return true;
  55. }
  56.  
  57. forward Move3DText(txtid2);
  58. public Move3DText(txtid2)
  59. {
  60. format(stringetc1[txtid2], 2, "%c", texton3dtext[txtid2]);
  61. strdel(texton3dtext[txtid2], 0, 1);
  62. strcat(texton3dtext[txtid2], stringetc1[txtid2]);
  63. Update3DTextLabelText(textue[txtid2], tcolor[txtid2], texton3dtext[txtid2]);
  64. }
Advertisement
Add Comment
Please, Sign In to add comment