Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define sHeightStart 50
- #define sModel 354
- forward SnowTimer();
- forward SnowOn();
- forward SnowOff();
- forward ToggleBlizzard(onoff);
- forward SetSnowColor(color);
- forward SetSnowStartHeight(height);
- new Spawned[MAX_PLAYERS];
- new SnowTrack;
- new Blizzard;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" [FS] Falling Snow by Pixels^");
- print("--------------------------------------\n");
- SnowTrack = SetTimer("SnowTimer",4000,1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(SnowTrack);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- for(new o=0; o<60; o++) CreatePlayerObject(playerid,sModel,0,0,0,0,0,0);
- Spawned[playerid] = 0;
- ToggleBlizzard(1);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- Spawned[playerid] = 1;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- Spawned[playerid] = 0;
- return 1;
- }
- public SnowTimer()
- {
- SetWorldTime(1);
- for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i) && Spawned[i] == 1)
- {
- new Float:Pos[3],Float:pObjectPos[3];
- GetPlayerPos(i,Pos[0],Pos[1],Pos[2]);
- for(new b=0; b<60; b++)
- {
- if(Blizzard == 0)
- {
- if(b<=20)
- SetPlayerObjectPos(i,b,Pos[0]-random(100),Pos[1]+random(70),Pos[2]+sHeightStart+random(10));
- if(b>=21 && b<= 30)
- SetPlayerObjectPos(i,b,Pos[0]+random(100),Pos[1]+random(70),Pos[2]+sHeightStart+random(10));
- if(b>=31 && b<= 40)
- SetPlayerObjectPos(i,b,Pos[0]+random(70),Pos[1]-random(100),Pos[2]+sHeightStart+random(10));
- if(b>=41 && b<= 60)
- SetPlayerObjectPos(i,b,Pos[0]+random(70),Pos[1]+random(100),Pos[2]+sHeightStart+random(10));
- GetPlayerObjectPos(i,b,pObjectPos[0],pObjectPos[1],pObjectPos[2]);
- MovePlayerObject(i,b,pObjectPos[0],pObjectPos[1],Pos[2]-7,16);
- }
- else
- {
- if(b<=20)
- SetPlayerObjectPos(i,b,Pos[0]-random(100),Pos[1]+random(70),Pos[2]+sHeightStart+random(10));
- if(b>=21 && b<= 30)
- SetPlayerObjectPos(i,b,Pos[0]+random(100),Pos[1]+random(70),Pos[2]+sHeightStart+random(10));
- if(b>=31 && b<= 40)
- SetPlayerObjectPos(i,b,Pos[0]+random(70),Pos[1]-random(100),Pos[2]+sHeightStart+random(10));
- if(b>=41 && b<= 60)
- SetPlayerObjectPos(i,b,Pos[0]+random(70),Pos[1]+random(100),Pos[2]+sHeightStart+random(10));
- GetPlayerObjectPos(i,b,pObjectPos[0],pObjectPos[1],pObjectPos[2]);
- MovePlayerObject(i,b,pObjectPos[0],pObjectPos[1],Pos[2]-7,56);
- }
- }
- }
- return 1;
- }
- public SnowOff()
- KillTimer(SnowTrack);
- public SnowOn()
- SnowTrack = SetTimer("SnowTimer",4000,1);
- public ToggleBlizzard(onoff)
- {
- KillTimer(SnowTrack);
- if(onoff == 0) SnowTrack = SetTimer("SnowTimer",4000,1);
- else SnowTrack = SetTimer("SnowTimer",1300,1);
- Blizzard = onoff;
- }
- public SetSnowStartHeight(height)
- {
- #undef sHeightStart
- #define sHeightStart height
- }
- public SetSnowColor(color)
- {
- new model,b;
- switch(color)
- {
- case 1: model = 1213;
- case 2: model = 354;
- }
- if(sModel == model) return -1;
- #undef sModel
- #define sModel model
- for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i))
- {
- for(b=0; b<60; b++)
- {
- DestroyPlayerObject(i,b);
- CreatePlayerObject(i,sModel,0,0,0,0,0,0);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement