snow? -
PawnoQ - 23.12.2013
hello
i saw on a server snow falling down.
How can i make it?
I know it is a object i think but how can i do it?
What id is it and how to make it snow?
And when i make that object there will be snow in whole san andreas map or only in the location?
Please help, i will repp you for sure!
Re: snow? - Patrick - 23.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 Код:
#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
Код:
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]
PS: This was posted by me | Original Thread:
http://forum.sa-mp.com/showpost.php?...93&postcount=5
Re: snow? -
PawnoQ - 23.12.2013
thanks you!!
pawn Код:
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 );//but why Position[2]-5 ?? shouldnt it be +5?? as the snow should be created above the player?
SendClientMessage(playerid, -1, "[DEBUG] - SnowSettings - Enabled");
}
And where would i make it OFF again? under OnplayerDeath or disconnect?
Re: snow? - Patrick - 23.12.2013
Quote:
Originally Posted by PawnoQ
thanks you!!
pawn Код:
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 );//but why Position[2]-5 ?? shouldnt it be +5?? as the snow should be created above the player? SendClientMessage(playerid, -1, "[DEBUG] - SnowSettings - Enabled"); }
And where would i make it OFF again? under OnplayerDeath or disconnect?
|
Your choice, I'd suggest on
OnPlayerDisconnect
Re: snow? -
PawnoQ - 23.12.2013
thank you
Can u please answer my last question i made in the last code?
(you have to scorle to the side to see it i made a commented // text/question there
)