Issue with 3DTextLabel that's ment to vanish with a timer.
#5

So I installed YSF and compiled the code, but now the labels won't appear at all.

My current code:

Код:
new 
    Text3D:PlayerLoginLabel[MAX_PLAYERS] = { Text3D:INVALID_3DTEXT_ID, ... }, // So each player has it's own 3DTextLabel. 
    LoginLabelDespawnTimer[MAX_PLAYERS]; // A timer for each label to despawn. (Although technically, unless you specifically need to use the timer ids somewhere else in your code; you don't even need a variable to store all the timer ids.) 

public OnPlayerSpawn(playerid)
{
    	if(!IsValid3DTextLabel(PlayerLoginLabel[playerid]))
    	{ 
        	PlayerLoginLabel[playerid] = Create3DTextLabel("I just spawned.", COLOR_YELLOW, 0, 0, 0, 20, 0);
        	LoginLabelDespawnTimer[playerid] = SetTimerEx("SpawnLabelTimer", 20000, false, "i", playerid); 
    	}
	return 1;
}

forward SpawnLabelTimer(playerid); 
public SpawnLabelTimer(playerid) 
{ 
    if(IsValid3DTextLabel(PlayerLoginLabel[playerid])) 
    { 
        Delete3DTextLabel(PlayerLoginLabel[playerid]); 
        PlayerLoginLabel[playerid] = Text3D:INVALID_3DTEXT_ID; 
    } 
}
Anyone, please help me out.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)