Raised This Month: $32 Target: $400
 8% 

help of saving method


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-19-2020 , 08:11   help of saving method
Reply With Quote #1

hi guys. i would like to make a plugin which will have two type of working:

1) like mainly, when player got saved in db, his stats will stay forever (so i will choose mysql)
2) but for this, i need player's info to be updated every 24h, can you suggest my saving method for this? more precisely, delete his stats after 24h of inserting

Worth mentioning is i would use .php with POST to show stats on motd, so with 1) mysql is better, but for two, what will be the logic of deleting mysql record/row with task of 24hours? maybe adding mysql column of date when it should be deleted, so check it on player connect? (about cron job bad idea probably)

I though also about nvault system for 2), with prune row after 24h but if something better is there pls tell inform me

Thanks in advance!
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 11-19-2020 at 08:11.
JocAnis is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 11-19-2020 , 08:13   Re: help of saving method
Reply With Quote #2

Should be in Suggestions/Requests.
redivcram is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-19-2020 , 08:22   Re: help of saving method
Reply With Quote #3

Okay my bad, if any admin can move it i would appreciate it
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 11-19-2020 , 08:47   Re: help of saving method
Reply With Quote #4

Admins are less active than usual and we hope that they return enough to at least pass on the torch to someone who's more active. You can post this again in the section.
redivcram is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-19-2020 , 10:29   Re: help of saving method
Reply With Quote #5

For the time you wrote these two replies you could do more something consturctive, for example give suggestion what should i use in 2) situation
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 11-19-2020 , 11:35   Re: help of saving method
Reply With Quote #6

For the time it took for you to write the previous post, you could have posted in the right section.
redivcram is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-19-2020 , 20:38   Re: help of saving method
Reply With Quote #7

Save each record with a unix timestamp

On plugin load/map change.. with %d being get_systime() in your plugin.
Code:
DELETE FROM db WHERE ((%d - TimeStampInDBRecord) >= 86400);
__________________
Bugsy is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-20-2020 , 21:37   Re: help of saving method
Reply With Quote #8

Yes, thats what i needed. big thatnks @Bugsy !
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
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 00:57.


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