| Diversity |
06-30-2020 05:14 |
Re: Problem with explode_string
Quote:
Originally Posted by Bugsy
(Post 2707905)
Code looks fine and compiles for me on 1.9, where/how did you define the Query variable?
It must be: new Handle:Query, not an array.
|
PHP Code:
public loadData(FailState, Handle:Query, Error[], Errcode,Data[], DataSize) { if(FailState == TQUERY_CONNECT_FAILED) log_amx("Load - Could not connect to SQL database. [ %d ] %s", Errcode, Error) else if(FailState == TQUERY_QUERY_FAILED) log_amx("Load Query failed. [ %d ] %s", Errcode, Error) else if(Errcode) server_print("Error on query: %s", Error) else { if(SQL_NumResults(Query)) { new client = Data[0], skins[256], mySkins[512 + MAX_PLAYER_SKINS]
SQL_ReadResult(Query, 2, PlayerInfo[client][password2], 35)
PlayerInfo[client][sqlID] = SQL_ReadResult(Query, 0) PlayerInfo[client][points] = SQL_ReadResult(Query, 4) PlayerInfo[client][keys] = SQL_ReadResult(Query, 5) PlayerInfo[client][cases] = SQL_ReadResult(Query, 6) PlayerInfo[client][rank] = SQL_ReadResult(Query, 7) PlayerInfo[client][kills] = SQL_ReadResult(Query, 8) SQL_ReadResult(Query, 9, skins, charsmax(skins))
// xs_explode(skins, PlayerInfo[client][skins], '|', 512 + MAX_PLAYER_SKINS, 2) // ExplodeString(mySkins, 512 + MAX_PLAYER_SKINS, 10, skins, ',') // str_explode(skins, '|', mySkins, 512, 512)
explode_string(skins, "\", mySkins, 512 + MAX_PLAYER_SKINS, 10) // ExplodeString(skins, mySkins)
if(equal(PlayerInfo[client][password], PlayerInfo[client][password2], strlen(PlayerInfo[client][password2]))) { PlayerInfo[client][isLogged] = true
new query[100] formatex(query, charsmax(query), "UPDATE users SET islogged='1' WHERE name = '%s'", PlayerInfo[client][name]) SQL_ThreadQuery(g_Sql, "IgnoreHandle", query) showMainMenu(client) ColorChat(client, NORMAL, "^4[CSGO] ^1Te-ai logat cu succes.") } } }
SQL_FreeHandle(Query)
return true }
yes, is it Handle:Query, i get error on "explode_string(skins, "|", mySkins, 512 + MAX_PLAYER_SKINS, 256) " and idk why
edit:
solved... i haved a globaly variabile "skins"
|