View Full Version : [Help]Disable shout and trade from macro
People spam macros in towns a lot, so I just want to disable the usage of ! or + in front of the macro commands. Any suggestions? :)
would need research into the client...and hex, hex, hex
i didnt even think about trying it db side...that looks like what needs to be done.. nice fidow
very nice info! I was messing around with stored procedures but couldn't find a way to add a check. If I do it I'll post it. But if someone knows, let us know:)
top-gear
25.09.2006, 03:53
procedure for macroinfo is
ALTER PROCEDURE [dbo].[lin_CreateMacroInfo]
(
@macro_id int,
@macro_order int,
@macro_int1 int,
@macro_int2 int,
@macro_int3 int,
@macro_str nvarchar(255)
)
AS
SET NOCOUNT ON
if ( exists ( select * from user_macro where macro_id = @macro_id ) )
begin
if ( exists ( select * from user_macroinfo where macro_id = @macro_id and macro_order = @macro_order ) )
begin
update user_macroinfo set macro_int1 = @macro_int1, macro_int2 = @macro_int2, macro_int3 = @macro_int3 where macro_id = @macro_id and macro_order = @macro_order
end else begin
insert into user_macroinfo ( macro_id, macro_order, macro_int1, macro_int2, macro_int3, macro_str )
values ( @macro_id, @macro_order, @macro_int1, @macro_int2, @macro_int3, @macro_str )
end
end
couldnt make it check for ! or + on creation either
Im not an expert in SQL.. but.. maybe something like this..
please, someone correct me if i am wrong, i dont know if this is possible... and if this works...
IF @macro_str LIKE '!%'
BEGIN
RAISERROR ('Not allowed macro : name = [%s]', 16, 1, @macro_str)
RETURN -1
END
IF @macro_str LIKE '+%'
BEGIN
RAISERROR ('Not allowed macro : name = [%s]', 16, 1, @macro_str)
RETURN -1
END
top-gear
25.09.2006, 14:04
nice fidow, this is something good! ill test and tell u
hi,
work o no work...?
fidow, te agradeceria si me dices si funciono o no tu explicacion, gracias :D
I dont know, i dont test that, but i was thinking, when a macro is inserted in db first is inserted in user_macro table.. later in user_macroinfo ... with my mod maybe we can have some problems in user_macroinfo table... macros created but without data... or something like that... and.. i dont know if game reject creation of macro ... i think... if this works... macro is created at least temporaly (is cached)... when you restart server macro disaper.
ok gracias por la info ^^
thanks for info...