Ioannis20x

Schnee

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