Problem with pos loading.
#1

I have a epic problem with pos loading. Then player disconnect his pos saves to mysql DB fine, but then player login, pos doesn't load. There is my code: if player write correct password then all of his stats loading ,but there I don't write it all stats only pos, because only it don't work:
Код:
        new vardas[128],query[256];
                  new Float:pos1,Float:pos2,Float:pos3;
        GetPlayerName(playerid,vardas,128);
        if(IsPlayerConnected(playerid))
        {
           MySQLCheck();
           if(mysql_num_rows() == 1)
           {
             format(query,sizeof(query),"SELECT PozicijaX FROM `"TABLENAME"` WHERE Vardas = '%s' AND Slaptazodis = md5('%s') LIMIT 1",vardas,inputtext);
             mysql_query(query);
             mysql_store_result();
             pos1 = mysql_fetch_int();
             mysql_free_result();
             format(query,sizeof(query),"SELECT PozicijaY FROM `"TABLENAME"` WHERE Vardas = '%s' AND Slaptazodis = md5('%s') LIMIT 1",vardas,inputtext);
             mysql_query(query);
             mysql_store_result();
             pos2 = mysql_fetch_int();
             mysql_free_result();
             format(query,sizeof(query),"SELECT PozicijaZ FROM `"TABLENAME"` WHERE Vardas = '%s' AND Slaptazodis = md5('%s') LIMIT 1",vardas,inputtext);
             mysql_query(query);
             mysql_store_result();
             pos3 = mysql_fetch_int();
             mysql_free_result();
             SetPlayerPos(playerid,pos1,pos2,pos3);
Everything allright and no errors here, because I don't write here all my code only important part . Please correct it to fine code which can load player pos
*Vardas = Name ; Slaptazodis = Password; Pozicija = Position; It is translate from my language.
Reply
#2

You aren't using SetPlayerPos to load it, you're just executing the query, it's like clicking on a file and closing it right away and doing nothing in it.
Reply
#3

But with money and xp and adminlevel I do it like with pos. And money and xp is loading for me. What I need to do correct this problem with pos loading?
Reply
#4

Poz its not Integer. Player position its float
Reply
#5

I know that but What I need to do
Reply
#6

Use
pawn Код:
mysql_fetch_float
Reply
#7

But how I need to use it?
Reply
#8

But how I need to use this function Please help anybody...
Reply
#9

mysql_fetch_int();
change:
mysql_fetch_float();
Reply
#10

I do it like this code:
Код:
				 PosY = mysql_fetch_float();
I defined it.... But there is error: number of arguments does not match definition...
What I need to do?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)