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

So, I want to have a 3DTextLabel that triggers OnPlayerSpawn and says "I recently spawned." for 20 seconds. However, it only seems to delete the label after 20 seconds for the first player that has it, and for the rest, it remains permanently.

See the code below:

Код:
new Text3D:PlayerLoginLabel[MAX_PLAYERS]; // //So each player has it's own 3DTextLabel.
new ExistentPlayerLoginLabels; // In order to know which label is which. 
new LoginLabelDespawnTimer[MAX_PLAYERS]; // A timer for each label to despawn

public OnPlayerSpawn(playerid)
{
        new LoginLabelid; // A variable to define label ID's (used for the timers)
    	ExistentLoginLabels++;
    	LoginLabelid = ExistentPlayerLoginLabels;
    	LoginLabelDespawnTimer[LoginLabelid] = SetTimerEx("LabelTimer", 20000, false, "i", LoginLabelid);
        return 1;
}

forward LabelTimer(LoginLabelid);
public LabelTimer(LoginLabelid)
{
    Delete3DTextLabel(PlayerLoginLabel[LoginLabelid]);
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)