SA-MP Forums Archive
3dtextlabel - 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 (/showthread.php?tid=617515)



3dtextlabel - StR_MaRy - 22.09.2016

why the 3dtextlabel is not deleted after he get off duty

Код HTML:
CMD:hod(playerid, params[])
{
    if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
    if(PlayerInfo[playerid][pGamingPerk] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai acces la aceasta comanda!");
	if (PlayerInfo[playerid][pHelper] >= 1)
	{
	    new Text3D:onduty = Create3DTextLabel("Helper On-Duty", COLOR_LIGHTGREEN, 30.0, 40.0, 50.0, 40.0, 0);
	    if(HelperDuty[playerid] == 1)
		{
   			HelperDuty[playerid] = 0;
   			Delete3DTextLabel(Text3D:onduty);
   			SendClientMessage(playerid, COLOR_SYN, "(!) {FFFFFF}Acum nu mai esti disponibil in calitate de helper, nu o sa mai primesti intrebari din partea incepatorilor.");
        }
		else
		{
		    format(gString, sizeof(gString), "Helperul {B8DBFF}%s {FFFFFF}este disponibil. Foloseste {B8DBFF}/sms {FFFFFF}sau {B8DBFF}/n {FFFFFF}daca doresti ajutor.",GetName(playerid),playerid);
			SendClientMessageToAll(COLOR_WHITE,gString);
			HelperDuty[playerid] = 1;
			Attach3DTextLabelToPlayer(Text3D:onduty, playerid, 0.0, 0.0, 0.5);
			SendClientMessage(playerid, COLOR_SYN, "(!) {FFFFFF}Acum esti la datorie in calitate de helper, o sa primesti intrebari din partea incepatorilor.");
		}
	}
	else
	{
	    SendClientMessage(playerid,COLOR_ERROR,"Nu esti helper !");
	}
	return 1;
}



Re: 3dtextlabel - UnGodly - 22.09.2016

Your code should be

PHP код:
DeletePlayer3DTextLabel(playerid,Text3D:onduty); 
instead

PHP код:
Delete3DTextLabel(Text3D:onduty); 
You were creating a 3d text label only for a specific player.

https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel
https://sampwiki.blast.hk/wiki/DeletePlayer3DTextLabel
https://sampwiki.blast.hk/wiki/Delete3DTextLabel