25.05.2011, 20:08
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:
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 ![Smiley](images/smilies/smile.png)
*Vardas = Name ; Slaptazodis = Password; Pozicija = Position; It is translate from my language.
Код:
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);
![Cheesy](images/smilies/biggrin.png)
![Smiley](images/smilies/smile.png)
*Vardas = Name ; Slaptazodis = Password; Pozicija = Position; It is translate from my language.
![Cheesy](images/smilies/biggrin.png)