Contribution problem

04/24/2018 02:28 Cript_1337#1
Hello guys , i added job system to my server but i have a little problem
in this it require my server Contribution so i make a trade and get the Contribution from CharTrojb table
Code:
if exists (Select * from SRO_VT_SHARD.dbo._CharTrijob where CharID = [MENTION=395373]Chari[/MENTION]D
and Contribution >= '2928581' and JobType = '1' and [MENTION=444787]Char[/MENTION]_ReqLevel >= '95')
begin
well , the problem is . the first trade i get the reward, but when i try again to do another trade with the same character i dont get any reward "coins" any more because the Contribution of the character changes , and its not the same as the Contribution at the procedure

so how can i solve this?
07/09/2018 08:44 multiuses#2
i wish someone helps you because i already had this issue :(
07/09/2018 15:57 ZαKuRα#3
Quote:
USE [Name Your Log]GO
/****** Object: StoredProcedure [dbo].[_JobCoins] Script Date: 25.02.2015 13:24:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO




CREATE procedure [dbo].[_JobCoins] @charID int, @eventID tinyint
as
DECLARE @charnameJob varchar(268) = (Select CharName16 From SRO_VT_SHARD.dbo._Char where CharID = @charID)
Declare @JID Int = (select UserJID from SRO_VT_SHARD.dbo._User where CharID = @charID)
DECLARE @char_ReqLevel int = (Select CurLevel from SRO_VT_SHARD.dbo._char where CharID = @charID)
-- Begin Hunter Reward
If @eventID = 6
begin
Declare @cosID int = (select ID from SRO_VT_SHARD.dbo._CharCOS where OwnerCharID = @charID)
----------------------------------------------------------Begin Delete pet if he loggout.
Delete from SRO_VT_SHARD.dbo._InvCOS where COSID = @cosID
Delete from SRO_VT_SHARD.dbo._CharCOS where
OwnerCharID = @charID and RefCharID between '2187' and '2189'
or OwnerCharID = @charID and RefCharID between '3915' and '3917'
or OwnerCharID = @charID and RefCharID between '3912' and '3914'
or OwnerCharID = @charID and RefCharID between '2184' and '2186'
or OwnerCharID = @charID and RefCharID between '23250' and '23257'
or OwnerCharID = @charID and RefCharID between '23258' and '23265'
or OwnerCharID = @charID and RefCharID between '23905' and '23912'
end
if exists (Select * from SRO_VT_SHARD.dbo._CharTrijob where CharID = @charID
and Contribution >= '3484407' and JobType = '3' and @char_ReqLevel >= '80' )
begin
exec SRO_VT_SHARD.._Add_ITEM_EXTERN @charnamejob,'ITEM_ETC_ARENA_COIN',10,10
Update SRO_VT_SHARD.dbo._CharTrijob set Contribution = '1' where CharID = @charID
end -- orig 3484407
if exists (Select * from SRO_VT_SHARD.dbo._CharTrijob where CharID = @charID
and Contribution >= '3484407' and JobType = '1' and @char_ReqLevel >= '80')
begin
exec SRO_Vt_SHARD.._Add_ITEM_EXTERN @charnamejob,'ITEM_ETC_ARENA_COIN',10,10
Update SRO_VT_SHARD.dbo._CharTrijob set Contribution = '1' where CharID = @charID
end
if exists (Select * from SRO_VT_SHARD.dbo._CharTrijob where CharID = @charID
and Contribution >= '3484407' and JobType = '2' and @char_ReqLevel >= '80') begin
exec SRO_Vt_SHARD.._Add_ITEM_EXTERN @charnamejob,'ITEM_ETC_ARENA_COIN',10,10
Update SRO_VT_SHARD.dbo._CharTrijob set Contribution = '1' where CharID = @charID

end
.
07/09/2018 19:18 Bocc1337#4
You need to make the contributions to reset after each trade. Likr a relog and make a range example. Contribution 1000000. To. 2000000
Sory on mobile cant tpye out full code.
Keep in mind. Also the shorter routs give less then the longer routs.
This is also why a range is best
07/10/2018 06:08 HECKT0R#5
use this code inside your LOG DB> _Addlogchar procedure

PHP Code:
IF (@EventID '9') OR (@EventID '11'
BEGIN
UPDATE SRO_VT_SHARD
.._CharTrijob
            SET Contribution 
0
        WHERE CharID 
= [MENTION=395373]Chari[/MENTION]D
end 
but make sure to use it after your job procedure
or you can use the code above inside job procedure itself but after granting job reward .