Send an item to all online players

Results 1 to 2 of 2
  1. #1
    Apprentice xROSSx is offline
    MemberRank
    Nov 2019 Join Date
    13Posts

    ! Send an item to all online players

    Hello, how do I send an item to all players that are online?

    Is there any Querry or CabalTools?


    Thanks in advance!


  2. #2
    Apprentice 3310 is offline
    MemberRank
    Jul 2015 Join Date
    122.155.177.0Location
    18Posts

    Re: Send an item to all online players

    Script executor
    USE [Server01]
    GO
    /****** Object: StoredProcedure [dbo].[cabal_tool_giveitemtoall] Script Date: 08/25/2013 15:39:06 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO


    -- Author: mrmagoo (Chumpy)
    -- Purpose: Give an item to all accounts, or all online accounts only

    ALTER PROCEDURE [dbo].[cabal_tool_giveitemtoall]
    (
    @itemidx int,
    @itemopt int,
    @durationidx int,
    @onlineonly int = 1 -- 0 = all accounts, 1 = online only
    )
    AS
    begin
    DECLARE @UserNum int, @IsOnline int, @ServerIdx int
    SET @serveridx=server01.dbo.GetServerIdx()
    DECLARE CURSOR_ACCOUNTS CURSOR FOR
    SELECT UserNum,[Login]
    FROM account.dbo.cabal_auth_table

    OPEN CURSOR_ACCOUNTS
    FETCH NEXT FROM CURSOR_ACCOUNTS
    INTO @UserNum,@IsOnline
    WHILE @@FETCH_STATUS = 0
    BEGIN
    IF (@onlineonly = 1)
    BEGIN
    IF (@IsOnline = 1)
    INSERT INTO cabalcash.dbo.MyCashItem( UserNum, TranNo, ServerIdx, ItemKindIdx, ItemOpt, DurationIdx )
    VALUES (@UserNum, '1', @serveridx,@itemidx,@itemopt,@durationidx )
    END
    ELSE
    INSERT INTO cabalcash.dbo.MyCashItem( UserNum, TranNo, ServerIdx, ItemKindIdx, ItemOpt, DurationIdx )
    VALUES (@UserNum, '1', @serveridx,@itemidx,@itemopt,@durationidx )
    FETCH NEXT FROM CURSOR_ACCOUNTS
    INTO @UserNum,@IsOnline
    END
    CLOSE CURSOR_ACCOUNTS
    DEALLOCATE CURSOR_ACCOUNTS

    END



Advertisement