11.03.2015, 13:59
Hello.
Im using Incognitos streamer plugin (latest version) and i have a code to "mark" players as away when they are paused (when onplayerupdate isn't called)
However, when onplayerupdate is called, i attempt to destroy the textlabel. In the code below, i include two examples i've used, and what it causes online.
Is there any ideas what i can do / try ?
Any help would be greatly appreciated.
Im using Incognitos streamer plugin (latest version) and i have a code to "mark" players as away when they are paused (when onplayerupdate isn't called)
However, when onplayerupdate is called, i attempt to destroy the textlabel. In the code below, i include two examples i've used, and what it causes online.
PHP код:
new afkvar[MAX_PLAYERS];
new Text3D:afk[MAX_PLAYERS];
//onplayerupdate2 called every second
if(IsPlayerAfk(i) && GetPVarInt(i, "notspawned") == 0)
{
if(afkvar[i] == 0)
{
afk[i] = CreateDynamic3DTextLabel("Away / AFK", 0xEE0000AA, 0.0, 0.0, 1.3, 40.0, i, INVALID_VEHICLE_ID, 1, -1,-1, -1, 300.0);
afkvar[i] = 1;
}
}
//onplayerupdate:
afkvar[playerid] = 0;
if(IsValidDynamic3DTextLabel(afk[playerid]))
DestroyDynamic3DTextLabel(afk[playerid]);
//no afk tags appear wit this, i think it also affects other labels? I mean, private car labels wont even show now.
//i also tried this on onplayerupdate://
if(afkvar[playerid])
{
//remove the text and set afkvar[playerid] = 0;
}
//but text wont dissapear at all times here. So many players have the tag above their heads.
Any help would be greatly appreciated.