limit the creation of guild
Hi everyone ! :):
First of all, i your apologize for my bad English level. :(:
So we will limit the creation of in game guild directly by database.
1) Create column "CreateGuild" in database MuOnline.dbo.Character
select table "Character" right click --> select "Creation".
in low -->
Column name : "CreateGuild"
Data type : bit
not allow null values
Good :thumbup1:
Then in new column, the value :
0 : Can not create guild
1 : Can create guild
2) limit the creation of guild
go to database : MuOnline/Programmability/stored procedures.
Select table "dbo.WZ_GuildCreate" right click --> select "change" or "modified".
add in which red below :
Quote:
USE [MuOnline]
GO
/****** Object: StoredProcedure [dbo].[WZ_GuildCreate] Script Date: 05/23/2013 19:32:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[WZ_GuildCreate]
@GuildName varchar(8),
@MasterName varchar(10)
as
BEGIN
DECLARE @ErrorCode int
declare @rightcreations bit
SET @ErrorCode = 0
SET XACT_ABORT ON
Set nocount on
begin transaction
-- Verification right (active)
select @rightcreations = CreateGuild from Character where Name LIKE @MasterName;
IF (@rightcreations <> 1 )
BEGIN
SET @ErrorCode = 1
END
-- création de la guilde
IF ( @ErrorCode = 0 )
BEGIN
INSERT INTO Guild (G_Name, G_Master) VALUES (@GuildName, @MasterName)
IF ( @@Error <> 0 )
BEGIN
SET @ErrorCode = 1
END
END
IF ( @ErrorCode = 0 )
BEGIN
-- insertion du guildmaster dans la table des membres
INSERT GuildMember (Name, G_Name, G_Level) VALUES (@MasterName, @GuildName, 1)
IF ( @@Error <> 0 )
BEGIN
SET @ErrorCode = 2
END
END
-- en cas d'erreur on annule tout
IF ( @ErrorCode <> 0 )
rollback transaction
ELSE
commit transaction
-- on renvoie le code d'erreur
select @ErrorCode
Set nocount off
SET XACT_ABORT OFF
END
Then made right click --> execute. directly in the code area or simply press the "Execute" button at the top. Then you can close without saving.
The tutorial is finished :):
Thank you !
Murlock.
Re: limit the creation of guild
Good job bro. It's very useful :)
Re: limit the creation of guild
and something for a limit of two clans alliances?
Re: limit the creation of guild
Thank you JongKidz =)
Mosiah17 : it is sufficient just to put the value "1" two players in the table "Character" column "CreateGuild". Everything else "0" ;)