Create account and Auto-create char

Results 1 to 3 of 3
  1. #1
    TruCore ES3N1N is offline
    MemberRank
    Nov 2018 Join Date
    UkraineLocation
    216Posts

    Post Create account and Auto-create char

    Hello World!

    I want to make a function so that when creating an Account, a character is auto created.
    I created a function, and a "Nickname" column in Accounts.
    https://pastebin.com/NHxXAtGJ

    this not work
    PHP Code:
    DECLARE @in_Gamertag nvarchar
        
    IF(@in_NickName = @in_Gamertag
    BEGIN
            SET 
    @in_NickName = @in_Gamertag
            UPDATE UsersChars SET Gamertag
    =@in_Gamertag WHERE CustomerID [MENTION=25895]Custom[/MENTION]erID
        END 
    this not work
    PHP Code:
    -- get new Char
        
    declare @in_Gamertag varchar
        SELECT 
    @in_NickName, [MENTION=25895]Custom[/MENTION]erID from UsersChars as Gamertag
        exec UsersChars set 
    @in_NickName=@in_Gamertag as CustomerID [MENTION=25895]Custom[/MENTION]erID 


  2. #2
    My Status --> LukasCCB is offline
    MemberRank
    Apr 2013 Join Date
    CracolandiaLocation
    1,190Posts
    Open function

    Code:
    WZ_ACCOUNT_CREATE
    Before return, add this

    Code:
    --Create first char
    DECLARE @MyCharName VARCHAR(128) = LEFT(@in_Email, 8); --Get 8 frist caracters of email to put on Char Name    
    exec FN_AddItemToUser @CustomerID, 20174, 2000 --Give Character to account    
    exec WZ_CharCreate @CustomerID, 0, @MyCharName, 20174, 0, 2, 2 --Create first character to account


    Be happy!
    Last edited by LukasCCB; 03-11-22 at 10:32 PM.

  3. #3
    TruCore ES3N1N is offline
    MemberRank
    Nov 2018 Join Date
    UkraineLocation
    216Posts
    Quote Originally Posted by LukasCCB View Post
    Open function

    Code:
    WZ_ACCOUNT_CREATE
    Before return, add this

    Code:
    --Create first char
    DECLARE @MyCharName VARCHAR(128) = LEFT(@in_Email, 8); --Get 8 frist caracters of email to put on Char Name    
    exec FN_AddItemToUser @CustomerID, 20174, 2000 --Give Character to account    
    exec WZ_CharCreate @CustomerID, 0, @MyCharName, 20174, 0, 2, 2 --Create first character to account


    Be happy!
    this is wonderful! I love you brother!



Advertisement