[HELP]3D Text Labels
#1

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.
Reply
#2

Put this somewhere in your script(Above the command)
pawn Код:
new al[MAX_PLAYERS]
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]);
Reply
#3

again same thing,atach label but dont remove it
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)