SA-MP Forums Archive
Help 3dText 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)
+--- Thread: Help 3dText Problem! (/showthread.php?tid=517567)



Help 3dText Problem! - KillerStrike23 - 05.06.2014

hello all I got a problem in this 3dtest

under onplayerspawn:

pawn Код:
//------------------------3D Text For the Owner ;)--------------------------
    new PlayerName[24], string[256], Float: px, Float: py, Float: pz;
    GetPlayerName(playerid, PlayerName, 24);
    if(strcmp(PlayerName, "[sF]StreetFighter", true)) {
        GetPlayerPos(playerid, px, py, pz);
        format(string, sizeof(string),"{00FF00}[sF]StreetFighter(%d) = Community Owner", playerid);
        STRING[playerid] = CreateDynamic3DTextLabel(string, -1, 0.0, 0.0, -0.8, 20, playerid, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
        Attach3DTextLabelToPlayer(STRING[playerid], playerid, 0.0, 0.0, 0.2);
        return 1;}
the problem is the text appears for all even if his name wasn't as the shown, and any ideas how to replace it with player name on the head of player?


Re: Help 3dText Problem! - biker122 - 05.06.2014

pawn Код:
new PlayerName[24], string[256], Float: px, Float: py, Float: pz;
      GetPlayerName(playerid, PlayerName, 24);
      if(!strcmp(PlayerName, "[sF]StreetFighter")) {
      GetPlayerPos(playerid, px, py, pz);
      format(string, sizeof(string),"{00FF00}[sF]StreetFighter(%d) = Community Owner", playerid);
      STRING[playerid] = CreateDynamic3DTextLabel(string, -1, 0.0, 0.0, -0.8, 20, playerid, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
      Attach3DTextLabelToPlayer(STRING[playerid], playerid, 0.0, 0.0, 0.2);
      return 1;}
Maybe this...?


Re: Help 3dText Problem! - VenomMancer - 05.06.2014

This will works

pawn Код:
//------------------------3D Text For the Owner ;)--------------------------
    new PlayerName[24], string[256], Float: px, Float: py, Float: pz;
    GetPlayerName(playerid, PlayerName, 24);
    if(strcmp(PlayerName, "[sF]StreetFighter", true)) {
        GetPlayerPos(playerid, px, py, pz);
        format(string, sizeof(string),"{00FF00}[sF]StreetFighter(%d) = Community Owner", playerid);
        STRING[playerid] = CreateDynamic3DTextLabel(string, -1, 0.0, 0.0, 0.2, 20, playerid, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
        return 1;}
Tell me if have prob


Re: Help 3dText Problem! - KillerStrike23 - 05.06.2014

ty both, both worked and thanks very very much. but guys anyone have an idea how to replace it with the name over player head I would be so thank full


Re: Help 3dText Problem! - CesarLT - 05.06.2014

Quote:
Originally Posted by KillerStrike23
Посмотреть сообщение
ty both, both worked and thanks very very much. but guys anyone have an idea how to replace it with the name over player head I would be so thank full
I think this may be helpfull for you. Enjoy.

https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer


Re: Help 3dText Problem! - James_Braga - 05.06.2014

Attach3DTextLabelToPlayer don't use in Dynamic3DTextLabel, it is only for Create3DTextLabel and CreatePlayer3DTextLabel...

PHP код:
native Text3D:CreateDynamic3DTextLabel(const text[], colorFloat:xFloat:yFloat:zFloat:drawdistanceattachedplayer INVALID_PLAYER_IDattachedvehicle INVALID_VEHICLE_IDtestlos 0worldid = -1interiorid = -1playerid = -1Float:streamdistance 100.0);