SA-MP Forums Archive
Help me about coding "Objects Loaded" - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me about coding "Objects Loaded" (/showthread.php?tid=112719)



Help me about coding "Objects Loaded" - xCoder - 09.12.2009

How can i show "Objects Loaded" text when all objects loaded?


Re: Help me about coding "Objects Loaded" - mprofitt - 09.12.2009

printf("Objects Loaded");

*me shrugs


Re: Help me about coding "Objects Loaded" - xCoder - 09.12.2009

Quote:
Originally Posted by mprofitt
printf("Objects Loaded");

*me shrugs
I mean freezes player and doesn't unfreeze until objects loaded


Re: Help me about coding "Objects Loaded" - Joe Staff - 09.12.2009

Quote:
Originally Posted by [XL
Fukara ]
Quote:
Originally Posted by mprofitt
printf("Objects Loaded");

*me shrugs
I mean freezes player and doesn't unfreeze until objects loaded
Contrary to popular belief, objects are loaded instantly. The only instance of objects not doing so is when a streamer is involved and is running on a timer. It's actually dumbfounded me as to why Object Streamers don't have a built-in LoadObjectsInArea(playerid,x,y,z) like function that would load the objects before the player is teleported there.


Re: Help me about coding "Objects Loaded" - Google63 - 09.12.2009

Loading time depends on speed of CPU, they aren't loaded instantly because it takes time to calculate matrices(vectors and stuff like that) for every object. Projection, view matrix, etc. This type of loading is done by your graphic card & DirectX3D. Streamers are server-side so it needs time to transfer all packets AND do above.


Re: Help me about coding "Objects Loaded" - Joe Staff - 09.12.2009

The viewing matrices take time to load, but the litteral collision model is loaded faster than the player being placed there. Ever hit an invisible building while flying?


Re: Help me about coding "Objects Loaded" - patchkinson - 09.12.2009

So, to help this guy out... he wants a timer that freezes the player while objects are loading..
so:
under #include <a_samp>
forward Freezeobj(i);

On the commands, like teleports to places with objects put:
SetTimerEx("Freezeobj",5000,0,"d",playerid);
so that will freeze player for 5000 miliseconds

and at very end of your script put
public Freezeobj(i) TogglePlayerControllable(i,1);

Should work now