3d Labels not deleting on user disconnect
#1

Code: http://pastebin.com/f2bb3a914

Basically, what happens is .. a player will go /away .. and then if he /quits whilst he is /away then rejoins .. all the information is still there, for example, they'll still be AFK and the 3D Label will remain until they type /back again. Anybody know wtf is going on?
Reply
#2

Quote:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(PlayerIsAFK[playerid] == 1) return PlayerIsAFK[playerid] = 0;
    if(Denied[playerid] == 1) return Denied[playerid] = 0;
    if(UsedAFK[playerid] == 1) return UsedAFK[playerid] = 0;
    if(AFK[playerid]!= INVALID_3DTEXT_ID) return Delete3DTextLabel(AFK[playerid]);
    return 1;
}
Why return at all these if checks?
Reply
#3

Well I did that to try and fix this issue, but it didn't work.
Reply
#4

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(PlayerIsAFK[playerid] == 1) PlayerIsAFK[playerid] = 0;
    if(Denied[playerid] == 1) Denied[playerid] = 0;
    if(UsedAFK[playerid] == 1) UsedAFK[playerid] = 0;
    if(AFK[playerid]!= INVALID_3DTEXT_ID) Delete3DTextLabel(AFK[playerid]);
    return 1;
}
Reply
#5

! That's what it was before.

I don't know why, or if it is anything to do with the issue at hand, but I am getting 2 tag mismatch warnings when I compile on lines 46 and 55.

46:
Код:
AFK[playerid] = INVALID_3DTEXT_ID;
55:
Код:
if(AFK[playerid]!= INVALID_3DTEXT_ID) Delete3DTextLabel(AFK[playerid]);
Reply
#6

Because the "AFK" variable is a number, not ?

pawn Код:
new Text3D:AFK[MAX_PLAYERS];
Or the INVALID_3DTEXT_ID is a number, and you cant use other types
Reply
#7

Anyone who knows what they are talking about, feel free to help me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)