Add amount of gold to player

Asked

Viewed 546 times

1

I have a server of [ Mu Online ] Ex 802 , and it has a { SHOP CASH } system so players can buy their items. Well my Server has a control panel in which I can add the amount of currency that the Player will have , plus this system is in C#.

The Shop Cash game uses 1 table to connect with sql:

     - Tabela " GameShop_Data"
     - Colunas " MemberGuid , WCoinC , WCoinP , WCoinG" 

He does this check: When he enters the game, and opens the Shop Cash, there is a field called : { Amount of Golds: VALUE } - Basically the check to know qts Golds has it does the following: IT SEARCH IN SQL a TABLE "Gameshop_data" ( how the user connected to his account he already has member_guid ) so he searches in the table the Memberguid field of the connected user and it has the column " Wcoinc " ( being the main currency ) and see the amount of Golds in this column and show in the GAME the amount you checked in SQL.

  • The columns starting with W are the currency types you have in the GAME.

  • The Memberguid column is like a kind of organization " id " .

However the Server has a site where there are 3 types of control panel:

  • User Control Panel
  • Game Master Control Panel
  • Administrator Control Panel

  • In the control panel of { administrator } you have the option to add the amount of currency , in it there are two types of coins.

  • To add you need basically three fields { login , currency name ( SELECT being two ) , quantity }.

More if I put only the login as identification , will not work.

For the simple reason:

INSERT INTO "Gameshop_data" ("username","Wcoinc", ...) VALUES ("user typed in input", "VALUE typed in input",);

If you run this code, a random " id " will appear in the database.

An example: If the user I want to put gold , has a number id 25 , more in the table there are 3 users placed , ie let’s assume that these three I put the ' Golds ' through the panel that I quoted there above first made in C#.

[ Memberguid ] | [ Wcoinc ] | [Wcoinp] | [Wcoinp]

 "1"                  "500"            "NULL"           "NULL"
 "2"                  "500"            "NULL"           "NULL"
 "3"                  "500"            "NULL"           "NULL"

" SCRIPT EXECUTED BY THE C# PANEL IS WORKING CORRECTLY "

More if I run the above script with specific data on the basis that that user I typed in the WEB SITE Control Panel input field the id is"6 "

INSERT INTO "Gameshop_data" ("username","Wcoinc",) VALUES ("mauricio1", "1000",);

THE TABLE WOULD LOOK LIKE THIS:

[ Memberguid ] | [ Wcoinc ] | [Wcoinp] | [Wcoinp] | [username]

  "1"              "500"           "NULL"         "NULL"       "NULL"
  "2"              "500"           "NULL"         "NULL"       "NULL"
  "3"              "500"           "NULL"         "NULL"       "NULL"
  "4"              "1000"          "NULL"         "NULL"       "mauricio1"

That is: he created a random Memberguid by itself dealing with an " int " with Primary key ( and did not put the " id 6" that in the game would identify the 'Golds' of the logged in account ).

Well I would like to know which script should I use to do this check correctly and so be able to add the Golds to the players through the WEBSITE Control Panel.

  • Remember that the login id of each account is in the table " MEMB_INFO " as in the second image of the publication.

TABELA GameShop_Data

TABELA MEMB_INFO

  • Because the bank should have saved the id 6 if you didn’t put it anywhere. I believe, if I understood the question, that your query would look like this: INSERT INTO "GameShop_Data" ("MemberGuid","username","WCoinC",) VALUES (6, "mauricio1", "1000");. Another thing, try to simplify your question, leave only what you need to understand the problem and you will have more people trying to help you.

  • Hello Oeslei. Thank you for your reply. Well let’s go, if I execute this query you mentioned above would create an id having as sequence the previous: Because at this time in the table " Gameshop_cash " there are 3 edited accounts with Golds ' placed from the panel made in C# 'ie, if I ran this SCRIPT above, I would create the next ID ' which would be 4 ' and not the correct '6' id of the account , in which the game checks.

  • 1

    Oeslei has a point. You can minimize your question a lot, besides increasing the chances of an accurate answer, it would facilitate understanding and speed up the whole thing. Tries to remove what is not essential to the subject.

  • @Junior managed to solve his problem?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.