PDA

View Full Version : Snow


Dripac
22/11/2011, 04:34 PM
Hello, can anyone give me a code for a realistic snow falling in samp?

nuriel8833
22/11/2011, 04:36 PM
http://forum.sa-mp.com/showthread.php?t=296904

Dripac
22/11/2011, 04:47 PM
Hmm can you help me so that it always has snow? (No commands to turn it on/off) I will give you 4+ rep

Kostas'
22/11/2011, 04:52 PM
I am not sure for this

// Credits to Kwarde for the FS
#include <a_samp>
#include <streamer>
#include <zcmd>

#undef MAX_PLAYERS
#define MAX_SLOTS 30

#define MAX_SNOW_OBJECTS 20
#define UPDATE_INTERVAL 750

#if MAX_SLOTS == -1
#error Change MAX_SLOTS to the max players of your server! (At line 6)
#endif

#define ploop(%0) for(new %0 = 0; %0 < MAX_SLOTS; %0++) if(IsPlayerConnected(%0))
#define CB:%0(%1) forward %0(%1); public %0(%1)

new snowObject[MAX_SLOTS][MAX_SNOW_OBJECTS],
updateTimer[MAX_SLOTS char]
;

public OnFilterScriptExit()
{
ploop(i)
{
for(new j = 0; j < MAX_SNOW_OBJECTS; j++) DestroyDynamicObject(snowObject[i][j]);
KillTimer(updateTimer{i});
}
return 1;
}

public OnPlayerDisconnect(playerid)
{

for(new i = 0; i < MAX_SNOW_OBJECTS; i++) DestroyDynamicObject(snowObject[playerid][i]);
KillTimer(updateTimer{playerid});
return 1;
}

CB:UpdateSnow(playerid)
{
new Float:pPos[3];
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
for(new i = 0; i < MAX_SNOW_OBJECTS; i++) SetDynamicObjectPos(snowObject[playerid][i], pPos[0] + random(25), pPos[1] + random(25), pPos[2] - 5);
return 1;
}

Dripac
22/11/2011, 04:55 PM
hmm thx i will try

Kostas'
22/11/2011, 04:56 PM
Your Welcome!
I hope it works.

nuriel8833
22/11/2011, 04:56 PM
Hmm can you help me so that it always has snow? (No commands to turn it on/off) I will give you 4+ rep

Just keep the snow on for all times,or remove the /on and /off commands.
If you still didnt understand send me a PM :)


[This forum requires that you wait 120 seconds between posts. Please try again in 34 seconds.]
Gosh -.-

Dripac
22/11/2011, 04:57 PM
Just keep the snow on for all times,or remove the /on and /off commands.
If you still didnt understand send me a PM :)


[This forum requires that you wait 120 seconds between posts. Please try again in 34 seconds.]
Gosh -.-

I understand now, thx:)