Raised This Month: $51 Target: $400
 12% 

[Store] Daily Credits (v2.2, 2017-11-10) [MySQL Support]


Post New Thread Reply   
 
Thread Tools Display Modes
yash1441
Senior Member
Join Date: Feb 2015
Location: Illuminati HQ
Old 08-13-2017 , 01:20   Re: [Store] Daily Credits (v1.4, 2017-08-10)
Reply With Quote #21

Quote:
Originally Posted by Nachtfrische View Post
Good job!
I've had another idea, could you perhaps add a cvar, which limits the max amount of credits you can recieve?
To elaborate: let's say I start with 10 Credits and I get 5 more credits each day, so 10, 15, 20...
At some point, I will be getting 100, 105, 110 credits each day and that can quickly add up and then be too much to give out.

So if you can make a cvar which you can set to, let's say 50, as soon as you reach 50 credits, the amount you recieve won't increase and you'll be getting 50 credits everyday as long as you keep up your daily streak.

Thanks.

Updated.
__________________
yash1441 is offline
Send a message via Skype™ to yash1441
Nachtfrische
Member
Join Date: Aug 2015
Location: Dream Community
Old 08-19-2017 , 18:14   Re: [Store] Daily Credits (v1.5, 2017-08-13) [MySQL Support]
Reply With Quote #22

The plugin is still kinda buggy.


When I type !daily multiple times, I only get credits once. But if the day changes and I get consecutive credits, the value in the database is not changing (not updating) and I can constantly get more credits.
The error you have made is that the column in the database is called "steam_id", while your "where" clause is using "steamid".

So, change
Code:
Format(buffer, sizeof(buffer), "UPDATE players SET last_connect = %i, bonus_amount = %i WHERE steamid = '%s'", date1, bonus + 1, steamId);
to
Code:
Format(buffer, sizeof(buffer), "UPDATE players SET last_connect = %i, bonus_amount = %i WHERE steam_id = '%s'", date1, bonus + 1, steamId);
You have this mistake in both of your update statements and therefore the database isn't updating.

Last edited by Nachtfrische; 08-19-2017 at 18:15.
Nachtfrische is offline
yash1441
Senior Member
Join Date: Feb 2015
Location: Illuminati HQ
Old 08-20-2017 , 01:49   Re: [Store] Daily Credits (v1.5, 2017-08-13) [MySQL Support]
Reply With Quote #23

Quote:
Originally Posted by Nachtfrische View Post
The plugin is still kinda buggy.


When I type !daily multiple times, I only get credits once. But if the day changes and I get consecutive credits, the value in the database is not changing (not updating) and I can constantly get more credits.
The error you have made is that the column in the database is called "steam_id", while your "where" clause is using "steamid".

So, change
Code:
Format(buffer, sizeof(buffer), "UPDATE players SET last_connect = %i, bonus_amount = %i WHERE steamid = '%s'", date1, bonus + 1, steamId);
to
Code:
Format(buffer, sizeof(buffer), "UPDATE players SET last_connect = %i, bonus_amount = %i WHERE steam_id = '%s'", date1, bonus + 1, steamId);
You have this mistake in both of your update statements and therefore the database isn't updating.
Updated.
Thanks for noticing the overlook
Also, merged with your commit on github!
__________________
yash1441 is offline
Send a message via Skype™ to yash1441
Cruze
Veteran Member
Join Date: May 2017
Old 08-20-2017 , 03:11   Re: [Store] Daily Credits (v1.5, 2017-08-13) [MySQL Support]
Reply With Quote #24

Ayy, pro
__________________
Taking paid private requests! Contact me
Cruze is offline
yash1441
Senior Member
Join Date: Feb 2015
Location: Illuminati HQ
Old 08-20-2017 , 20:48   Re: [Store] Daily Credits (v1.7, 2017-08-21) [MySQL Support]
Reply With Quote #25

Stuff Nachtfrische added:
- A config file called "dailycredits.cfg" will be created in "cfg/sourcemod", so users don't have to mess with setting cvars
- CVars were renamed to better fit into naming conventions
- Added support for translation files "dailycredits.phrases.txt", so it's easier to edit text without compiling the plugin and opens up the possiblity of adding extra languages
- Changed the text to be more friendly / appealing
- Added a german translation to the text
- Added color support to the text messages in chat, so [Store] is now printed your team color (just like the original store plugin) and the rest of the message has some highlighted parts in green like this

- Also added a new CVar called "sm_daily_credits_resetperiod", which basically puts the daily credits on rotation after you hit the set value. The default value is 7 days, so for example, you recieve credits like this: 50 -> 100 -> 150 ... -> 300 -> 350 -> 50 -> 100 ...


Edit by Nachtfrische
__________________

Last edited by yash1441; 08-20-2017 at 20:53. Reason: Update to v1.7
yash1441 is offline
Send a message via Skype™ to yash1441
yash1441
Senior Member
Join Date: Feb 2015
Location: Illuminati HQ
Old 08-21-2017 , 07:58   Re: [Store] Daily Credits (v1.7.1, 2017-08-21) [MySQL Support]
Reply With Quote #26

Updated with the new CVARs that were missing earlier.
Also, thanks to Cruze for pointing out that it is spelled as received instead of recieved XD
__________________

Last edited by yash1441; 08-21-2017 at 07:59. Reason: Updated to v1.7.1
yash1441 is offline
Send a message via Skype™ to yash1441
Cripix
Senior Member
Join Date: Sep 2016
Location: French, Bordeaux
Old 08-21-2017 , 08:35   Re: [Store] Daily Credits (v1.7.1, 2017-08-21) [MySQL Support]
Reply With Quote #27

French Translate
Attached Files
File Type: txt dailycredits.phrases.txt (2.6 KB, 53 views)
__________________
My jailbreak Server :
Cripix is offline
Nachtfrische
Member
Join Date: Aug 2015
Location: Dream Community
Old 08-21-2017 , 08:49   Re: [Store] Daily Credits (v1.7.1, 2017-08-21) [MySQL Support]
Reply With Quote #28

Quote:
Originally Posted by Cripix View Post
French Translate
Thanks, but there is a new line in the newest version, could you translate that as well?
__________________
Visit us at: http://dream-community.de

Our 35HP Knife Server:


Our Jailbreak Server:
Nachtfrische is offline
Cripix
Senior Member
Join Date: Sep 2016
Location: French, Bordeaux
Old 08-21-2017 , 09:01   Re: [Store] Daily Credits (v1.7.1, 2017-08-21) [MySQL Support]
Reply With Quote #29

Update
Attached Files
File Type: txt dailycredits.phrases.txt (2.9 KB, 63 views)
__________________
My jailbreak Server :
Cripix is offline
yash1441
Senior Member
Join Date: Feb 2015
Location: Illuminati HQ
Old 08-21-2017 , 09:13   Re: [Store] Daily Credits (v1.7.1, 2017-08-21) [MySQL Support]
Reply With Quote #30

Quote:
Originally Posted by Cripix View Post
Update
Added, thanks!
__________________
yash1441 is offline
Send a message via Skype™ to yash1441
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode