There are some mistakes with that, use it like this:
pawn Код:
new Text3D:ScoreLabel[MAX_PLAYERS]; // It should be a global array, so we can destroy it again
public OnPlayerConnect(playerid) // You need the playerid-parameter
{
// Why use a loop? That would just create more and more labels when someone connects
if(pLevel[playerid] < 5) // If-statements cannot have semicolons
{
new string[24];
format(string, sizeof(string), "I am newbie. (Level: %i)", pLevel[playerid]); // You need to format the string, and you also need to use an integer, not string for the level
ScoreLabel[playerid] = CreateDynamic3DTextLabel(string, 0x008080FF, 30.0, 40.0, 50.0, 40.0, playerid);
// No need for 2 returns
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DestroyDynamic3DTextLabel(ScoreLabel[playerid]); // Destroys the 3DTextLabel
}
With Streamer, it can easily bug out if you don't use dynamic labels.
But whenever you give some player score, you should check if his score goes over 4, and destroy the text label, like:
pawn Код:
if(pLevel[playerid] > 4) DestroyDynamic3DTextLabel(ScoreLabel[playerid]);