Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Daily Credits System

Status
Not open for further replies.
Joined
Jun 12, 2010
Messages
133
Reaction score
1
Nice release, but check if already released before you post

I did check before I posted! But after, I posted I found it.


---------- Post added at 10:19 PM ---------- Previous post was at 10:18 PM ----------

where have to i put in this code :

Code:
#region User coins daily system!
            string now = DateTime.Today.ToString();
            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
            {
                int usercredits = dbClient.getInt("SELECT userid FROM user_dailycoins WHERE userid = '" + userID + "' AND date = '" + now + "'");
                int userCoins = 500;
                int staffShare = 1000;
                if (usercredits == 0 && _Rank < 2)
                {
                    dbClient.runQuery("INSERT INTO user_dailycoins (userid, date) VALUES ('" + userID + "','" + now + "')");
                    dbClient.runQuery("UPDATE users SET credits = credits + '" + userCoins + "' WHERE id = '" + userID + "'");
                    sendData("BK" + "You have just received " + userCoins + " coins from the daily system!");
                    refreshValueables(true, false);
                }
                else
                {
                    if (usercredits == 0 && _Rank == 3)
                    {
                        dbClient.runQuery("INSERT INTO user_dailycoins (userid, date) VALUES ('" + userID + "','" + now + "')");
                        dbClient.runQuery("UPDATE users SET credits = credits + '" + staffShare + "' WHERE id = '" + userID + "'");
                        sendData("BK" + "You have just received " + staffShare + " coins from the daily system!");
                        refreshValueables(true, false);
                    }
                }
            }
            #endregion

This is a Release not a tut! Lol. Put it in your logging case! Above or below. don't matter. I tested and worked fine.
 
Last edited:
Junior Spellweaver
Joined
Aug 6, 2008
Messages
148
Reaction score
48
I can't really see the code well. (I'm on my iPhone)
But I'm pretty sure if it's a normal r26 daily credits system
You would need to put it in virtualUser.cs

In packet "@H"

Search for case "@H"
 
Custom Title Activated
Loyal Member
Joined
Jan 25, 2009
Messages
1,539
Reaction score
4
where have to i put in this code :

Code:
#region User coins daily system!
            string now = DateTime.Today.ToString();
            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
            {
                int usercredits = dbClient.getInt("SELECT userid FROM user_dailycoins WHERE userid = '" + userID + "' AND date = '" + now + "'");
                int userCoins = 500;
                int staffShare = 1000;
                if (usercredits == 0 && _Rank < 2)
                {
                    dbClient.runQuery("INSERT INTO user_dailycoins (userid, date) VALUES ('" + userID + "','" + now + "')");
                    dbClient.runQuery("UPDATE users SET credits = credits + '" + userCoins + "' WHERE id = '" + userID + "'");
                    sendData("BK" + "You have just received " + userCoins + " coins from the daily system!");
                    refreshValueables(true, false);
                }
                else
                {
                    if (usercredits == 0 && _Rank == 3)
                    {
                        dbClient.runQuery("INSERT INTO user_dailycoins (userid, date) VALUES ('" + userID + "','" + now + "')");
                        dbClient.runQuery("UPDATE users SET credits = credits + '" + staffShare + "' WHERE id = '" + userID + "'");
                        sendData("BK" + "You have just received " + staffShare + " coins from the daily system!");
                        refreshValueables(true, false);
                    }
                }
            }
            #endregion


in Source>>Users>>Virtualuser.cs ^^
 
Status
Not open for further replies.
Back
Top