19.05.2012, 02:58
Hi there!!
So as the Title says i am having difficluty with a object streamer, now i made my own based off of xObject and Mido-Stream....Now your asking yourself why are you making a object streamer when there is a bunch of other great ones....Well to learn how to make one and how they work. lol
So my problem is i have 1988 objects currently testing it and after i reached about 1000-1400 objects it dosnt show all of the objects. I am using CreatePlayerObject and then destroying them when the player isnt in reach and the array is set to 2000 objects and i even tryed more but when the objects are added to the array they get counted.
I also added a virtual world param to it too and that works great. Also when i reload the script the objects show up again and they all so untill i go to the next map then it happens again.
Now the code to check for the players positon and the array is the same as xObjects streamer and xObject i have had over 3000 objects with that one with no problem. Then the idea i got from mido-stream is for creating the object mine is called MakeNObject.(Make-An-Object.......get it heheh, i know not funny )
Here are the codes for checking players position and then the MakeNObject code.
heres the MakeNObject one now
and the array/enum
Any one know what i did wrong?
So as the Title says i am having difficluty with a object streamer, now i made my own based off of xObject and Mido-Stream....Now your asking yourself why are you making a object streamer when there is a bunch of other great ones....Well to learn how to make one and how they work. lol
So my problem is i have 1988 objects currently testing it and after i reached about 1000-1400 objects it dosnt show all of the objects. I am using CreatePlayerObject and then destroying them when the player isnt in reach and the array is set to 2000 objects and i even tryed more but when the objects are added to the array they get counted.
I also added a virtual world param to it too and that works great. Also when i reload the script the objects show up again and they all so untill i go to the next map then it happens again.
Now the code to check for the players positon and the array is the same as xObjects streamer and xObject i have had over 3000 objects with that one with no problem. Then the idea i got from mido-stream is for creating the object mine is called MakeNObject.(Make-An-Object.......get it heheh, i know not funny )
Here are the codes for checking players position and then the MakeNObject code.
pawn Код:
forward NObjectUpdate(playerid);
public NObjectUpdate(playerid)
{
new Float:pos[3];
GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
for(new i = 0; i < ObjCount; i++)
{
if(GetPlayerVirtualWorld(playerid) == Objects[i][nworld])
{
if(!NPlayer[playerid][see][i])
{
if(IsNObjClose(pos[0],pos[1],pos[2],Objects[i][nx],Objects[i][ny],Objects[i][nz],Objects[i][ndraw]))
{
NPlayer[playerid][see][i] = true;
NPlayer[playerid][nobj][i] = CreatePlayerObject(playerid,Objects[i][nid],Objects[i][nx],Objects[i][ny],Objects[i][nz],Objects[i][nrx],Objects[i][nry],Objects[i][nrz]);
}
} else if(!IsNObjClose(pos[0],pos[1],pos[2],Objects[i][nx],Objects[i][ny],Objects[i][nz],Objects[i][ndraw]))
{
NPlayer[playerid][see][i] = false;
DestroyPlayerObject(playerid,NPlayer[playerid][nobj][i]);
}
}
else
{
NPlayer[playerid][see][i] = false;
DestroyPlayerObject(playerid,NPlayer[playerid][nobj][i]);
}
}
}
pawn Код:
forward MakeNObject(modelid,Float:X,Float:Y,Float:Z,Float:rX,Float:rY,Float:rZ,Float:DrawDistance,World);
public MakeNObject(modelid, Float:X,Float:Y,Float:Z,Float:rX,Float:rY,Float:rZ,Float:DrawDistance,World)
{
ObjCount++;
for (new i=0; i<ObjCount; i++)
{
if (Objects[i][nid] == 0)
{
Objects[i][nid] = modelid;
Objects[i][nx] = X;
Objects[i][ny] = Y;
Objects[i][nz] = Z;
Objects[i][nrx] = rX;
Objects[i][nry] = rY;
Objects[i][nrz] = rZ;
Objects[i][ndraw] = DrawDistance;
Objects[i][nworld] = World;
break;
}
}
return 1;
}
pawn Код:
enum object_enum
{
nid,
Float:nx,
Float:ny,
Float:nz,
Float:nrx,
Float:nry,
Float:nrz,
Float:ndraw,
nworld
}
new Objects[MAX_N_OBJECTS][object_enum];