3DTextLabel not working? (urgent)
#1

Hello guys, I'm making an /onduty + /offduty command for my admin script. I have already made the /onduty command, here it is:

Код:
CMD:onduty(playerid, params[])
{
 	if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
   	new Text3D:label = Create3DTextLabel("Admin ON duty \n Do not kill", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
	Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
	SendClientMessage(playerid, 0x008080FF, "You are now on Admin duty");
	new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"*Admin %s is now on duty!",pName);
    SendClientMessageToAll(0xFF9500FF,string);
	return 1;
}
and heres my /offduty command:

Код:
CMD:offduty(playerid, params[])
{
    if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
    DeletePlayer3DTextLabel(playerid,label);
   	SendClientMessage(playerid, 0x008080FF, "You are now off Admin duty");
   	new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"*Admin %s is now off duty!",pName);
    SendClientMessageToAll(0xFF9500FF,string);
	return 1;
}
And I get this error:

Код:
C:\DOCUME~1\DANNY~1.YOU\MYDOCU~1\CNRSER~1\GAMEMO~1\Testing.pwn(798) : error 017: undefined symbol "label"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Please help! thanks
Reply
#2

Try to copy new Text3D label in off duty.
Reply
#3

Try with changing
pawn Код:
new Text3D:label
to the
pawn Код:
new label
And that var label must be global var because it won't work in other CMD, only in the CMD:onduty
Reply
#4

Quote:
Originally Posted by B-Matt
Посмотреть сообщение
And that var label must be global var because it won't work in other CMD, only in the CMDnduty
Oh, sorry!
Reply
#5

everytime i change it to global, it gives me errors!
Reply
#6

new label; //Global
label = Create.... //In the command
Reply
#7

OMG! It doesn't work! Explain it properly please
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)