Kylla: The SA-MP server reports the player's position as 0.0, 0.0, 0.0 if he is not spawned, so obviously, the plugin will not stream objects properly at the class selection screen. There is little I can do about this. You can easily script it yourself, but you have to take a few things into consideration so that your own objects do not conflict with those that the plugin creates:
pawn Код:
#define MAX_SERVER_PLAYERS 32
#define MAX_SS_OBJECTS 50
new
gSSObjects[MAX_SERVER_PLAYERS][MAX_SS_OBJECTS],
bool:gSSObjectsCreated[MAX_SERVER_PLAYERS];
public
OnPlayerRequestClass(playerid, classid)
{
// Check if the objects have not already been created for the player
if (!gSSObjectsCreated[playerid])
{
// Create the objects for the player
gSSObjects[playerid][0] = CreatePlayerObject(playerid, 2585, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0);
gSSObjects[playerid][1] = CreatePlayerObject(playerid, 2586, 15.0, 15.0, 15.0, 0.0, 0.0, 0.0);
// ...
// Change the boolean variable so that objects cannot be created again
gSSObjectsCreated[playerid] = true;
}
}
public
OnPlayerRequestSpawn(playerid)
{
// Destroy all of the objects before the player spawns
for (new i = 0; i < MAX_SS_OBJECTS; i++)
{
DestroyPlayerObject(playerid, gSSObjects[playerid][i]);
}
// Change the boolean variable so that objects can be created again
gSSObjectsCreated[playerid] = false;
}
Do
not attempt to destroy these objects under OnPlayerSpawn, because you could inadvertently destroy objects that the streamer is creating (the internal IDs are shared).
© HungryPinkPig ©: Make sure that you're compiling your scripts with the latest include file.