#1

Код:
18863	SnowArc1
18864	FakeSnow1
Does any one of these make whole SA Snow or its just a snow object?
Reply
#2

pawn Код:
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);
}
Its just like a small area. I get huge lags with that object tho, don't know if Matite fixed them.
Reply
#3

would this work though?

pawn Код:
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);
}
Reply
#4

Quote:
Originally Posted by Kitten
Посмотреть сообщение
would this work though?

pawn Код:
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);
}
Actually, it's not really good.
You now call an function "Snow()". But it is "Snow(playerid)". And with timers, you need an callback (I think. Stock didn't work for me).
So you need, an callback, SetTimerEx, and a forward. And btw. With this, it means it makes every second a new object! This will give:
* after 400 seconds with one player, you've reached the 400 objects limit.
-- And with 2 players you'll reach it in +- 200 seconds etc..
* Lagg. Such much snow, that will be probally a lagg. Because, every second there will be more!

And you can also check if the show already exists. If it not exists yet, create it. Otherwise, set the position. I'll give an example of the whole script:

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;
}
You can also use MoveObject instead of SetObjectPos.
Reply
#5

Quote:
Originally Posted by Kitten
Посмотреть сообщение
would this work though?

pawn Код:
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);
}
You need callbacks for timers.
Reply
#6

Quote:
Originally Posted by Kitten
Посмотреть сообщение
would this work though?

pawn Код:
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);
}
Great! now after a while your object limit (400 max.) will be reached, then you also don't see it anymore because it cannot be created anymore, and you'll have a massive amount of lag!
Reply
#7

Quote:
Originally Posted by DVDK
Посмотреть сообщение
Great! now after a while your object limit (400 max.) will be reached, then you also don't see it anymore because it cannot be created anymore, and you'll have a massive amount of lag!
You can always use a streamer..
Reply
#8

pawn Код:
AttachPlayerObjectToPlayer()
This function removed since 0.3a..
Reply
#9

Quote:
Originally Posted by kurta999
Посмотреть сообщение
pawn Код:
AttachPlayerObjectToPlayer()
This function removed since 0.3a..
Uuhm no?
Reply
#10

Quote:
Originally Posted by DVDK
Посмотреть сообщение
Uuhm no?
it was removed. try it u'll get a error in your server.exe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)