[HELP]3D Text Labels - 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: [HELP]3D Text Labels (
/showthread.php?tid=349731)
[HELP]3D Text Labels -
Korisnik - 09.06.2012
I am testing some admin commands.i didnt make that player must be admin just this
Код:
CMD:aon(playerid, params[])
{
new Text3D:al = Create3DTextLabel("((Na Admin Duznosti))", COLOR_ADMIN, 30.0, 40.0, 50.0, 40.0, 0);
if(PlayerInfo[playerid][aduty] == 0)
{
Attach3DTextLabelToPlayer(Text3D:al, playerid, 0.0, 0.0, 0.5);
SCM(playerid, COLOR_ADMIN, "Sada si na admin duznosti.");
SetPlayerColor(playerid, COLOR_ADMIN);
SetPlayerArmour(playerid, 1000);
SetPlayerHealth(playerid, 1000);
PlayerInfo[playerid][aduty] = 1;
return 1;
}
else
{
Delete3DTextLabel(Text3D:al);
SetPlayerColor(playerid, COLOR_WHITE);
SCM(playerid, COLOR_ADMIN, "Vise nisi na admin duznosti.");
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
PlayerInfo[playerid][aduty] = 0;
return 1;
}
}
In Game everything works except removing label.
Re: [HELP]3D Text Labels -
JhnzRep - 09.06.2012
Put this somewhere in your script(Above the command)
Then do this in the command under if(PlayerInfo[playerid][aduty] == 0)
pawn Код:
al[playerid] = Create3DTextLabel("((Na Admin Duznosti))", COLOR_ADMIN, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(al[playerid], playerid, 0.0, 0.0, 0.5);
Then to delete it:
pawn Код:
Delete3DTextLabel(al[playerid]);
Re: [HELP]3D Text Labels -
Korisnik - 09.06.2012
again same thing,atach label but dont remove it
Re: [HELP]3D Text Labels -
JhnzRep - 09.06.2012
This has worked for me before, it might not help but it's worth a shot.
pawn Код:
CMD:aon(playerid, params[])
{
new Text3D:al = Create3DTextLabel("((Na Admin Duznosti))", COLOR_ADMIN, 30.0, 40.0, 50.0, 40.0, 0);
if(PlayerInfo[playerid][aduty] == 1)
{
Delete3DTextLabel(Text3D:al);
SetPlayerColor(playerid, COLOR_WHITE);
SCM(playerid, COLOR_ADMIN, "Vise nisi na admin duznosti.");
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
PlayerInfo[playerid][aduty] = 0;
return 1;
}
else
{
Attach3DTextLabelToPlayer(Text3D:al, playerid, 0.0, 0.0, 0.5);
SCM(playerid, COLOR_ADMIN, "Sada si na admin duznosti.");
SetPlayerColor(playerid, COLOR_ADMIN);
SetPlayerArmour(playerid, 1000);
SetPlayerHealth(playerid, 1000);
PlayerInfo[playerid][aduty] = 1;
return 1;
}
}