[Tutorial] Falling Snow! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [Tutorial] Falling Snow! (
/showthread.php?tid=481235)
Falling Snow! -
TwisTa98 - 14.12.2013
Hello Guys!!
You can use this snow script in your gamemode for free!
Just put this script in "OnPlayerConnect" callback and it will work fine!
Code:
for(new x = 0; x < 61; x++)
for(new y = 0; y < 61; y++)
CreateDynamicObject(18864,-3000.0+x*100.0,-3000+y*100,0.0,0.0,0.0,0.0);
Thank you and happy new year!
Re: Falling Snow! -
HeLiOn_PrImE - 14.12.2013
You forgot to mention that you need incognito's streamer plugin for this to work.
Also, you are creating falling snow for every player based on his own coordinates.
What happens when 30 players are in the same area? Did you think of that?
Re: Falling Snow! -
fredelfredel - 14.12.2013
pic ?
Re: Falling Snow! -
BizzyD - 14.12.2013
Really bad idea to do that.
Re: Falling Snow! - Patrick - 14.12.2013
To be
honest this is a bad idea and your
FPS(Frames per second) will
decrease. There's another way you could create a
falling snow by using the
sa-mp function called
GetPlayerCameraPos + you don't need to use
loop
GetPlayerCameraPos
Quote:
Originally Posted by SA-MP Wikipedia
Players' camera positions are only updated once a second, unless aiming.
It is recommended to set a 1 second timer if you wish to take action that relies on a player's camera position.
|
Example Code
pawn Code:
#include <a_samp>
public OnPlayerSpawn(playerid)
{
return SnowSettings(playerid, true);
}
SnowSettings(playerid, bool:on = true)
{
new
FallingSnowObject
;
if(on)
{
new Float:Position[3];
GetPlayerCameraPos( playerid, Position[0], Position[1], Position[2] /*-----------------------------------------------*/);
FallingSnowObject = CreatePlayerObject( playerid, 18864, Position[0], Position[1], Position[2]-5, 0.0, 0.0, 0.0, 300.0 );
SendClientMessage(playerid, -1, "[DEBUG] - SnowSettings - Enabled");
}
else if(!on)
{
DestroyPlayerObject( playerid, FallingSnowObject);
SendClientMessage(playerid, -1, "[DEBUG] - SnowSettings - disabled");
}
return true;
}
Compilation compiled with -d3
Code:
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Header size: 256 bytes
Code size: 664 bytes
Data size: 0 bytes
Stack/heap size: 16384 bytes; estimated max. usage=29 cells (116 bytes)
Total requirements: 17304 bytes
[Finished in 0.1s]
Re: Falling Snow! -
Stgnature - 14.12.2013
can u add PIC?
Re: Falling Snow! - Patrick - 14.12.2013
Quote:
Originally Posted by Stgnature
can u add PIC?
|
Here You go, I used the code I made
(Above Your Post)
Re: Falling Snow! -
xF4Life - 14.12.2013
Quote:
Originally Posted by pds2k12
To be honest this is a bad idea and your FPS(Frames per second) will decrease. There's another way you could create a falling snow by using the sa-mp function called GetPlayerCameraPos + you don't need to use loop
GetPlayerCameraPos
Example Code
pawn Code:
#include <a_samp>
public OnPlayerSpawn(playerid) { return SnowSettings(playerid, true); }
SnowSettings(playerid, bool:on = true) { new FallingSnowObject ; if(on) { new Float:Position[3]; GetPlayerCameraPos( playerid, Position[0], Position[1], Position[2] /*-----------------------------------------------*/); FallingSnowObject = CreatePlayerObject( playerid, 18864, Position[0], Position[1], Position[2]-5, 0.0, 0.0, 0.0, 300.0 ); SendClientMessage(playerid, -1, "[DEBUG] - SnowSettings - Enabled"); } else if(!on) { DestroyPlayerObject( playerid, FallingSnowObject); SendClientMessage(playerid, -1, "[DEBUG] - SnowSettings - disabled"); } return true; }
Compilation compiled with -d3
Code:
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Header size: 256 bytes
Code size: 664 bytes
Data size: 0 bytes
Stack/heap size: 16384 bytes; estimated max. usage=29 cells (116 bytes)
Total requirements: 17304 bytes
[Finished in 0.1s]
|
this one is fine, the topic's one could cause lag, bad idea.
nice job anyways..
Re: Falling Snow! -
HeLiOn_PrImE - 15.12.2013
The object's position should also depend on the player's camera position. Because it's basically composed of multiple layers of falling snow. You can look from a certain side and see the space between those layers.
Also, to prevent the FPS drop, the snow should be created for each specific player. Meaning the players should not see the falling snow created for other players.
Re: Falling Snow! -
MBilal - 19.12.2013
Nice One Dude Pds2k12 its Nice without Lagg Can you tell how i can Make Snow On Ground !!!