SA-MP Forums Archive
Attach3dTEXT problem - 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: Attach3dTEXT problem (/showthread.php?tid=230010)



Attach3dTEXT problem - Jordman248 - 22.02.2011

Having trouble attaching 3D TEXT to a player.

Quote:

new Text3Dlayertextid[MAX_PLAYERS];

Quote:

command(playerlabel, playerid, params[])
{
#pragma unused params

new Float:X, Float:Y, Float:Z;
if(Player[playerid][AdminLevel] >= 4)
{
GetPlayerPos(playerid, X, Y, Z);
playertextid[playerid] = CreatePlayer3DTextLabel(playerid, "a", WHITE, X, Y, Z, 40.0); // problem here
Attach3DTextLabelToPlayer(playertextid[playerid], playerid, 0.0, 0.0, 0.7);
}
return 1;
}

Quote:

(18264) : warning 213: tag mismatch




Re: Attach3dTEXT problem - Elviss - 22.02.2011

pawn Код:
command(playerlabel, playerid, params[])
{
#pragma unused params

new PlayerText3D:playertextid;
new Float:X, Float:Y, Float:Z;

if(Player[playerid][AdminLevel] >= 4)
{
     GetPlayerPos(playerid, X, Y, Z);
     playertextid = CreatePlayer3DTextLabel(playerid, "a", WHITE, X, Y, Z, 40.0);
     Attach3DTextLabelToPlayer(playertextid[playerid], playerid, 0.0, 0.0, 0.7);
}



Re: Attach3dTEXT problem - Jordman248 - 22.02.2011

Not working mate.

I get

Quote:

C:\Users\ant\Desktop\sampsmallproject\gamemodes\Vo rtexRoleplay.pwn(18267) : error 028: invalid subscript (not an array or too many subscripts): "playertextid"
C:\Users\ant\Desktop\sampsmallproject\gamemodes\Vo rtexRoleplay.pwn(18267) : warning 215: expression has no effect
C:\Users\ant\Desktop\sampsmallproject\gamemodes\Vo rtexRoleplay.pwn(18267) : error 001: expected token: ";", but found "]"
C:\Users\ant\Desktop\sampsmallproject\gamemodes\Vo rtexRoleplay.pwn(18267) : error 029: invalid expression, assumed zero
C:\Users\ant\Desktop\sampsmallproject\gamemodes\Vo rtexRoleplay.pwn(18267) : fatal error 107: too many error messages on one line
that's all on

Attach3DTextLabelToPlayer(playertextid[playerid], playerid, 0.0, 0.0, 0.7);

I'd probably be able to figure this out on my own however my house is hectic right now and I can't think straight. :S


Re: Attach3dTEXT problem - Elviss - 22.02.2011

pawn Код:
Attach3DTextLabelToPlayer(playertextid, playerid, 0.0, 0.0, 0.7);



Re: Attach3dTEXT problem - Jordman248 - 22.02.2011

No now I get "TAG MISMATCH" on Attach3DTextLabelToPlayer

Sorry.

The only

Quote:

new PlayerText3Dlayertextid;
All I should have is that right? Non at the top of my script or anything?


Re: Attach3dTEXT problem - Jordman248 - 22.02.2011

bump


Re: Attach3dTEXT problem - Elviss - 23.02.2011

delete this
new Text3Dlayertextid[MAX_PLAYERS];


Re: Attach3dTEXT problem - Elviss - 23.02.2011

okei try this
pawn Код:
command(playerlabel, playerid, params[])
{

new Text3D:label[MAX_PLAYERS];
new Float:X, Float:Y, Float:Z;

if(Player[playerid][AdminLevel] >= 4)
{
     GetPlayerPos(playerid, X, Y, Z);
     label[playerid] = Create3DTextLabel(playerid, "a", WHITE, X, Y, Z, 40.0);
     Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
     return 1;
}



Re: Attach3dTEXT problem - HyperZ - 23.02.2011

pawn Код:
command(playerlabel, playerid, params[])
{
    new Text3D:label[MAX_PLAYERS], Float:X, Float:Y, Float:Z;
    if(Player[playerid][AdminLevel] >= 4) return 0;
    GetPlayerPos(playerid, X, Y, Z);
    label[playerid] = Create3DTextLabel("a",WHITE,X, Y, Z,40.0,0);
    Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
    return 1;
}
@Elviss you missed up something.


Re: Attach3dTEXT problem - MadeMan - 23.02.2011

Just change Text3D to PlayerText3D

pawn Код:
new PlayerText3D:playertextid[MAX_PLAYERS];