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 Invite Request

Stored Procedure: _OnAcademyInviteRequest

Parameters:

  • @CharID INT - Inviter character ID
  • @TargetCharName VARCHAR(64) - Target character name

In this example, we will block sending an academy invitation to a specific character and send a notification to the inviter using _Char_SendTextNotification to make sure that the trigger works correctly.

USE [vPlus]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[_OnAcademyInviteRequest]
    @CharID INT,
    @TargetCharName VARCHAR(64)
AS
BEGIN
    SET NOCOUNT ON;

    /*
        This procedure is executed when a player sends an academy invitation request.

        @CharID = Inviter character
        @TargetCharName = Target character
    */

    --------- Your code starts here --------
    IF (@TargetCharName = 'target_character_name')
    BEGIN
        EXEC _Char_SendTextNotification @CharID, 'This character cannot be invited to the academy.', 1, 0, 0
        RETURN 0 -- Block invitation
    END

    RETURN 1
END

Last updated: 16 January, 2024

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