[Tutorial] Add GamePoints and Item by GamerTag/Email

Results 1 to 1 of 1
  1. #1
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    [Tutorial] Add GamePoints and Item by GamerTag/Email



    Basic useful querys I did a few years ago to add gamepoint and items to the user via email or gamertag.

    Add GamePoints by GamerTag

    Spoiler:
    PHP Code:
    declare @in_CustomerID int;
    declare @
    in_Gamertag nvarchar(64);
    declare @
    in_GamePoints int;

    SET @in_Gamertag 'Yuri-BR'; -- Gamertag
    SET 
    @in_GamePoints 1000;    -- GamePoints

    SELECT 
    @in_CustomerID CustomerID FROM UsersChars WHERE Gamertag = @in_Gamertag;
    UPDATE UsersData SET GamePoints = (GamePoints + @in_GamePointsWHERE CustomerID = @in_CustomerID

    Add GamePoints by Email

    Spoiler:
    PHP Code:
    declare @in_CustomerID int;
    declare @
    in_Email varchar(128);
    declare @
    in_GamePoints int;

    SET @in_Email 'Yuri-BR@email.com'; -- Email
    SET 
    @in_GamePoints 1000;           -- GamePoints

    SELECT 
    @in_CustomerID CustomerID FROM Accounts WHERE email = @in_Email;
    UPDATE UsersData SET GamePoints = (GamePoints + @in_GamePointsWHERE CustomerID = @in_CustomerID

    Add Item by GamerTag

    Spoiler:
    PHP Code:
    declare @in_CustomerID int;
    declare @
    in_Gamertag nvarchar(64); 
    declare @
    in_ItemID int;
    declare @
    in_Quantity int;

    SET @in_Gamertag 'Yuri-BR'; -- Gamertag
    SET 
    @in_ItemID 101088;      -- ItemID
    SET 
    @in_Quantity 5;         -- Quantity

    SELECT 
    @in_CustomerID CustomerID FROM UsersChars WHERE Gamertag = @in_Gamertag;

    INSERT INTO UsersInventory (CustomerIDCharIDBackpackSlotItemIDLeasedUntilQuantityVar1Var2Var3
    VALUES (@in_CustomerID00, @in_ItemIDGETDATE(), @in_Quantity, -1, -110000); 

    Add Item by Email

    Spoiler:
    PHP Code:
    declare @in_CustomerID int;
    declare @
    in_Email varchar(128); 
    declare @
    in_ItemID int;
    declare @
    in_Quantity int;

    SET @in_Email 'Yuri-BR@email.com'; -- Email
    SET 
    @in_ItemID 101088;             -- ItemID
    SET 
    @in_Quantity 5;                -- Quantity

    SELECT 
    @in_CustomerID CustomerID FROM Accounts WHERE email = @in_Email;

    INSERT INTO UsersInventory (CustomerIDCharIDBackpackSlotItemIDLeasedUntilQuantityVar1Var2Var3
    VALUES (@in_CustomerID00, @in_ItemIDGETDATE(), @in_Quantity, -1, -110000); 
    Last edited by Yuri-BR; 13-07-19 at 07:07 PM.




Advertisement