SA-MP Forums Archive
VIP 3D Text Trouble - 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 3D Text Trouble (/showthread.php?tid=300011)



VIP 3D Text Trouble - Thresholdold - 28.11.2011

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.


Re: VIP 3D Text Trouble - CONTROLA - 28.11.2011

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.


Re: VIP 3D Text Trouble - Thresholdold - 28.11.2011

Код:
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


Re: VIP 3D Text Trouble - CONTROLA - 28.11.2011

It means something sets pVip's value somewhere else.


Re: VIP 3D Text Trouble - Thresholdold - 28.11.2011

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



Re: VIP 3D Text Trouble - Thresholdold - 28.11.2011

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";



Re: VIP 3D Text Trouble - CONTROLA - 28.11.2011

Those codes shouldn't change the values.


Re: VIP 3D Text Trouble - Thresholdold - 28.11.2011

I will just delete the whole text thing, oh well