changeable 3dtext above a players head
#1

Im a bit stumped and i cant seem to find any posts to help me with what im looking for.

I was looking at the test_cmds.pwn file we get in the filterscripts folder as part of the server package and i was wondering about adding this particular code to my gamemode..

Код:
	if(strcmp(cmd, "/updateplayerlabel", true) == 0) {
	    UpdatePlayer3DTextLabelText(playerid, playertextid, 0xFFFFFFFF, "");
		return 1;
	}
Now, what im wondering is, when you type the above command, and say something after it for example.
"/updateplayerlabel testing" will it display "testing" or will it be blank?

If its going to be blank, what can i do to get it to actually show what the player types in after the command?

Any help would be appreciated greatly.
Reply
#2

pawn Код:
UpdatePlayer3DTextLabelText(playerid, playertextid, 0xFFFFFFFF, "");
Text is Here
pawn Код:
UpdatePlayer3DTextLabelText(playerid, playertextid, 0xFFFFFFFF, "Hello World!");
Thats not a chat, its function to display text

EDIT: what you need to do is:
pawn Код:
new Player3DText:Text[MAX_PLAYERS];

CreatePlayer3DLabel(...

//and than with

format(string,sizeof(string),"%s says: %s",Playername,text);
UpdatePlayer3DTextLabelText(playerid, Text[playerid], 0xFFFFFFFF,string);
I just move you to right deriction, rest learn by self.
Reply
#3

ok so heres what i tried..

Код:
	if(strcmp(cmd, "/label", true) == 0) {
        new tmp2[256];
		tmp2 = strtok(cmdtext,idx);
		new label;
		label =  Create3DTextLabel(strval(tmp2),COLOR_YELLOW,0,0,0,50,0);
		Attach3DTextLabelToPlayer(label,playerid,0,0,-0.1);
	    return 1;
	}
yet it wont compile. Can anyone please tell me what im doing wrong?
Reply
#4

pawn Код:
new tmp2[256];
        tmp2 = strtok(cmdtext,idx);
delete that, you don't need it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)