AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] SQLx (https://forums.alliedmods.net/showthread.php?t=196683)

quark 09-24-2012 07:21

[Help] SQLx
 
PHP Code:

public Load_Status(id)
{
    new 
szSteamId[32], szTemp[512]
    
get_user_authid(idszSteamIdcharsmax(szSteamId))
    
    new 
Data[1]
    
Data[0] = id
    
    format
(szTemp,charsmax(szTemp),"SELECT nick, skill FROM %s WHERE steamID = '%s'",Table,szSteamId)
    
SQL_ThreadQuery(g_SqlTuple,"Load_Status2",szTemp,Data,1)
}

public 
Load_Status2(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
{
    if(
FailState == TQUERY_CONNECT_FAILED)
    {
        
log_amx("Load - Could not connect to SQL database.  [%d] %s"ErrcodeError)
    }
    else if(
FailState == TQUERY_QUERY_FAILED)
    {
        
log_amx("Load Query failed. [%d] %s"ErrcodeError)
    }
    
    new 
id
    id 
Data[0]
    
    if(
SQL_NumResults(Query) < 1
    {
       
// some code here
    

    else 
    {
        
SQL_ReadResult(Query0nick[id], 32)
        
SQL_ReadResult(Query1Skill[id], 32)        
    }
    
    return 
PLUGIN_HANDLED


Player1- quark
Player2- Player

So, this is loading the nickname currectly, but if 2 players enter the server, it says that the first player is quark, but when the second player enter, it says that the second player name is Player, and the first player is qPlayer.

All help are welcome :)


All times are GMT -4. The time now is 08:14.

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