SQLite Problems
#1

Hello everyone, I reached a scripting level that involves SQLITE, more specific, an admin system with register/login included. Yesterday morning I started working at this script.
My problem is that Database is saving only the admin level, and not kills, deaths and all my player variables.As you can see, I am using rBits include, a very usefull one for arrays.
So, I hope anyone can help me.
Here is the script:
http://pastebin.com/7e5Fqhaw
Thank you, and I am waiting for answer.
Reply
#2

UP PLEASE !
Reply
#3

Where does it save the data?
In OnPlayerDisconnect, right?
Reply
#4

Yes, it does.
Код:
public OnPlayerDisconnect(playerid, reason)
{
    new
        Query[ 200 ], 
        name[ MAX_PLAYER_NAME ] 
    ;
    GetPlayerName(playerid, name, sizeof(name)); 

    if(Bit1_Get(g_PlayerLogged, playerid) == 1)
    {
        
        format(Query,sizeof(Query),"UPDATE `USERS` SET SCORE = '%d', CASH = '%d', ADMINLEVEL = '%d', KILLS = '%d', DEATHS = '%d', RESPECT = '%d', SKIN = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",
                                                                                        GetPlayerScore(playerid), 
                                                                                        GetPlayerMoney(playerid), 
                                                                                        Bit16_Get(g_AdminLevel, playerid),
                                                                                        Bit16_Get(g_Kills, playerid),
                                                                                        Bit16_Get(g_Deaths, playerid),
                                                                                        Bit16_Get(g_Respect, playerid),
                                                                                        GetPlayerSkin(playerid),
                                                                                        DB_Escape(name)); 
        db_query(Database, Query);
        Bit1_Set(g_PlayerLogged, playerid, false);
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by preda98
Посмотреть сообщение
As you can see, I am using rBits include, a very usefull one for arrays.
Everyone entitled to their own opinion, of course. But do you really expect money to never go over 65535?
Reply
#6

Not really...
Reply
#7

Give a try to this:
http://pastebin.com/mxGx2G7v

To be honest, I didn't find any mistake there, but I made some changes.
Reply
#8

Thank you, I will give it a try and then come back with EDIT.
EDIT: I tested, but now won't save anything, like account name or password..
I guess I will try fallowing other tutorials.
ON: Thanks for help anyway.
Reply
#9

Aaa.. By the way. Delete your old database file.
Forgot to say that.
Reply
#10

Did that, no succes..
So far fallowed this:
https://sampforum.blast.hk/showthread.php?tid=278188
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)