AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with explode_string (https://forums.alliedmods.net/showthread.php?t=325612)

Diversity 06-29-2020 11:10

Problem with explode_string
 
Hello guys, i get this error: argument type mismatch (argument 1)

PHP Code:

new skins[256], 
mySkins[512 MAX_PLAYER_SKINS][10]

SQL_ReadResult(Query9skinscharsmax(skins))

explode_string(skins"|"mySkins512 MAX_PLAYER_SKINS256

and i dont know why, i want to make explode |

Bugsy 06-29-2020 20:55

Re: Problem with explode_string
 
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.

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(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"


All times are GMT -4. The time now is 17:10.

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