Add Item to All Player

Results 1 to 10 of 10
  1. #1
    AssassinS Silkroad arabcart is offline
    Grand MasterRank
    Sep 2011 Join Date
    664Posts

    Add Item to All Player

    How i can add item to all player ??

    Up up


  2. #2
    AssassinS Silkroad arabcart is offline
    Grand MasterRank
    Sep 2011 Join Date
    664Posts

    Re: Add Item to All Player

    Up up

  3. #3
    Newbie ahmedgabary is offline
    MemberRank
    Sep 2013 Join Date
    19Posts

    Re: Add Item to All Player

    first of all you need to get the item ID you want to add to players then insert the value into _Inventory table the issue here to get the slot you will add your item into it, since all the player don't have the same Inventory size and even if they have the same size you still need to hit the empty slot in the char Inventory.

  4. #4
    Elite Member Royalblade is offline
    Member +Rank
    Jan 2013 Join Date
    167Posts

    Re: Add Item to All Player

    lol ahmedgabary... its simple as fuck to do it, dont tell him something which isnt true.
    PS: gonna look shit due to the fact that its written in right in here.

    PHP Code:
    create table _FullInventorieslist (Charname16 varchar(32))
    declare 
    @
    1 int,
    @
    charname varchar(32),
    @
    codename varchar(127) = 'ITEM_ETC_SD_TOKEN_04', -- Gold Coin
    @amount tinyint 23, -- Grant 23 gold coins
    @optlvl tinyint 0; -- change if its an equippable item
    declare grantshit cursor for
    select charname16 from _char where charid != 0
    open grantshit
    fetch next from grantshit into 
    @charname
    while @@fetch_status 0
    begin
    set 
    @=(
    select top 1 itemid from _inventory f
    join _char ff on f
    .charid ff.charid
    where ff
    .charname16 = @charname
    order by itemid asc
    )
    if @
    != 0
    begin
    print @charname +' had a full inventory, item wasnt granted'
    insert _fullinventorieslist values (@charname)
    end
    else
    exec _add_item_extern @charname, @codename, @amount, @optlvl
    fetch next from grantshit into 
    @charname
    end
    close grantshit
    deallocate grantshit 
    not gonna help u executing this, if theres some comma missing or shit like that fix it urself.
    and dont hook this on some log to grant items all the time cuz this one is slow as shit... meaning its made for a one time execution only.
    Last edited by Royalblade; 08-10-13 at 10:19 AM.

  5. #5
    AssassinS Silkroad arabcart is offline
    Grand MasterRank
    Sep 2011 Join Date
    664Posts

    Re: Add Item to All Player

    Quote Originally Posted by Royalblade View Post
    lol ahmedgabary... its simple as fuck to do it, dont tell him something which isnt true.
    PS: gonna look shit due to the fact that its written in right in here.

    PHP Code:
    create table _FullInventorieslist (Charname16 varchar(32))
    declare 
    @
    1
    @charname varchar(32),
    @
    codename varchar(127) = 'ITEM_ETC_SD_TOKEN_04', -- Gold Coin
    @amount tinyint 23, -- Grant 23 gold coins
    @optlvl tinyint 0; -- change if its an equippable item
    declare grantshit cursor for
    select charname16 from _char where charid != 0
    open grantshit
    fetch next from grantshit into 
    @charname
    while @@fetch_status 0
    begin
    set 
    @=(
    select top 1 itemid from _inventory f
    join _char ff on f
    .charid ff.charid
    where ff
    .charname16 = @charname)
    if @
    != 0
    begin
    print @charname +' had a full inventory, item wasnt granted'
    insert _fullinventorieslist values (@charname)
    end
    else
    exec _add_item_extern @charname, @codename, @amount, @optlvl
    fetch next from grantshit into 
    @charname
    end
    close grantshit
    deallocate grantshit 
    not gonna help u executing this, if theres some comma missing or shit like that fix it urself.
    and dont hook this on some log to grant items all the time cuz this one is slow as shit... meaning its made for a one time execution only.
    I get thisi
    Msg 102, Level 15, State 1, Line 4
    Incorrect syntax near '@charname'.
    Msg 137, Level 15, State 2, Line 11
    Must declare the scalar variable "@charname".
    Msg 137, Level 15, State 2, Line 17
    Must declare the scalar variable "@charname".
    Msg 137, Level 15, State 2, Line 18
    Must declare the scalar variable "@1".
    Msg 137, Level 15, State 2, Line 20
    Must declare the scalar variable "@charname".
    Msg 137, Level 15, State 2, Line 21
    Must declare the scalar variable "@charname".
    Msg 137, Level 15, State 2, Line 24
    Must declare the scalar variable "@charname".
    Msg 137, Level 15, State 2, Line 25
    Must declare the scalar variable "@charname".

  6. #6
    Elite Member Royalblade is offline
    Member +Rank
    Jan 2013 Join Date
    167Posts

    Re: Add Item to All Player

    copy paste it again.

  7. #7
    Newbie ahmedgabary is offline
    MemberRank
    Sep 2013 Join Date
    19Posts

    Re: Add Item to All Player

    lol Royalblade what im telling him he need to insert the values by your language (Shit) :P into _inventory :) anyway thanks for your clarification

  8. #8
    AssassinS Silkroad arabcart is offline
    Grand MasterRank
    Sep 2011 Join Date
    664Posts

    Re: Add Item to All Player

    thanks bro work's fine

  9. #9
    SilkRoad vSro Service MaDenGo is offline
    Grand MasterRank
    Aug 2012 Join Date
    vSro CommunityLocation
    512Posts

    Re: Add Item to All Player

    Try this too
    PHP Code:
    USE SRO_VT_SHARD
    GO
    DECLARE    @CharName VARCHAR(64),
        @
    ItemCodeName VARCHAR(64) = 'ITEM_CH_SWORD_01_A'    --Item's codename

    DECLARE item_cur CURSOR FOR
    SELECT DISTINCT CharName16 FROM _Char ORDER BY CharName16

        OPEN item_cur
            FETCH NEXT FROM item_cur INTO @CharName
                WHILE @@FETCH_STATUS = 0
                    BEGIN
                        EXEC _ADD_ITEM_EXTERN @CharName, @ItemCodeName, 1, 0  --params: CharName, ItemCodeName, Data(quantity or durability), OptLevel
                        FETCH NEXT FROM item_cur INTO @CharName
                    END
            
            PRINT @CharName
        CLOSE item_cur

    DEALLOCATE item_cur 

  10. #10
    Elite Member Royalblade is offline
    Member +Rank
    Jan 2013 Join Date
    167Posts

    Re: Add Item to All Player

    works perfectly for me, dunnow what probs u got. Madengo copy pastet the table and print out too so you know which of the invenories were full....

    otherwise u will have ppz that dont get items. this way u can manually rgant it to em agian.



Advertisement