Raised This Month: $ Target: $400
 0% 

Problem with explode_string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Diversity
AlliedModders Donor
Join Date: Jan 2018
Location: Constanta, Romania
Old 06-30-2020 , 05:14   Re: Problem with explode_string
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
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(FailStateHandle:QueryError[], Errcode,Data[], DataSize) {
    if(
FailState == TQUERY_CONNECT_FAILEDlog_amx("Load - Could not connect to SQL database. [ %d ] %s"ErrcodeError)
    else if(
FailState == TQUERY_QUERY_FAILEDlog_amx("Load Query failed. [ %d ] %s"ErrcodeError
    else if(
Errcodeserver_print("Error on query: %s"Error
    else { 
        if(
SQL_NumResults(Query)) {
            new 
                
client Data[0],
                
skins[256], 
                
mySkins[512 MAX_PLAYER_SKINS]

            
SQL_ReadResult(Query2PlayerInfo[client][password2], 35

            
PlayerInfo[client][sqlID] = SQL_ReadResult(Query0)
            
PlayerInfo[client][points] = SQL_ReadResult(Query4)
            
PlayerInfo[client][keys] = SQL_ReadResult(Query5)
            
PlayerInfo[client][cases] = SQL_ReadResult(Query6)
            
PlayerInfo[client][rank] = SQL_ReadResult(Query7)
            
PlayerInfo[client][kills] = SQL_ReadResult(Query8
 
            
SQL_ReadResult(Query9skinscharsmax(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"

Last edited by Diversity; 06-30-2020 at 05:24.
Diversity is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode