Attach3DTextLabel problems helps
#1

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)