24.02.2016, 17:28
(
Последний раз редактировалось Crayder; 24.02.2016 в 20:09.
)
Streamer position compensation!
So many people complain about setting players on streamed objects. The problem is that these people are setting the player on the objects before the objects are actually streamed in for the player to land on. This will work around that.
__________________________________________________ __________________________________________________
Description:
The only function included is as follows:
There are two basic usages for this.
1. Absolutely on the ground:
You can predefine define `TP_WAIT_TIME` before including this to set the default wait time.
Slice recommended really high wait times, at least 5 seconds.
Also, on a side note, I haven't tested this yet... Yes, I know I should've tested it before I released it, but I didn't! I don't have any lag to spare. If someone could confirm it works that'd be great. Here's how you can test:
__________________________________________________ __________________________________________________
Credits:
Thanks to Slice and Incognito for the ideas implemented here (combined their ideas).
No thanks to me! I take no credit for this, except sparking Incognito's idea.
__________________________________________________ __________________________________________________
Download!
So many people complain about setting players on streamed objects. The problem is that these people are setting the player on the objects before the objects are actually streamed in for the player to land on. This will work around that.
__________________________________________________ __________________________________________________
Description:
The only function included is as follows:
pawn Код:
SetPlayerCompensatedPos(playerid, Float:X, Float:Y, Float:Z, wait_time = 1000)
1. Absolutely on the ground:
- The position you specify is exactly where the player would be if they were standing on the ground. You can set wait_time to 0 so the player won't be controllable until the objects are definitely streamed.
- The position you specify MAY be on the ground. Just set the wait_time (which defaults to 1 second) to how long the script will wait for the objects to stream. If the objects are detected the player will be set controllable. If the objects do not stream before wait_time is over the player will be released then.
You can predefine define `TP_WAIT_TIME` before including this to set the default wait time.
Slice recommended really high wait times, at least 5 seconds.
Also, on a side note, I haven't tested this yet... Yes, I know I should've tested it before I released it, but I didn't! I don't have any lag to spare. If someone could confirm it works that'd be great. Here's how you can test:
- Create a bunch of objects somewhere (THOUSANDS, seriously, a hundred thousand dispersed across an area of about 500x500 should do the trick).
- Create a plane object (anything flat and thin) above them.
- Spawn a player far away from them.
- Set the player on the plane with SetPlayerPos.
- Repeat #3.
- Repeat #4 using SetPlayerCompensatedPos with wait time 0.
- Repeat #3.
- Repeat #4 using SetPlayerCompensatedPos with wait time 5000.
- Repeat #3.
- Repeat #4 using SetPlayerCompensatedPos with wait time 5000 this time higher than the ground, like 2 units higher.
__________________________________________________ __________________________________________________
Credits:
Thanks to Slice and Incognito for the ideas implemented here (combined their ideas).
No thanks to me! I take no credit for this, except sparking Incognito's idea.
__________________________________________________ __________________________________________________
Download!