Cookies


Vsroplus only uses the cookies it needs to keep you signed in and remember your language. No ads, no tracking.

Got it

Need to learn more? Privacy policy

Our guides are in English for now.

Academy Form Request

Stored Procedure: _OnAcademyFormMatchAccept

Parameters:

  • @CharID INT - Academy master character ID
  • @CharName16 VARCHAR(64) - Target character name

In this example, we will block accepting an academy join request for a specific character and send a notification using _Char_SendTextNotification to make sure that the trigger works correctly.

USE [vPlus]
GO
/****** Object:  StoredProcedure [dbo].[_OnAcademyFormMatchAccept]    Script Date: 1/16/2024 7:45:44 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:      <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[_OnAcademyFormMatchAccept]
    @CharID INT, -- Academy master CharID
    @CharName16 VARCHAR(64) -- Accepted character name
AS
BEGIN
    SET NOCOUNT ON;

    /*
        This procedure is executed when an academy master tries to accept a guardian match form join request.

        @CharID = Academy master
        @CharName16 = Character to be accepted
    */

    --------- Your code starts here --------
    IF (@CharName16 = 'target_character_name')
    BEGIN
        EXEC _Char_SendTextNotification @CharID, 'This character is blocked from joining academy matching.', 1, 0, 0
        RETURN 0 -- Blocking the character from joining academy matching
    END

    RETURN 1
END

Last updated: 16 January, 2024

An error has occurred. This application may no longer respond until reloaded. Reload 🗙