VIP 3D Text Trouble
#1

I am using the LuxAdmin Script, and whenever I put this code in:

Код:
public OnPlayerSpawn(playerid)
{
    if(AccInfo[playerid][pVip] >= 1)
			{
        new Text3D:VIPLabel[MAX_PLAYERS];
        VIPLabel[playerid] = Create3DTextLabel("VIP",0xFFFF00AA,0,0,0,50,-1,1);
        Attach3DTextLabelToPlayer(VIPLabel[playerid], playerid, 0,0,0);
        }
It adds the 'VIP' text above the player's head just like I want it... the only thing is... It gives it to EVERY player on the server, even if they aren't VIP

Please help me.
Reply
#2

Make sure in OnPlayerConnect callback you are setting it 0.

pawn Код:
AccInfo[playerid][pVip] = 0;
After you connect, the account system will set it the value it was before you disconnected.
Reply
#3

Код:
public OnPlayerConnect(playerid)
{
    #if EnableCamHack == true
    KeyState[playerid] = 0;
    FollowOn[playerid] = 0;
    AccInfo[playerid][InCamMod] 	= 0;
    AccInfo[playerid][LockedCam] 	= 0;
    #endif
	AccInfo[playerid][Deaths] 		= 0;
	AccInfo[playerid][Kills] 		= 0;
	AccInfo[playerid][Jailed]		= 0;
	AccInfo[playerid][Frozen]		= 0;
	AccInfo[playerid][Level] 		= 0;
	AccInfo[playerid][pVip]         = 0;

etc.
I still get the same error
Reply
#4

It means something sets pVip's value somewhere else.
Reply
#5

If I changed the first code to this, would it help?

Код:
 public OnPlayerSpawn(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    if(AccInfo[i][pVip] >= 1)
			{
        new Text3D:VIPLabel[MAX_PLAYERS];
        VIPLabel[playerid] = Create3DTextLabel("VIP",0xFFFF00AA,0,0,0,50,-1,1);
        Attach3DTextLabelToPlayer(VIPLabel[playerid], playerid, 0,0,0);
        }
Reply
#6

Would this have anything to do with it?

Код:
if(AccInfo[playerid][pVip] > 0)
			{
				switch(AccInfo[playerid][pVip])
                {
					case 0: AccType = "Normal";
					case 1: AccType = "Silver";
					case 2: AccType = "Gold";
					case 3: AccType = "Platinum";
Reply
#7

Those codes shouldn't change the values.
Reply
#8

I will just delete the whole text thing, oh well
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)