Quote:
Originally Posted by MadeMan
Try this
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] && IsNObjClose(pos[0],pos[1],pos[2],Objects[i][nx],Objects[i][ny],Objects[i][nz],Objects[i][ndraw])) { if(!NPlayer[playerid][see][i]) { 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]); NPlayer[playerid][see][i] = true; } } else { if(NPlayer[playerid][see][i]) { DestroyPlayerObject(playerid,NPlayer[playerid][nobj][i]); NPlayer[playerid][see][i] = false; } } } }
Also, the general limit of SA-MP is max 1000 objects shown at once
https://sampwiki.blast.hk/wiki/Limits
And show how you create 'NPlayer'
|
I will have to give that a try when i get back later.
Heres my NPlayer array/enum
pawn Код:
enum player_data
{
nobj[MAX_N_OBJECTS],
bool:see[MAX_N_OBJECTS]
}
new NPlayer[MAX_PLAYERS][player_data];
I know about the limits, but i have no problem with limits in the areas of the objects are as it creates the closest objects and destroys them as they go away. only thing i could think of is that the objects are not getting destroyed and then hits the object limit and causes the player not to see anymore playerobjects.