How i can add item to all player ??
Up up
How i can add item to all player ??
Up up
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.
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.
not gonna help u executing this, if theres some comma missing or shit like that fix it urself.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 @1 =(
select top 1 itemid from _inventory f
join _char ff on f.charid = ff.charid
where ff.charname16 = @charname
order by itemid asc)
if @1 != 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
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.
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".
copy paste it again.
lol Royalblade what im telling him he need to insert the values by your language (Shit) :P into _inventory :) anyway thanks for your clarification
thanks bro work's fine
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
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.