AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Same Save (https://forums.alliedmods.net/showthread.php?t=215878)

ironskillz1 05-13-2013 12:45

Same Save
 
Im trying todo the exact same save in SQL
but it will not work..
Sql Save
Code:

public MySQL_Save(const id) {
 new szBugName[32], szName[32];
 get_user_name(id, szBugName, charsmax(szBugName))
 MakeStringSQLSafe(szBugName, szName, charsmax(szName))
 
 new szAuthid[32]
 get_user_authid(id, szAuthid, charsmax(szAuthid))
 
 static szData[256]
 new iLen
 
 for(new i = 0; i < MAX_SKINS; i++)
 iLen += formatex(szData[iLen], sizeof(szData) - iLen - 1, "%i ", g_bBoughtSkin[id][i])
 
 formatex(MySQL_Query, charsmax(MySQL_Query), "UPDATE `Points_Shop` SET `name` = '%s', `points` = '%i', `totalpoints` = '%i', `jumps` = '%i', `knife` = '%d', `player` = '%d', `boughtknifes` = '%s' WHERE `steamid`='%s'", szName, gKillerPoints[id], gTotalKillerPoints[id], vJump[id], knife_model[id], player_model[id], szData, szAuthid)
 SQL_ThreadQuery(MySQL_Tuple, "SQL_TrashHandler", MySQL_Query)
}

Vault Save
Code:

public SaveData( id )
{
    new szData[ 64 ], szKey[ 32 ];
    get_user_authid( id, szKey, charsmax( szKey ) );
    format( szKey, charsmax( szKey ), "%s-BOUGHTSKINS", szKey );
   
    for( new i ; i < MAX_SKINS ; i ++ )
        if( g_bBoughtSkin[ id ][ i ] )
            format( szData, charsmax( szData ), "%s%i-", szData, i );
   
    set_vaultdata( szKey, szData );
}


Bugsy 05-13-2013 12:50

Re: Same Save
 
Are you re-writing the code from SQL to Vault or vice versa? They both definitely do not do the same thing.

ironskillz1 05-13-2013 12:53

Re: Same Save
 
Quote:

Originally Posted by Bugsy (Post 1951225)
Are you re-writing the code from SQL to Vault or vice versa? They both definitely do not do the same thing.


The Vault code is working
Im trying to make so the SQL works the same way
but im new with SQL


All times are GMT -4. The time now is 16:24.

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