Advertisement
Guest User

Opa

a guest
Mar 18th, 2010
1,011
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. #include <a_samp>
  2. /*------------------------------*/
  3. #define MAX_SNOW 86 // ANDERE TEXTRAWS + MAX_SNOW = 92
  4. #define SPEED 100 // WENIGER = SCHNELLER
  5. /*------------------------------*/
  6. forward onSnow();
  7. new Text:s[MAX_SNOW],Float:p[MAX_SNOW][2],Float:g[MAX_SNOW][2];
  8. Float:berx()
  9. {
  10. new Float:ret=random(400)+150;
  11. ret=floatdiv(ret,1000);
  12. return ret;
  13. }
  14. Float:bery()
  15. {
  16. new Float:ret=random(1600)+700;
  17. ret=floatdiv(ret,1000);
  18. return ret;
  19. }
  20. public OnFilterScriptInit()
  21. {
  22. print("\nSNOW TEST");
  23. for(new i;i<MAX_SNOW;i++)
  24. {
  25. new Float:x=random(627),y=random(425);
  26. new Float:lsx=berx();
  27. new Float:lsy=bery();
  28. s[i]=TextDrawCreate(x,y,".");
  29. TextDrawBackgroundColor(s[i],0x00000000);
  30. TextDrawFont(s[i],3);
  31. TextDrawLetterSize(s[i],lsx,lsy);
  32. TextDrawColor(s[i],0xffffffff);
  33. p[i][0]=x;
  34. p[i][1]=y;
  35. g[i][0]=lsx;
  36. g[i][1]=lsy;
  37. TextDrawShowForAll(s[i]);
  38. }
  39. SetTimer("onSnow",SPEED,1);
  40. return 1;
  41. }
  42. public onSnow()
  43. {
  44. for(new i;i<MAX_SNOW;i++)
  45. {
  46. p[i][1]++;
  47. TextDrawDestroy(s[i]);
  48. if(p[i][1]>=426)
  49. {
  50. p[i][0]=random(627);
  51. p[i][1]=0.0;
  52. g[i][0]=berx();
  53. g[i][1]=bery();
  54. }
  55. s[i]=TextDrawCreate(p[i][0],p[i][1],".");
  56. TextDrawBackgroundColor(s[i],0x00000000);
  57. TextDrawFont(s[i],3);
  58. TextDrawLetterSize(s[i],g[i][0],g[i][1]);
  59. TextDrawColor(s[i],0xffffffff);
  60. TextDrawShowForAll(s[i]);
  61. }
  62. }
  63. public OnFilterScriptExit()
  64. {
  65. for(new i;i<MAX_SNOW;i++)TextDrawDestroy(s[i]);
  66. return 1;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement