Create3dtextlabel
#1

hey guys i wanna make a 3d text label that it shows above the player but it has to say what he types in say i typed

/Label the killer.

i want the label to say above the player The Killer here is my code but i have no idea how to do this

Код:
		if(strcmp(cmdtext,"/label",true) == 0)
		{
                    new PlayerText3D:playertextid;
		    new Float:X, Float:Y, Float:Z;
		    GetPlayerPos( playerid, X, Y, Z );
		    playertextid = CreatePlayer3DTextLabel(playerid,"%s",0x008080FF,X,Y,Z,40.0);
		    return 1;
                }
Can Someone help meeee
Reply
#2

try
pawn Код:
if(strcmp(cmdtext,"/label",true) == 0)
  {
                    new PlayerText3D:playertextid;
      new Float:X, Float:Y, Float:Z;
      GetPlayerPos( playerid, X, Y, Z );
      playertextid = CreatePlayer3DTextLabel(playerid,cmdtext[6],0x008080FF,X,Y,Z,40.0);
      return 1;
                }
Reply
#3

Код:
 

symbol is assigned a value that is never used: "playertextid"
Reply
#4

switch to zcmd and sccanf ^^
did you want that i make it 4 you in zcmd+sscanf?
Reply
#5

i have Sccanf but i just cant use Zcmd i have to many commands in my gamemode that will need changing
Reply
#6

pawn Код:
if(strcmp(cmdtext,"/label",true) == 0)
{
    new string[128], tmp[128], idx;
    new PlayerText3D:playertextid;
    new Float:X, Float:Y, Float:Z;

    GetPlayerPos( playerid, X, Y, Z );
    tmp = strtok(cmdtext, idx);

    format(string,128,"%s",tmp);
    playertextid = CreatePlayer3DTextLabel(playerid,string,0x008080FF,X,Y,Z,40.0);

    return 1;
}
Try that ^

I agree with tiger, you should use zcmd, dcmd or some other command processor D:
Reply
#7

Код:
C:\DOCUME~1\Rhys\Desktop\GTASAC~1\SAMP03~1\GAMEMO~1\Carr.PWN(233) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\DOCUME~1\Rhys\Desktop\GTASAC~1\SAMP03~1\GAMEMO~1\Carr.PWN(238) : error 047: array sizes do not match, or destination array is too small
C:\DOCUME~1\Rhys\Desktop\GTASAC~1\SAMP03~1\GAMEMO~1\Carr.PWN(241) : warning 204: symbol is assigned a value that is never used: "playertextid"
Reply
#8

lol otto your code cant work because 1 parameter are not given

playerid is the label but in the func is forplayeid not given

wait i search link ^^
Reply
#9

What line is 238 ? I'm guessing the error is tmp[128] lol, but tell the line please.
Reply
#10

Код:

		    tmp = strtok(cmdtext, idx);

		    format(string,128,"%s",tmp);
		    playertextid = CreatePlayer3DTextLabel(playerid,string,0x008080FF,X,Y,Z,40.0);
there the lines are tmp and playertextid
Reply
#11

1 parameter is missing
look the symtex here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)