SA-MP Forums Archive
Vip label - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vip label (/showthread.php?tid=492565)



Vip label - Face9000 - 04.02.2014

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);
    }



Re: Vip label - Jimmy0wns - 04.02.2014

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


Respuesta: Vip label - LuisR - 04.02.2014

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


Re: Vip label - Face9000 - 04.02.2014

Thanks, fixed.