SA-MP Forums Archive
3DTextLabel not working? (urgent) - 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: 3DTextLabel not working? (urgent) (/showthread.php?tid=410909)



3DTextLabel not working? (urgent) - Goldino - 27.01.2013

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


Re: 3DTextLabel not working? (urgent) - SilverKiller - 27.01.2013

Try to copy new Text3D label in off duty.


Re: 3DTextLabel not working? (urgent) - B-Matt - 27.01.2013

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


Re: 3DTextLabel not working? (urgent) - SilverKiller - 27.01.2013

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!


Re: 3DTextLabel not working? (urgent) - Goldino - 27.01.2013

everytime i change it to global, it gives me errors!


Re: 3DTextLabel not working? (urgent) - B-Matt - 27.01.2013

new label; //Global
label = Create.... //In the command


Re: 3DTextLabel not working? (urgent) - Goldino - 27.01.2013

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