PDA

View Full Version : [HELP] streamer-object fall through


Matthew_Murdoch
07/12/2009, 08:07 PM
I'm currently using a streamer for my objects.

2 problems are really getting to me.

1. Prison out at sea used for faction spawn point and vehicles for the faction.
When i initially spawn there, i fall through the objects, (due to streamed objects use view distance) and vehicles fall through aswell into the sea, requiring me to tele again and to type /respawnvehicles

2. Basically the same as 1 but a shamal interior, when "g" is pressed, 50% of the time i fall through objects down to a impending d00m.

How do i fix this fallthrough effect.

dice7
07/12/2009, 08:39 PM
Create the objects on which you teleport with CreateObject() so they will be static

Matthew_Murdoch
07/12/2009, 08:45 PM
Create the objects on which you teleport with CreateObject() so they will be static

tried that, somehow conflicts with streamer and other objects don't appear

Goobiiify
07/12/2009, 09:24 PM
I have same problem, I was thinking about higher the Z float 1-2 meters up on the sky so when someone goes there, They will fall down at the object. I have not tested it but it could work.

S1nn3r
14/02/2010, 03:00 PM
This is what I use, it works for 95% of the time.

under OnGameModeInit() or OnFilterScriptInit()
forward loadobject(playerid);

At the bottom of the script (place under nothing)
public loadobject(playerid)
{
if IsPlayerInAnyVehicle(playerid)*then
{
new Float:minvx, Float:minvy, Float:minvz;
GetVehiclePos(GetPlayerVehicleID(playerid), minvx, minvy, minvz);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 90);
SetVehiclePos(GetPlayerVehicleID(playerid), minvx, minvy, (minvz + 3));
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0x33AA33AA, "[TELEPORT] You were ejected from your vehicle to allow objects to load");
return 1;
}
else
{
new Float:minpx, Float:minpy, Float:minpz;
GetPlayerPos(playerid, minpx, minpy, minpz);
SetPlayerPos(playerid, minpx, minpy, (minpz + 3));
}
return 1;
}

Example of a teleport, place this under OnPlayerCommandText()
new vehID = GetPlayerVehicleID(playerid);//Gets vehicle ID for teleport

if (strcmp("/10miledrag", cmdtext, true, 10) == 0 || strcmp(cmdtext, "/10md", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(vehID, 3087.39453125, -1427.994140625, 15.377157211304);//10miledrag Freeze Car
}
else//if they are not in a vehicle
{
SetPlayerPos(playerid, 3087.39453125, -1427.994140625, 15.377157211304);//10miledrag Freeze player
}
GameTextForPlayer(playerid, "~g~Welcome To~n~~b~ The DragStrip!", 5000, 5);
SetTimerEx("loadobject", 500, 0, "d", playerid);
SendClientMessage(playerid, 0x00f6f6AA, "Welcome to 10-Mile-Drag Strip!");
return 1;
}

kLx
14/02/2010, 04:00 PM
I'm using this type on my server.
On teleport command I set

TogglePlayerControllable( playerid, false );
SetTimerEx( "UnfreezePlayer", 5000, 0, "i", playerid );
GameTextForPlayer(playerid," Please wait 5 seconds... ",5000, 6);

And of course an UnfreezePlayer function.

forward UnfreezePlayer( playerid );
public UnfreezePlayer( playerid )
{
TogglePlayerControllable( playerid, true );
return 1;
}

This will freeze player for five seconds in the air, till objects load. Works for me.
Cheers, kLx :lol:

S1nn3r
14/02/2010, 05:51 PM
I'm using this type on my server.
On teleport command I set

TogglePlayerControllable( playerid, false );
SetTimerEx( "UnfreezePlayer", 5000, 0, "i", playerid );
GameTextForPlayer(playerid," Please wait 5 seconds... ",5000, 6);

And of course an UnfreezePlayer function.

forward UnfreezePlayer( playerid );
public UnfreezePlayer( playerid )
{
TogglePlayerControllable( playerid, true );
return 1;
}

This will freeze player for five seconds in the air, till objects load. Works for me.
Cheers, kLx :lol:


That won't freeze the car, same problem.

jtweak
07/12/2011, 09:12 PM
i suggest getting a new streamer :S im having this problem, im gonna try incognitos now wish me luck

Babul
07/12/2011, 09:23 PM
using Incognito's streamer, the fall-thru problem can be solved by using

Streamer_Update(playerid);

directly before teleporting a player. another trick to speed it up, is to "prespawn" important objects (floor/ground) by letting the player see it after logging in. even a brief moment will cause the object being preloaded, this helps to prevent the missing-texture-bug for high placed objects aswell:
for spawning ON the cityhall stairs (inside, at the roof entrance), an additional (but not visible) stairs object placed outside the entrance forces the object getting streamed for any player who wants to enter. it uses just 1 more object, which is certainly no waste, using that awesome streamer :)

jtweak
07/12/2011, 09:40 PM
using Incognito's streamer, the fall-thru problem can be solved by using

Streamer_Update(playerid);

directly before teleporting a player. another trick to speed it up, is to "prespawn" important objects (floor/ground) by letting the player see it after logging in. even a brief moment will cause the object being preloaded, this helps to prevent the missing-texture-bug for high placed objects aswell:
for spawning ON the cityhall stairs (inside, at the roof entrance), an additional (but not visible) stairs object placed outside the entrance forces the object getting streamed for any player who wants to enter. it uses just 1 more object, which is certainly no waste, using that awesome streamer :)

i apply that to each thing spawning?

Babul
07/12/2011, 10:17 PM
@jtweak: yes, its a good idea to use this method on each object you want a player/vehicle to spawn on - lets assume your map includes some platforms 3095, and some of the new concrete objects, then you can just modify your maps to contain those vital ground objects somewhere else (if you use different interiors/virtualworlds, then you need two maps, one for each world/interior, containing just a few objects for preloading). its like spawning on a road up the sky: the object is not loaded yet, coz it never was visible: you will fall through, coz the object got not streamed yet. one solution is the Streamer_Update, this loads the collision at least, but sometimes on a not(yet) streamed object the texture is missing. if the object got preloaded by using the two-maps-trick, then it will show up by using "only" the streamer_update.

jtweak
07/12/2011, 10:54 PM
so..... LastVehicleID = Vehicle_AddStatic(522,158.10000610,3323.89990234,2 3.10000038,0.00000000,-1,-1,15); //NRG-500
LastVehicleID = Vehicle_AddStatic(481,153.00000000,3323.10009766,2 3.10000038,0.00000000,-1,-1,15); //BMX
LastVehicleID = Vehicle_AddStatic(509,157.79980469,3326.50000000,2 3.10000038,87.42370605,-1,-1,15); //Bike
LastVehicleID = Vehicle_AddStatic(482,148.19999695,3324.89990234,2 3.70000076,357.94006348,-1,-1,15); //Burrito
LastVehicleID = Vehicle_AddStatic(525,142.89941406,3324.50000000,2 3.39999962,356.91284180,-1,-1,15); //Tow Truck
LastVehicleID = Vehicle_AddStatic(598,137.50000000,3325.10009766,2 3.29999924,0.00000000,-1,-1,15); //Police Car (LVPD)
LastVehicleID = Vehicle_AddStatic(603,151.89999390,3360.10009766,2 6.70000076,357.94287109,-1,-1,15); //Phoenix
LastVehicleID = Vehicle_AddStatic(437,158.10000610,3342.60009766,2 5.29999924,356.91430664,-1,-1,15); //Coach
LastVehicleID = Vehicle_AddStatic(462,154.69921875,3323.39941406,2 3.10000038,0.00000000,-1,-1,15); //Faggio
LastVehicleID = Vehicle_AddStatic(495,132.39999390,3323.30004883,2 3.89999962,0.00000000,-1,-1,15); //Sandking
LastVehicleID = Vehicle_AddStatic(602,146.50000000,3361.10009766,2 6.60000038,0.00000000,-1,-1,15); //Alpha
LastVehicleID = Vehicle_AddStatic(429,141.19999695,3361.39990234,2 6.79999924,0.00000000,-1,-1,15); //Banshee
LastVehicleID = Vehicle_AddStatic(559,133.39999390,3361.89990234,2 6.50000000,0.00000000,-1,-1,15); //Jester
LastVehicleID = Vehicle_AddStatic(515,118.59999847,3429.30004883,1 1.69999981,0.00000000,-1,-1,15); //Roadtrain
LastVehicleID = Vehicle_AddStatic(435,118.50000000,3416.30004883,1 1.19999981,0.00000000,-1,-1,15); //Trailer 1
LastVehicleID = Vehicle_AddStatic(487,530.79998779,3634.39990234,1 4.19999981,11.31420898,-1,-1,15); //Maverick
LastVehicleID = Vehicle_AddStatic(447,272.29998779,3776.00000000,0 .89999998,6.17138672,-1,-1,15); //Seasparrow
LastVehicleID = Vehicle_AddStatic(444,-276.29998779,3620.39990234,38.00000000,0.00000000,-1,-1,15); //Monster
LastVehicleID = Vehicle_AddStatic(557,-64.19999695,3755.89990234,6.09999990,88.45654297,-1,-1,15); //Monster B
LastVehicleID = Vehicle_AddStatic(503,76.19921875,3314.89941406,10 .50000000,357.94006348,-1,-1,15); //Hotring Racer B
LastVehicleID = Vehicle_AddStatic(504,71.50000000,3314.60009766,10 .50000000,357.94287109,-1,-1,15); //Bloodring Banger
LastVehicleID = Vehicle_AddStatic(568,87.59999847,3475.69995117,8. 50000000,89.48510742,-1,-1,15); //Bandito
LastVehicleID = Vehicle_AddStatic(490,-98.00000000,3772.50000000,6.09999990,269.48632812,-1,-1,15); //FBI Rancher
LastVehicleID = Vehicle_AddStatic(580,157.30000305,3353.39990234,2 6.20000076,88.45654297,-1,-1,15); //Stafford
LastVehicleID = Vehicle_AddStatic(502,67.19999695,3314.80004883,10 .50000000,357.94287109,-1,-1,15); //Hotring Racer A
LastVehicleID = Vehicle_AddStatic(503,62.70000076,3315.69995117,10 .50000000,357.94287109,-1,-1,15); //Hotring Racer B
LastVehicleID = Vehicle_AddStatic(411,-97.80000305,3779.60009766,5.80000019,269.48632812,-1,-1,15); //Infernus
LastVehicleID = Vehicle_AddStatic(486,-205.80000305,3041.60009766,2.20000005,6.17138672,-1,-1,15); //Dozer
LastVehicleID = Vehicle_AddStatic(451,137.30000305,3361.60009766,2 6.50000000,0.00000000,-1,-1,15); //Turismo
LastVehicleID = Vehicle_AddStatic(462,150.60000610,3323.19995117,2 3.10000038,0.00000000,-1,-1,15); //Faggio
LastVehicleID = Vehicle_AddStatic(462,150.80000305,3326.80004883,2 3.10000038,0.00000000,-1,-1,15); //Faggio
LastVehicleID = Vehicle_AddStatic(462,154.10000610,3327.60009766,2 3.10000038,0.00000000,-1,-1,15); //Faggio
LastVehicleID = Vehicle_AddStatic(573,128.69999695,3361.10009766,2 7.00000000,0.00000000,-1,-1,15); //Duneride
LastVehicleID = Vehicle_AddStatic(589,128.50000000,3324.89990234,2 3.20000076,0.00000000,-1,-1,15); //Club
}




would be...like....
Streamer_Update(playerid);
LastVehicleID = Vehicle_AddStatic(522,158.10000610,3323.89990234,2 3.10000038,0.00000000,-1,-1,15); //
NRG-500
Streamer_Update(playerid);
LastVehicleID = Vehicle_AddStatic(481,153.00000000,3323.10009766,2 3.10000038,0.00000000,-1,-1,15); //BMX

correct? because all vehicles and players spawning are falling through objects and getting stuck

jtweak
07/12/2011, 11:19 PM
ohhhh, would it go on the object its spawning on? even though every spawning car does that?..

khimera
20/09/2014, 09:48 PM
This is what I use, it works for 95% of the time.

under OnGameModeInit() or OnFilterScriptInit()
forward loadobject(playerid);

At the bottom of the script (place under nothing)
public loadobject(playerid)
{
if IsPlayerInAnyVehicle(playerid)*then
{
new Float:minvx, Float:minvy, Float:minvz;
GetVehiclePos(GetPlayerVehicleID(playerid), minvx, minvy, minvz);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 90);
SetVehiclePos(GetPlayerVehicleID(playerid), minvx, minvy, (minvz + 3));
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0x33AA33AA, "[TELEPORT] You were ejected from your vehicle to allow objects to load");
return 1;
}
else
{
new Float:minpx, Float:minpy, Float:minpz;
GetPlayerPos(playerid, minpx, minpy, minpz);
SetPlayerPos(playerid, minpx, minpy, (minpz + 3));
}
return 1;
}

Example of a teleport, place this under OnPlayerCommandText()
new vehID = GetPlayerVehicleID(playerid);//Gets vehicle ID for teleport

if (strcmp("/10miledrag", cmdtext, true, 10) == 0 || strcmp(cmdtext, "/10md", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(vehID, 3087.39453125, -1427.994140625, 15.377157211304);//10miledrag Freeze Car
}
else//if they are not in a vehicle
{
SetPlayerPos(playerid, 3087.39453125, -1427.994140625, 15.377157211304);//10miledrag Freeze player
}
GameTextForPlayer(playerid, "~g~Welcome To~n~~b~ The DragStrip!", 5000, 5);
SetTimerEx("loadobject", 500, 0, "d", playerid);
SendClientMessage(playerid, 0x00f6f6AA, "Welcome to 10-Mile-Drag Strip!");
return 1;
}

Does this work guys? Is there any update for this type of problem? If someone knows something, please reply. Thank you