Help 3dText Problem!
#1

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?
Reply
#2

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...?
Reply
#3

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
Reply
#4

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
Reply
#5

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
Reply
#6

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); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)