SA-MP Forums Archive
Object Distance - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Object Distance (/showthread.php?tid=468182)



Object Distance - maxy153 - 06.10.2013

Hello, people. Today I made a building with 1100 objects. I use Incognito Streamer and I put maximum visibility of objects to 5000. When I'm near the building everything is visible but away no longer visible.
Here's the code of one of the objects:
Code:
CreateDynamicObject(6959,2218.8000500,1003.2000100,9.9000000,0.0000000,0.0000000,0.0000000, -1, -1, -1, 5000);
Near the building:
Attachment 6522

Slightly far from the building:
Attachment 6523
Please, help!


AW: Object Distance - Arrows73 - 07.10.2013

There's a maximum of 1000 objects, so you wont be able to see all of them at the same time


Re: Object Distance - Aliassassin123456 - 07.10.2013

1. Replace All CreateObject/CreateDynamicObject to CreateDynamicObjectEx
2. Change CreateDynamicObjectEx parameters in the include (streamer.inc)
pawn Code:
(
native CreateDynamicObjectEx(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 0.0, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
to ->
native CreateDynamicObjectEx(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 700.0, Float:streamdistance = 700.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
)
3. Now use this function in your OnGameModeInit Callback ( put Streamer_VisibleItems(STREAMER_TYPE_OBJECT, 1000); on your OnGameModeInit )
4. Now Your Problem Fixed!!!


Re: Object Distance - RajatPawar - 07.10.2013

I'd suggest you to use one of my includes, made using model sizes, which streams objects realistically.
Check out the thread!
https://sampforum.blast.hk/showthread.php?tid=428089

It streams objects depending upon 'importance' (actually model sizes), so a building being important, it would do that.
Cheers


Re: Object Distance - ***Niko*** - 13.10.2013

Quote:
Originally Posted by Aliassassin123456
View Post
1. Replace All CreateObject/CreateDynamicObject to CreateDynamicObjectEx
2. Change CreateDynamicObjectEx parameters in the include (streamer.inc)
pawn Code:
(
native CreateDynamicObjectEx(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 0.0, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
to ->
native CreateDynamicObjectEx(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 700.0, Float:streamdistance = 700.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
)
3. Now use this function in your OnGameModeInit Callback ( put Streamer_VisibleItems(STREAMER_TYPE_OBJECT, 1000); on your OnGameModeInit )
4. Now Your Problem Fixed!!!
I did this now,but i got question will my server lag or something with more players?