Vip label
#1

This can be a stupid problem, i know, i fixed more hard things then this, but with this code i can't find a way to make it work.

This code is supposed to show a textlabel on the player's head if he's a vip. It works if i am a vip member, but, if i remove my vip status, i still have that textlabel:

pawn Код:
if(PlayerInfo[playerid][Vip] == 1)
    {
    new Text3D:VipLabel = Create3DTextLabel("Vip Player", 0xFFFF00FF, 30.0, 40.0, 50.0, 50.0, 0);
    Attach3DTextLabelToPlayer(VipLabel, playerid, 0.0, 0.0, 0.7);
    }
    else
    {
    new Text3D:VipLabel;
    Delete3DTextLabel(VipLabel);
    }
Reply
#2

pawn Код:
Delete3DTextLabel(VipLabel);
Put this on the code where you set his vip level to 0.
Reply
#3

You dont need create a label again in the else statement

Follow the guide from the wiki to create 3dTextLabels: https://sampwiki.blast.hk/wiki/Create3DTextLabel

Create the label in OnGamemodeInit first, later create a timer to check if the player is VIP or not to attach, delete the label.

How to use Timer with functions: https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#4

Thanks, fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)