DECLARE @me varchar(30)
SET @me = (SELECT CharName FROM PS_GameData.dbo.Chars WHERE CharID = @D)
if(@ActionType=112 AND @=101015)
BEGIN
UPDATE PS_GameData.dbo.Chars SET CharName = '[King]' + @me WHERE CharID = @D
UPDATE PS_GameData.dbo.Guilds SET MasterName = '[King]' + @me WHERE MasterCharID = @D
UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[King]' + @me WHERE FriendID = @D
END
but the problem .. how can replace new tag if already have [King] Tag on charname? example my character already have [King] tag.. then i use again another auto tag item call [King-II] .. how can i replace [King] tag if already exist.. i hope have someone help me .. thanks in advance..
May be you could use CHARINDEX() and SUBSTRING(), to remove the [King] tag (if exist), and then apply the new tag.
Try this test
Code:
DECLARE
[MENTION=984633]current[/MENTION]Nick NVARCHAR(30),
[MENTION=4843871]NewNick[/MENTION] nvarchar(30),
[MENTION=1332308]Closet[/MENTION]ag NVARCHAR(1),
[MENTION=3014117]nickle[/MENTION]nght INT,
[MENTION=4351196]TAGIN[/MENTION]dex INT
SET [MENTION=984633]current[/MENTION]Nick = '[King]Akira' --example nick
SET [MENTION=1332308]Closet[/MENTION]ag = ']' --no need to find the opening tag '['
set [MENTION=4351196]TAGIN[/MENTION]dex = CHARINDEX [MENTION=1332308]Closet[/MENTION]ag [MENTION=984633]current[/MENTION]Nick) --where is ']' in the string
set [MENTION=3014117]nickle[/MENTION]nght = len [MENTION=984633]current[/MENTION]Nick) --nick lenght
if [MENTION=4351196]TAGIN[/MENTION]dex > 0 --if current nick has a ']'
BEGIN
set [MENTION=4843871]NewNick[/MENTION] = SUBSTRING [MENTION=984633]current[/MENTION]Nick, [MENTION=4351196]TAGIN[/MENTION]dex + 1, [MENTION=3014117]nickle[/MENTION]nght) --take the nick without the [***]
set [MENTION=4843871]NewNick[/MENTION] = '[King II]' + [MENTION=4843871]NewNick[/MENTION] --apply a new tag
END
ELSE --if current nick doesn't have a tag at all
BEGIN
set [MENTION=4843871]NewNick[/MENTION] = '[King I]'+ [MENTION=984633]current[/MENTION]nick
END
print [MENTION=4843871]NewNick[/MENTION] --to check result
Another way would be to make a seperate column which is only used for tags, and then in the procedure that selects character details, just concatenate the two strings to form a display name
May be you could use CHARINDEX() and SUBSTRING(), to remove the [King] tag (if exist), and then apply the new tag.
Try this test
Code:
DECLARE
[MENTION=984633]current[/MENTION]Nick NVARCHAR(30),
[MENTION=4843871]NewNick[/MENTION] nvarchar(30),
[MENTION=1332308]Closet[/MENTION]ag NVARCHAR(1),
[MENTION=3014117]nickle[/MENTION]nght INT,
[MENTION=4351196]TAGIN[/MENTION]dex INT
SET [MENTION=984633]current[/MENTION]Nick = '[King]Akira' --example nick
SET [MENTION=1332308]Closet[/MENTION]ag = ']' --no need to find the opening tag '['
set [MENTION=4351196]TAGIN[/MENTION]dex = CHARINDEX [MENTION=1332308]Closet[/MENTION]ag [MENTION=984633]current[/MENTION]Nick) --where is ']' in the string
set [MENTION=3014117]nickle[/MENTION]nght = len [MENTION=984633]current[/MENTION]Nick) --nick lenght
if [MENTION=4351196]TAGIN[/MENTION]dex > 0 --if current nick has a ']'
BEGIN
set [MENTION=4843871]NewNick[/MENTION] = SUBSTRING [MENTION=984633]current[/MENTION]Nick, [MENTION=4351196]TAGIN[/MENTION]dex + 1, [MENTION=3014117]nickle[/MENTION]nght) --take the nick without the [xxx]
set [MENTION=4843871]NewNick[/MENTION] = '[King II]' + [MENTION=4843871]NewNick[/MENTION] --apply a new tag
END
ELSE --if current nick doesn't have a tag at all
BEGIN
set [MENTION=4843871]NewNick[/MENTION] = '[King I]'+ [MENTION=984633]current[/MENTION]nick
END
print [MENTION=4843871]NewNick[/MENTION] --to check result
i removed all MENTION and /MENTION and try to insert on action_log_e but got error..
can you help me how to work this? thanks bro..
Quote:
Originally Posted by Cups
Another way would be to make a seperate column which is only used for tags, and then in the procedure that selects character details, just concatenate the two strings to form a display name
can you help me how to do that sir Cups.. thank you..
SET @CNAme = (SELECT CharName FROM PS_GameData.dbo.Chars WHERE CharID = @ChariD)
SET @CNAme_OLD = (SELECT CharName_OLD FROM PS_GameData.dbo.Chars WHERE CharID = @ChariD)
if(@ActionType=112 AND @value2=101015)
BEGIN
UPDATE PS_GameData.dbo.Chars SET CharName_OLD = @CNAme WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Chars SET CharName = '[King]' + @CNAme_OLD WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Guilds SET MasterName = '[King]' + @CNAme_OLD WHERE MasterCharID = @ChariD
UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[King]' + @CNAme_OLD WHERE FriendID = @ChariD
END
And when player want change name then change CharName_OLD without tag and CharName with tag
And when player want change name then change CharName_OLD without tag and CharName with tag
i try this but they have a problem..
- on first use of item no effect on CharName because no value CharName_OLD and they change only on first use
- on 2nd use of item its effect the Change of CharName because they already have value on CharName_OLD
- on 3rd time to use i change the Tag to [KingII] as test if i make another tag item and when i use.. its effect the change of CharName to [KingII]myCharname..
- on fourth time to use Tag called [***] as test again if i make 3rd tag item but the result is [***]+my CharName_OLD = [***][KingII]myCharname..
so that's the problem on this code sir.. i think on this code if we add CharName_OLD table if we make a new character they copy the CharName too on CharName_OLD so if we use item tag they effect on first use.. and about 3rd and so on.. tag item they give a problem like on fourth time i use..
but thanks for this.. i hope they can fixed also..
DECLARE @CNAme varchar(30)
DECLARE @Tag varchar(30) = (SELECT Tag FROM PS_GameData.dbo.Chars WHERE CharID = @ChariD)
DECLARE @CNAme_OLD varchar(30) = (SELECT CharName_OLD FROM PS_GameData.dbo.Chars WHERE CharID = @ChariD)
SET @CNAme = (SELECT CharName FROM PS_GameData.dbo.Chars WHERE CharID = @ChariD)
if(@ActionType=112 AND @value2=101015)
BEGIN
if exists (Select Tag from Chars where CharID=@CharID and Tag is null)
begin
UPDATE PS_GameData.dbo.Chars
SET CharName_OLD = @CNAme
Where CharID = @CharID
UPDATE PS_GameData.dbo.Chars SET Tag = '[King]' WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Chars SET CharName = '[King]' + @CNAme WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Guilds SET MasterName = '[King]' + @CNAme WHERE MasterCharID = @ChariD
UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[King]' + @CNAme WHERE FriendID = @ChariD
end
if (@Tag ='[King]')
begin
UPDATE PS_GameData.dbo.Chars SET CharName = '[KingII]' + @CNAme_OLD WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Guilds SET MasterName = '[KingII]' + @CNAme_OLD WHERE MasterCharID = @ChariD
UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[KingII]' + @CNAme_OLD WHERE FriendID = @ChariD
UPDATE PS_GameData.dbo.Chars SET Tag = '[KingII]' WHERE CharID = @ChariD
end
if (@Tag ='[KingII]')
begin
UPDATE PS_GameData.dbo.Chars SET CharName = '[KingIII]' + @CNAme_OLD WHERE CharID = @ChariD
UPDATE PS_GameData.dbo.Guilds SET MasterName = '[KingIII]' + @CNAme_OLD WHERE MasterCharID = @ChariD
UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[KingIII]' + @CNAme_OLD WHERE FriendID = @ChariD
UPDATE PS_GameData.dbo.Chars SET Tag = '[KingIII]' WHERE CharID = @ChariD
end
UPDATE PS_GameData.dbo.Chars SET CharName = REPLACE @Name, '[OLDTAG]', ''), WHERE CharID = @D
UPDATE PS_GameData.dbo.Guilds SET MasterName = REPLACE @Name, '[OLDTAG]', '') WHERE MasterCharID = @D
UPDATE PS_GameData.dbo.FriendChars SET FriendName = REPLACE @Name, '[OLDTAG]', '') WHERE FriendID = @D
Note: My suggestion is to create a new table that will save the original character's name prior to adding TAGS because with this type of editing that you are doing, it will edit the actual Character Name, thus, if player for example has name 'MIKE' then get that [TAG]MIKE', then when someone uses the created a new character or rename to while your tag system is applied, 'MIKE' name they will taken.
Thanks to all reply i already figure out how its work properly using @ codes..
First i go on PS_GameData.dbo.Chars and make new table called CharName_OLD then
Second i go PS_GameData.dbo.usp.Create_Char_R and add CharName_OLD on INSERT and @ on VALUES so if i make new Character New Table have my CharName too..
then i go to PS_GameLog.usp.Action_Log_E and Insert This
SET @me = (SELECT CharName FROM PS_GameData.dbo.Chars WHERE CharID = @D) SET @me_OLD = (SELECT CharName_OLD FROM PS_GameData.dbo.Chars WHERE CharID = @D)
if(@ActionType=112 AND @=101015)
BEGIN
UPDATE PS_GameData.dbo.Chars SET CharName = '[King]' + @me_OLD WHERE CharID = @D UPDATE PS_GameData.dbo.Guilds SET MasterName = '[King]' + @me_OLD WHERE MasterCharID = @D UPDATE PS_GameData.dbo.FriendChars SET FriendName = '[King]' + @me_OLD WHERE FriendID = @D
END
Now its work properly.. and thanks to all people helping me,
No need to use Create_Char for it
In my code was mistake
It was:
But shoul be:
I tested it as query with PS_GameData and i forgot it is PS_GameLog
yes sir but i think that is for 1 tag item only..
because i want to make different item with different tag so that's why i add on Create_Char so its automatic add new CharName on CharName_OLD table
and i already test with different tag item and its work..
In your case you have to add to Name Stone Change update part
Open Proc [dbo].[usp_Save_Char_Name_E]
and find this:
Quote:
UPDATE Chars SET CharName=@NewCharName,RenameCnt=RenameCnt-1,OldCharName=@OldCharName WHERE CharID=@CharID AND Del=0
IF @@ERROR <> 0
BEGIN
GOTO ERROR_ROLLBACK
END
And change it to:
Quote:
UPDATE Chars SET CharName=@NewCharName,RenameCnt=RenameCnt-1,OldCharName=@OldCharName, CharName_OLD = @NewCharName WHERE CharID=@CharID AND Del=0
IF @@ERROR <> 0
BEGIN
GOTO ERROR_ROLLBACK
END
DECLARE @Tag varchar(30) = (Select Tag from Chars where CharID = @CharID)
if exists (Select Tag from Chars where CharID=@CharID and Tag is not null)
begin
UPDATE PS_GameData.dbo.Chars
SET CharName = @Tag + @NewCharName
Where CharID = @CharID
end
With this when players use Name Stone their tag will be added automatically but to see it they have to re open game.exe
In your case you have to add to Name Stone Change update part
Open Proc [dbo].[usp_Save_Char_Name_E]
and find this:
And change it to:
With this when players use Name Stone their tag will be added automatically but to see it they have to re open game.exe
Thanks sir.. you help me lot..
i choose to use this only.. because name change stone is normal change name.. so i make it different on tag item.. so if player want to removed their tag.. he can use name change stone..
UPDATE Chars SET CharName @Name,RenameCnt=RenameCnt-1,OldCharName=@OldCharName, CharName_OLD = @Name WHERE CharID=@CharID AND Del=0
IF @@ERROR <> 0
BEGIN
GOTO ERROR_ROLLBACK
END
i choose to use this only.. because name change stone is normal change name.. so i make it different on tag item.. so if player want to removed their tag.. he can use name change stone..
Shaiya MultiBot v1.6#Auto potion,auto collection,auto stroke,auto skill 06/01/2012 - Shaiya Hacks, Bots, Cheats & Exploits - 12 Replies http://d1205.hizliresim.com/x/5/5bjkl.jpg
Hello everyone friends.
I took off and I wanted to share the new version of Hilemizin.
Other editions, a new difference:
* Layout option 2.Skill.
One trick from Image;
http://c1205.hizliresim.com/x/4/59sgl.jpg
Use the same fashion as yet.
Slot {1} / Flat Beat Flat Beat Talent = 1 you put in the game.
That it is the other options we.