SA-MP Forums Archive
How to add textdraw on player's head? - 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: How to add textdraw on player's head? (/showthread.php?tid=613392)



How to add textdraw on player's head? - Zeus666 - 27.07.2016

How can I add textdraw on the player's head, when he uses /helperduty ?


Re: Expected ; found , - Konstantinos - 27.07.2016

Код:
format(string, sizeof(string), "%s used goto on you.", GetAdminName(playerid)); 
format(str1, sizeof(str1), "%s used goto on %s.", GetAdminName(playerid), PlayerName(targetid));



Re: How to add textdraw on player's head? - Zeus666 - 27.07.2016

Thank you Konstantionos.

Now I changed the topic for another question, I can't figure it out


Re: How to add textdraw on player's head? - Quinncell - 27.07.2016

Uhm I am pretty certain thats not a texrdaw, it's a 3DTextLabel.
Read this: https://sampwiki.blast.hk/wiki/Attach3DTextLabelToPlayer
and lookup some tutorials about it.


Re: How to add textdraw on player's head? - Zeus666 - 27.07.2016

How do I know X, Y, Z coordonates from the player's head?


Re: How to add textdraw on player's head? - Quinncell - 27.07.2016

The tutorial is for /aduty but you get the idea
https://sampforum.blast.hk/showthread.php?tid=351068


Re: How to add textdraw on player's head? - Zeus666 - 27.07.2016

PHP код:
CMD:helperduty(playerid, params[])
{
    if (
pInfo[playerid][Helper] < 1)
        return 
SendClientMessage(playerid,COLOR_WHITE, "U aint helper.");
    if (!
pInfo[playerid][pHelperDuty])
    {
        
SetPlayerColor(playerid,COLOR_GREEN);
      new 
Text3D:label = Create3DTextLabel("HELPER DUTY - DON'T SHOOT", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    
Attach3DTextLabelToPlayer(helpduty, playerid, 0.0, 0.0, 0.7);
        
pInfo[playerid][pHelperDuty] = 1;
        new 
string[128];
        
GetPlayerName(playerid, string, 24);
        
format(string, sizeof(string), "{FF0000} %s is now helperdutyr" ,string);
        
SendClientMessageToAll(-1, string);
    }
    else
    {
        
SetPlayerColor(playerid, COLOR_WHITE);
          
DeletePlayer3DTextLabel(playerid,helpduty);
        
pInfo[playerid][pHelperDuty] = 0;
        new 
str[76], name[24];
        
GetPlayerName(playerid, name, 24);
        
format(str, sizeof(str), "{FF0000}%s no more helperduty", name);
        
SendClientMessageToAll(COLOR_GREEN, str);
    }
    return 
1;
} 
is that good?


Re: How to add textdraw on player's head? - Quinncell - 27.07.2016

I can't find a flaw so I am guessing it's good. (it might not be but I am not seeing any problems)


Re: How to add textdraw on player's head? - Zeus666 - 27.07.2016

error 017: undefined symbol "adutyduty"
error 017: undefined symbol "helpduty"

hmm


Re: How to add textdraw on player's head? - Quinncell - 27.07.2016

Where is the "adutyduty" and "helpduty" located at?