SA-MP Forums Archive
Attach3DTextLabel problems helps - 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: Attach3DTextLabel problems helps (/showthread.php?tid=443482)



Attach3DTextLabel problems helps - yaron0600 - 12.06.2013

Hey whats the problem here ? BTW the new label; and the label I put under OnPlayerConnect

Код:
	new label;
	label= CreateDynamic3DTextLabel("Admin On Duty!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
CMD:aduty(playerid, params[])
{
	    if(IsPlayerConnected(playerid))
	    {
			new string[120];
			if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdminDuty] == 0)
			{
 				SendClientMessage(playerid, COLOR_GREEN, "   You are now on admin duty.");
				//SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
                format(string, sizeof(string), "** Administrator %s is now on admin duty. (/report for assistance) **", GetPlayerNameEx(playerid));
 	            SendClientMessageToAllEx(COLOR_YELLOW, string);
				PlayerInfo[playerid][pAdminDuty] = 1;
				SetPlayerHealth(playerid, 9999);
				SetPlayerArmour(playerid, 9999);
				Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);

			}
			else if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdminDuty] != 0)
			{
				SendClientMessageEx(playerid, COLOR_GREEN, "   You are now off admin duty.");
                format(string, sizeof(string), "** Administrator %s is now off admin duty. **", GetPlayerNameEx(playerid));
	            SendClientMessageToAllEx(COLOR_YELLOW, string);
	            //SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
				SetPlayerHealth(playerid, 100);
				SetPlayerArmour(playerid, 0);
				PlayerInfo[playerid][pAdminDuty] = 0;
				Delete3DTextLabel(Text3D:label)
			}
		}
		return 1;
}
Код:
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP2Reported.pwn(46052) : error 017: undefined symbol "label"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP2Reported.pwn(46064) : error 017: undefined symbol "label"



Re: Attach3DTextLabel problems helps - Avi57 - 12.06.2013

use it like this :-
pawn Код:
CMD:aduty(playerid, params[])
{
            new label;
        label= CreateDynamic3DTextLabel("Admin On Duty!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
        if(IsPlayerConnected(playerid))
        {
            new string[120];
            if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdminDuty] == 0)
            {
                SendClientMessage(playerid, COLOR_GREEN, "   You are now on admin duty.");
                //SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
                format(string, sizeof(string), "** Administrator %s is now on admin duty. (/report for assistance) **", GetPlayerNameEx(playerid));
                SendClientMessageToAllEx(COLOR_YELLOW, string);
                PlayerInfo[playerid][pAdminDuty] = 1;
                SetPlayerHealth(playerid, 9999);
                SetPlayerArmour(playerid, 9999);
                Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);

            }
            else if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdminDuty] != 0)
            {
                SendClientMessageEx(playerid, COLOR_GREEN, "   You are now off admin duty.");
                format(string, sizeof(string), "** Administrator %s is now off admin duty. **", GetPlayerNameEx(playerid));
                SendClientMessageToAllEx(COLOR_YELLOW, string);
                //SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 0);
                PlayerInfo[playerid][pAdminDuty] = 0;
                Delete3DTextLabel(Text3D:label)
            }
        }
        return 1;
}