Attach3DTextLabelToPlayer Problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Attach3DTextLabelToPlayer Problem (
/showthread.php?tid=151791)
Attach3DTextLabelToPlayer Problem -
HydraX - 31.05.2010
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?
Re: Attach3DTextLabelToPlayer Problem -
[HiC]TheKiller - 31.05.2010
Lets see the IsPlayerVipType function =P.
Re: Attach3DTextLabelToPlayer Problem -
HydraX - 31.05.2010
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;
}
Re: Attach3DTextLabelToPlayer Problem -
Antonio [G-RP] - 01.06.2010
OnPlayerDisconnect place "DeletePlayer3DTextLabel" or whatever it is.. trust me.. it works.
Re: Attach3DTextLabelToPlayer Problem -
HydraX - 01.06.2010
Is your trust from experience?
EDIT: I think not..
Re: Attach3DTextLabelToPlayer Problem -
Antonio [G-RP] - 01.06.2010
It did it for me.