Trade warning Msg To Relogin Problem!

10/20/2024 21:22 hneko#1
Hello Guys So am still a beginner am trying to do a warning msg for the job users to Relogin when they sell the goods to receive the Points
the problem is the msg keeps repeating because the event ID is when they sell Each Good in the trade Not the entire package so it's like a loop but I only wanna do it once what is the solution for that?
Code:
else if [MENTION=2220328]Eventi[/MENTION]D = 97 or [MENTION=2220328]Eventi[/MENTION]D = 91 
begin
	declare [MENTION=1008634]msgt[/MENTION]RADE varchar(max)
	declare [MENTION=318268]NAM[/MENTION] varchar(max)
	SET [MENTION=1008634]msgt[/MENTION]RADE ='Warning: Please Restart your Character After Each Trade To Recive your Points..!'
	SET [MENTION=318268]NAM[/MENTION] = (Select CharName16 from SRO_VT_SHARD.._Char where CharID =@CharID)
	EXEC [SRO_VT_SHARDLOG].[dbo].[_SendChat] 'Private' [MENTION=318268]NAM[/MENTION] [MENTION=1008634]msgt[/MENTION]RADE
	end
10/21/2024 02:26 PortalDark#2
#moved
10/21/2024 03:59 JellyBitz#3
Quote:
Originally Posted by hneko View Post
trying to do a warning msg for the job users to Relogin when they sell the goods to receive the Points
the problem is the msg keeps repeating because the event ID is when they sell Each Good in the trade Not the entire package so it's like a loop but I only wanna do it once what is the solution for that?
I was thinking about making a cooldown with the datetime from selling but actually is easier by saving the region id.

So, each time the player sell goods, you'll check he has to be in another region.. I mean, different from previous one saved so he gets the reward. :p
10/21/2024 05:38 hneko#4
Quote:
Originally Posted by JellyBitz View Post
I was thinking about making a cooldown with the datetime from selling but actually is easier by saving the region id.

So, each time the player sell goods, you'll check he has to be in another region.. I mean, different from previous one saved so he gets the reward. :p
It's great Idea but what I did was I created a trigger on my System Helper it's like msg BOT to reply so after each trade you just tell him to give you the reward and the trigger execute the Job system and resets the system to 0 so you have to do another 5 star in order for it to work again:mofo:
10/21/2024 18:43 JellyBitz#5
Quote:
Originally Posted by hneko View Post
I created a trigger on my System Helper it's like msg BOT to reply so after each trade you just tell him to give you the reward
Not a good game design, it will be annoying for players and it's easier to keep the game flow through NPC. :p

Also, the my region id I talked about has some flaw if they wanna make the same route.. So my approach would be to reset the reward once they buy goods and you save the region id there, then send the reward if the goods sold is different from saved region id so you update it. ^^
10/22/2024 19:07 romio100#6
Quote:
IF @EventID = 97 OR @EventID = 91
BEGIN
DECLARE @msgtRADE VARCHAR(MAX);
DECLARE @NAM VARCHAR(MAX);


SET @msgtRADE = 'Warning: Please Restart your Character After Each Trade To Receive your Points..!';


SET @NAM = (SELECT CharName16 FROM SRO_VT_SHARD.._Char WHERE CharID = @CharID);


EXEC [SRO_VT_SHARDLOG].[dbo].[_SendChat] 'Private', @NAM, @msgtRADE;
END
The code has been modified and errors have been corrected. It works efficiently.
10/24/2024 21:02 hneko#7
Quote:
Originally Posted by JellyBitz View Post
Not a good game design, it will be annoying for players and it's easier to keep the game flow through NPC. :p

Also, the my region id I talked about has some flaw if they wanna make the same route.. So my approach would be to reset the reward once they buy goods and you save the region id there, then send the reward if the goods sold is different from saved region id so you update it. ^^
Quote:
Originally Posted by romio100 View Post
The code has been modified and errors have been corrected. It works efficiently.
there is no issue with the code in the first place!
am just talking about that the event id happen more then once so basically the code is gonna repeat itself multiple times.
10/25/2024 10:42 romio100#8
a repeated error in the code has been corrected.

DECLARE @[Only registered and activated users can see links. Click Here To Register...]ent BIT = 0; -- متغير لتحديد ما إذا تم إرسال الرسالة سابقاً

IF ( @[Only registered and activated users can see links. Click Here To Register...]D = 97 OR @[Only registered and activated users can see links. Click Here To Register...]D = 91) AND @[Only registered and activated users can see links. Click Here To Register...]ent = 0
BEGIN
DECLARE @[Only registered and activated users can see links. Click Here To Register...]RADE VARCHAR(MAX);
DECLARE @[Only registered and activated users can see links. Click Here To Register...] VARCHAR(MAX);

SET @[Only registered and activated users can see links. Click Here To Register...]RADE = 'تحذير: الرجاء إعادة تسجيل الدخول بعد كل عملية بيع للحصول على نقاطك..!';
SET @[Only registered and activated users can see links. Click Here To Register...] = (SELECT CharName16 FROM SRO_VT_SHARD.._Char WHERE CharID = @[Only registered and activated users can see links. Click Here To Register...]D);

EXEC [SRO_VT_SHARDLOG].[dbo].[_SendChat] 'Private', @[Only registered and activated users can see links. Click Here To Register...], @[Only registered and activated users can see links. Click Here To Register...]RADE;

SET @[Only registered and activated users can see links. Click Here To Register...]ent = 1; -- تحديث الحالة لتجنب تكرار الرسالة
END