Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

send items on account creation gunz

Skilled Illusionist
Joined
Sep 30, 2009
Messages
320
Reaction score
7
After registering in gunz how shall i configure database so newly members get the items i want to send them automatically.
 
Newbie Spellweaver
Joined
Mar 15, 2014
Messages
97
Reaction score
16
try adapting this Scripts in your php registry and change the id of the item

INSERT INTO AccountItem (AID, ItemID, RentDate, cnt)(SELECT ac.AID, 'Id do Item', GETDATE(), 1 FROM AccountItem (nolock) ac)
 
Upvote 0
I'm retired, I'm already
Banned
Joined
Oct 3, 2011
Messages
832
Reaction score
155
Easy, follow this code and paste it below the order of the module that is directed towards sending the information to the database.

PHP:
  mssql_query("INSERT INTO AccountItem ([AID], [ItemID], [RentDate], [RentHourPeriod], [Cnt])VALUES('".$AID."', 'IDITEM', GETDATE(), '30', '1')"); //30 days the duration of the item, to edit it fix in the number 30 in the code.
 
Upvote 0
Skilled Illusionist
Joined
Sep 30, 2009
Messages
320
Reaction score
7
Easy, follow this code and paste it below the order of the module that is directed towards sending the information to the database.

PHP:
  mssql_query("INSERT INTO AccountItem ([AID], [ItemID], [RentDate], [RentHourPeriod], [Cnt])VALUES('".$AID."', 'IDITEM', GETDATE(), '30', '1')"); //30 days the duration of the item, to edit it fix in the number 30 in the code.

Thank you jorklenis2 :) always been helpful :)
 
Upvote 0
Newbie Spellweaver
Joined
Jan 15, 2015
Messages
31
Reaction score
0
USE [GunzDB]
GO
/****** Object: StoredProcedure [dbo].[spInsertChar] Script Date: 11/21/2008 05:26:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/****** Object: Stored Procedure dbo.spInsertChar Script Date: 5/10/2007 3:42:11 PM ******/


/* 캐릭터 추가 */
ALTER PROC [dbo].[spInsertChar]
Aid int,
CharNum smallint,
@ varchar(24),
@ tinyint,
@ int,
face int,
@Costume int
AS
SET NOCOUNT ON
BEGIN TRAN
IF EXISTS (SELECT CID FROM Character where (AID Aid AND CharNum CharNum) OR (Name=@ ))
BEGIN
ROLLBACK TRAN
return(-1)
END
IF (SELECT dbo.fnCheckString(@ ) as Test)= 1
BEGIN
ROLLBACK TRAN
return (-1)
END
DECLARE CharIdent int
DECLARE ChestCIID int
DECLARE LegsCIID int
DECLARE MeleeCIID int
DECLARE PrimaryCIID int
DECLARE secondaryCIID int
DECLARE Custom1CIID int
DECLARE Custom2CIID int

DECLARE ChestItemID int
DECLARE LegsItemID int
DECLARE MeleeItemID int
DECLARE PrimaryItemID int
DECLARE secondaryItemID int
DECLARE Custom1ItemID int
DECLARE Custom2ItemID int

SET secondaryCIID = NULL
SET secondaryItemID = NULL

SET Custom1CIID = NULL
SET Custom1ItemID = NULL

SET Custom2CIID = NULL
SET Custom2ItemID = NULL

INSERT INTO Character (AID, Name, CharNum, Level, Sex, Hair, Face, XP, BP, FR, CR, ER, WR,
GameCount, KillCount, DeathCount, RegDate, PlayTime, DeleteFlag)
Values Aid, @ , CharNum, 1, @ , @ , face, 0, 0, 0, 0, 0, 0, 0, 0, 0, GETDATE(), 0, 0)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END


SET CharIdent = @@IDENTITY

/* Melee */
SET MeleeItemID =
CASE @Costume
WHEN 0 THEN 1
WHEN 1 THEN 2
WHEN 2 THEN 1
WHEN 3 THEN 2
WHEN 4 THEN 2
WHEN 5 THEN 1
END

INSERT INTO CharacterItem (CID, ItemID) Values CharIdent, MeleeItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END

SET MeleeCIID = @@IDENTITY

/* Primary */
SET PrimaryItemID =
CASE @Costume
WHEN 0 THEN 5001
WHEN 1 THEN 5002
WHEN 2 THEN 4005
WHEN 3 THEN 4001
WHEN 4 THEN 4002
WHEN 5 THEN 4006
END

INSERT INTO CharacterItem (CID, ItemID) Values CharIdent, PrimaryItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END

SET PrimaryCIID = @@IDENTITY

/* Secondary */
IF @Costume = 0 OR @Costume = 2 BEGIN
SET secondaryItemID =
CASE @Costume
WHEN 0 THEN 4001
WHEN 1 THEN 0
WHEN 2 THEN 5001
WHEN 3 THEN 4006
WHEN 4 THEN 0
WHEN 5 THEN 4006
END

IF secondaryItemID <> 0 BEGIN
INSERT INTO CharacterItem (CID, ItemID) Values CharIdent, secondaryItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END

SET secondaryCIID = @@IDENTITY
END
END
SET Custom1ItemID =
CASE @Costume
WHEN 0 THEN 30301
WHEN 1 THEN 30301
WHEN 2 THEN 30401
WHEN 3 THEN 30401
WHEN 4 THEN 30401
WHEN 5 THEN 30101
END

/* Custom1 */
INSERT INTO CharacterItem (CID, ItemID) Values CharIdent, Custom1ItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END

SET Custom1CIID = @@IDENTITY

/* Custom2 */
IF @Costume = 4 OR @Costume = 5
BEGIN
SET Custom2ItemID =
CASE @Costume
WHEN 0 THEN 0
WHEN 1 THEN 0
WHEN 2 THEN 0
WHEN 3 THEN 0
WHEN 4 THEN 30001
WHEN 5 THEN 30001
END

IF Custom2ItemID <> 0
BEGIN
INSERT INTO CharacterItem (CID, ItemID) Values CharIdent, Custom2ItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END

SET Custom2CIID = @@IDENTITY
END
END


IF @ = 0 /* 남자일 경우 */
BEGIN

/* Chest */
SET ChestItemID =
CASE @Costume
WHEN 0 THEN 21001
WHEN 1 THEN 21001
WHEN 2 THEN 21001
WHEN 3 THEN 21001
WHEN 4 THEN 21001
WHEN 5 THEN 21001
END


INSERT INTO CharacterItem (CID, ItemID) Values CharIdent, ChestItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END

SET ChestCIID = @@IDENTITY

/* Legs */
SET LegsItemID =
CASE @Costume
WHEN 0 THEN 23001
WHEN 1 THEN 23001
WHEN 2 THEN 23001
WHEN 3 THEN 23001
WHEN 4 THEN 23001
WHEN 5 THEN 23001
END


INSERT INTO CharacterItem (CID, ItemID) Values CharIdent, LegsItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END

SET LegsCIID = @@IDENTITY

END
ELSE
BEGIN /* 여자일 경우 */

/* Chest */
SET ChestItemID =
CASE @Costume
WHEN 0 THEN 21501
WHEN 1 THEN 21501
WHEN 2 THEN 21501
WHEN 3 THEN 21501
WHEN 4 THEN 21501
WHEN 5 THEN 21501
END


INSERT INTO CharacterItem (CID, ItemID) Values CharIdent, ChestItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET ChestCIID = @@IDENTITY

/* Legs */
SET LegsItemID =
CASE @Costume
WHEN 0 THEN 23501
WHEN 1 THEN 23501
WHEN 2 THEN 23501
WHEN 3 THEN 23501
WHEN 4 THEN 23501
WHEN 5 THEN 23501
END


INSERT INTO CharacterItem (CID, ItemID) Values CharIdent, LegsItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET LegsCIID = @@IDENTITY

END

UPDATE Character
SET chest_slot = ChestCIID, legs_slot = LegsCIID, melee_slot = MeleeCIID,
primary_slot = PrimaryCIID, secondary_slot = secondaryCIID, custom1_slot = Custom1CIID,
custom2_slot = Custom2CIID,
chest_itemid = ChestItemID, legs_itemid = LegsItemID, melee_itemid = MeleeItemID,
primary_itemid = PrimaryItemID, secondary_itemid = secondaryItemID, custom1_itemid = Custom1ItemID,
custom2_itemid = Custom2ItemID
WHERE CID CharIdent
IF 0 = @@ROWCOUNT BEGIN
ROLLBACK TRAN
RETURN (-1)
END
COMMIT TRAN
 
Upvote 0
Back
Top