07.05.2014, 19:43
Hello,
I'm turning my script into SQL.
But I have a problem.
When I finish the tutorial for present my server, I have the Tutorial variable set as 1.
When I disconnect, the variable is set to 1 on phpmyadmin.
But, when i'm reconnect, this is turn to 0 ...
There is the Debug log
And the line who take the value:
OnPlayerUpdateSQL:
I don't know why...
Regards
I'm turning my script into SQL.
But I have a problem.
When I finish the tutorial for present my server, I have the Tutorial variable set as 1.
When I disconnect, the variable is set to 1 on phpmyadmin.
But, when i'm reconnect, this is turn to 0 ...
There is the Debug log
Код:
[21:54:05] >> mysql_fetch_field_row( Connection handle: 1 ) [21:54:05] CMySQLHandler::FetchField("Tutorial") -
OnPlayerUpdateSQL:
Код:
MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Tutorial", PlayerInfo[playerid][pTut]); public MySQLUpdatePlayerInt(query[], sqlplayerid, sqlvalname[], sqlupdateint) // by Luk0r { MySQLUpdateBuild(query, sqlplayerid); new updval[64]; format(updval, sizeof(updval), "%s=%d", sqlvalname, sqlupdateint); strcat(query, updval, MAX_STRING); return 1; }
Код:
MySQLCheckConnection(); new tmp2[256]; new string2[64]; new playername2[MAX_PLAYER_NAME]; new playernamesplit[3][MAX_PLAYER_NAME]; GetPlayerName(playerid, playername2, sizeof(playername2)); split(playername2, playernamesplit, '_'); MySQLFetchAcctSingle(PlayerInfo[playerid][pSQLID], "Password", PlayerInfo[playerid][pKey]); format(tmp2, sizeof(tmp2), "SELECT * FROM players WHERE id = %d LIMIT 1", PlayerInfo[playerid][pSQLID]); mysql_query(tmp2); mysql_store_result(); if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 ) { .. mysql_get_field("Tutorial",Field); PlayerInfo[playerid][pTut] = strval(Field); ..
Regards