Attach3DTextLabelToPlayer Problem
#1

Don't judge indentation. It's a lot better in Pawno.
pawn Код:
if(IsPlayerVipType(playerid,1))
  {
    Silver[playerid] = Create3DTextLabel("Silver Memeber",0x008080FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Silver[playerid], playerid, 0.0, 0.0, 0.7);
    }
    if(IsPlayerVipType(playerid,2))
    {
        Gold[playerid] = Create3DTextLabel("Gold Memeber",0x008080FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Gold[playerid], playerid, 0.0, 0.0, 0.7);
    }
    if(IsPlayerVipType(playerid,3))
    {
        Premium[playerid] = Create3DTextLabel("Premium Memeber",0x008080FF,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(Premium[playerid], playerid, 0.0, 0.0, 0.7);
    }
...When you join the server, this script was ment for players who have an VIP account, but it also shows for players who aren't even members to the server..
Any Ideas on how to fix this?
Reply
#2

Lets see the IsPlayerVipType function =P.
Reply
#3

Okay here it goes..


pawn Код:
stock IsPlayerVipMember(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new file[256], tmp, tmp2;

format(file,256,"/LuxAdmin/Accounts/%s.sav",udb_encode(name));
tmp = dini_Int(file,"AccountType");
tmp2 = dini_Int(file,"Loggedin");

if((IsPlayerConnected(playerid)) && (tmp > 0) && (tmp2 == 1) )
return true;
else return false;
}

stock IsPlayerVipType(playerid, type)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));

new file[256], tmp, tmp2;

format(file,256,"/LuxAdmin/Accounts/%s.sav",udb_encode(name));
tmp = dini_Int(file,"AccountType");
tmp2 = dini_Int(file,"Loggedin");
printf("tmp = %d, tmp2(logged) = %d, level = %d", tmp, tmp2, type);
if((IsPlayerConnected(playerid)) && (tmp >= type) && (tmp2 != 0))
return true;
else return false;
}
Reply
#4

OnPlayerDisconnect place "DeletePlayer3DTextLabel" or whatever it is.. trust me.. it works.
Reply
#5

Is your trust from experience?
EDIT: I think not..
Reply
#6

It did it for me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)