Problem whit .dini save position
#1

Hi guys i have one problem...I use aHouse system from Antronix and i finaly make when player buy house to be text in front of house who is owner....And i have one little problem....

so when player buy house i make to show Text

pawn Код:
new Float:X, Float:Y, Float:Z;
  GetPlayerPos( playerid, X, Y, Z );
  new
  string[128],
  name2[MAX_PLAYER_NAME];
  GetPlayerName(playerid,name2,MAX_PLAYER_NAME);
  format(string,sizeof string,"[House]\nOwner: %s",name2);
  label[playerid] = Create3DTextLabel(string,0x37FF00FF,X,Y,Z,10.0,0);
And if i leave the game text wont show again when i come on server....So i try to make text saver....Something like this

pawn Код:
GetPlayerPos(playerid, sx,sy,sz);
    dini_FloatSet(str1, "Text1", sx);
    dini_FloatSet(str1, "Text2", sy);
    dini_FloatSet(str1, "Text3", sz);
    dini_IntSet(str1, "TextInit", GetPlayerInterior(playerid));
And i make timer who will check...
pawn Код:
SetTimer("textovi", 500,1);
pawn Код:
forward textovi(playerid);
public textovi(playerid)
{
    new str1[256],pname[24],str[256];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(str1, sizeof(str1), "Houses/Users/%s", udb_encode(pname));
    if (dini_Exists(str1))
    {
        if(dini_Int(str1,"Houseid")!=-255)
        {
            new Float:x,Float:y,Float:z;
            str = dini_Get(str1,"TextInit");
            SetPlayerInterior(playerid, strval(str));
            playerinterior[playerid] = strval(str);
        x = dini_Float(str1,"Text1");
            y = dini_Float(str1,"Text2");
            z = dini_Float(str1,"Text3");
            new Float:X, Float:Y, Float:Z;
      GetPlayerPos( playerid, X, Y, Z );
      new
      string[128],
      name2[MAX_PLAYER_NAME];
      GetPlayerName(playerid,name2,MAX_PLAYER_NAME);
      format(string,sizeof string,"[House]\nOwner: %s",name2);
      label[playerid] = Create3DTextLabel(string,0x37FF00FF,x,y,z,10.0,0);
            //SetPlayerPos(playerid, x, y, z);
        }
    }
    return 1;
}
And when i buy house and come on server text is there so it save...But when TWO players buy house and when we leave the game i see text just from ONE player....Its save just cordinates from one player....Can someone help me
Reply
#2

bump
Reply
#3

bump
Reply
#4

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)