SA-MP Forums Archive
[HELP] mysql offline chech player - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] mysql offline chech player (/showthread.php?tid=501516)



[HELP] mysql offline chech player - Luca12 - 18.03.2014

So in command offprison I have check for example if I type some none existing account then it says that there's no player with that name which is fine but when I check existing player I mean when I wanna get offprison someone player who is name in database it's again says that account doesn't exist but that acc is in database so this is that check:


pawn Код:
cache_get_data(rows,fields,mysql);
        if(!rows)
        {
            SCMF(playerid,0xDB023EFF,"G-Protect:No sucess! Account %s doens't exist in our database!",name);
            return 1;
        }

and one more question it's not related with this one how can I check someone player offline data for example lvl or money and his last activity on server ? thanks


Re: [HELP] mysql offline chech player - Jimmy0wns - 18.03.2014

We probably don't use the same MySQL plugin, but try taking a look at this:
pawn Код:
format(Query, 500, "SELECT `nick` FROM `playerdata` WHERE `nick` COLLATE latin1_general_cs = '%s' LIMIT 1", pInfo[playerid][Nick]); // here we are selecting the name of the player who logged in from the database.
            mysql_query(Query); // we query the statement above
            mysql_store_result(); // next we store the result inorder for it to be used further ahead.
            if(mysql_num_rows() > 0) // if the  database has more then one table with the given name
            {
                               // dialog for logging in
            }



Re: [HELP] mysql offline chech player - Luca12 - 18.03.2014

I use r38 plugin and cache