Problem whit .dini save position - 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: Problem whit .dini save position (
/showthread.php?tid=139932)
Problem whit .dini save position -
DarkPower - 06.04.2010
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
Re: Problem whit .dini save position -
DarkPower - 07.04.2010
bump
Re: Problem whit .dini save position -
DarkPower - 07.04.2010
bump
Re: Problem whit .dini save position -
DarkPower - 07.04.2010
bump