SA-MP Forums Archive
Create3dtextlabel - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Create3dtextlabel (/showthread.php?tid=276210)



Create3dtextlabel - Zonoya - 12.08.2011

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


Re: Create3dtextlabel - Tigerkiller - 12.08.2011

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;
                }



Re: Create3dtextlabel - Zonoya - 12.08.2011

Код:
 

symbol is assigned a value that is never used: "playertextid"



Re: Create3dtextlabel - Tigerkiller - 12.08.2011

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


Re: Create3dtextlabel - Zonoya - 12.08.2011

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


Re: Create3dtextlabel - grand.Theft.Otto - 12.08.2011

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:


Re: Create3dtextlabel - Zonoya - 12.08.2011

Код:
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"



Re: Create3dtextlabel - Tigerkiller - 12.08.2011

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 ^^


Re: Create3dtextlabel - grand.Theft.Otto - 12.08.2011

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


Re: Create3dtextlabel - Zonoya - 12.08.2011

Код:

		    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


Re: Create3dtextlabel - Tigerkiller - 12.08.2011

1 parameter is missing
look the symtex here