I dont know guys it still does not work for me. I get somekind of the coordinates saved in the database, but their not having any decimals and look kind of strange. I tried changing the saving in database to decimal but it did not work. Im going to show you guys all of the script, sorry but im a noob in MySQL. So its basically a timer that gets players coordinates, and after a while it will get coordinates if their the same it will get a dialog out, if not then it will keep on going.
pawn Код:
public ZaidejuKord()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new vardas[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z;
GetPlayerName(i, vardas, sizeof(vardas));
if(prisijunges[i] == 1)
{
if(afkn[i] == 0)
{
new string[128];
GetPlayerPos(i, x, y, z);
format(string, sizeof(string), "UPDATE `Users` SET `afkX` = '%.2f', `afkY` = '%.2f', `afkZ` = '%.2f' WHERE `Name` = '%s'", x, y, z, vardas);
mysql_query(string);
afkn[i] = 1;
}
else if(afkn[i] == 1)
{
GetPlayerPos(i, x, y, z);
CheckMySQL();
new string[128];
format(string, sizeof(string), "SELECT * FROM Users WHERE Name = '%s', afkX = '%.2f', afkY = '%.2f', afkZ = '%.2f'", vardas, x, y, z);
mysql_query(string);
mysql_store_result();
if(!mysql_num_rows())
{
afkn[i] = 0;
}
else
{
ShowPlayerDialog(i,50,DIALOG_STYLE_MSGBOX,"{A3E4FF}AFK","{FFFFFF}Jus buvote {FFAF00}AFK{FFFFFF}, ar norite testi zaidima?","Taip","Ne");
AFK[i] = Create3DTextLabel("{C9FFAB}AFK", COLOR_GREEN,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(AFK[i], i, 0.0, 0.0, 0.3);
afkn[i] = 2;
}
new row[128];
new field[8][32];
mysql_fetch_row_format(row, "|");
explode(row, field, "|");
mysql_free_result();
}
else if(afkn[i] == 2)
{
}
}
}
}
Im guessing there are some problems with applying murtiple coordinates i dont know what to put , or AND. If you guys see the problem please help me. Thank you!