16.12.2010, 02:40
Код:
18863 SnowArc1 18864 FakeSnow1
18863 SnowArc1 18864 FakeSnow1
CMD:snow(playerid, params[])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
return CreateObject(18863, X, Y, Z, 0.0, 0.0, 0.0);
}
SetTimer("Snow",1000,true);
stock Snow(playerid)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
return CreateObject(18863, X, Y, Z, 0.0, 0.0, 0.0);
}
would this work though?
pawn Код:
|
#include <a_samp>
new bool:SnowCreated[MAX_PLAYERS] = false;
new CreatedSnow[MAX_PLAYERS] = (-1);
new SnowTimer[MAX_PLAYERS] = (-1);
forward UpdateSnow(playerid);
public OnPlayerConnect(playerid)
{
SnowCreated[playerid] = false;
SnowTimer[playerid] = SetTimerEx("UpdateSnow", 1000, true, "i", playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
SnowCreated[playerid] = false;
DestroyObject(CreatedSnow[playerid]);
KillTimer(SnowTimer[playerid]);
CreatedSnow[playerid] = (-1);
SnowTimer[playerid] = (-1);
return 1;
}
public UpdateSnow(playerid)
{
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
if(!SnowCreated[playerid])
CreatedSnow[playerid] = CreateObject(18863, pX, pY, pZ, 0.0, 0.0, 0.0);
else
SetObjectPos(CreatedSnow[playerid], pX, pY, pZ, 0.0, 0.0, 0.0);
return 1;
}
AttachPlayerObjectToPlayer()