Open RaphaelCapone opened 3 years ago
If you still need a solution for this...
When a player connects, your code may be somewhere setting Streamer_ToggleItemUpdate to false for STREAMER_TYPE_OBJECT
. When the Streamer Plugin streams items, by default it uses player's position. When the player is in class selection, the position is retrieved as being 0.0, 0.0, 0.0
, which is incorrect. Because of this, in OnPlayerRequestClass
we have to call Streamer_UpdateEx
, but it has to be used after Streamer_ToggleItemUpdate
is set to false, otherwise the objects restreaming code would be triggered after a maximum of 50 miliseconds (by default) and the objects may disappear (as it happens in your case). So, my assumption is that your code sets Streamer_ToggleItemUpdate
again to true somewhere when the player spawns, but when the player is forced back to the request class selection screen, it isn't toggling it back to false. If I'm not forgetting something, then this would fix it for you.
Also, as a suggestion, instead of checking if the player can use the selected class after he's spawning and then forcing him back, you may want to use OnPlayerRequestSpawn
. Returning 0 in this callback prevents spawning the player at all:
public OnPlayerRequestSpawn(playerid)
{
if(PlayerInfo[playerid][pClass] == 0)
return SendClientMessage(playerid, -1, "Nope"), 0;
return 1;
}
Hello, I got a problem streaming objects in a specific interior while player class selection. So every time I prevent the player to spawn a class he don't have enough level for it, or /reclass, my class selection map seems to just disappear after few miliseconds. The map selection class is set to a specific interior, as is shown in the code below:
My class selection code:
My spawn player code:
My reclass command code:
Video demonstration of the bug: https://youtu.be/q75OJAPDwEU
I'm using the latest version of streamer.