SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Reply
 
Thread Tools Display Modes
Old 26/02/2018, 10:58 PM   #1
wallen
Huge Clucker
 
wallen's Avatar
 
Join Date: Aug 2015
Location: Italia
Posts: 264
Reputation: 11
Default Timers.

Settimer and SettimerEx, if used often will it lead somehow to a server crash? is it the same like having too much scripts on callback "onplayerupdate" ?, because i'am currently working on a auto-save system that saves your stats to mysql without losing it on a server restart or crash.
__________________
Los Santos DM Battleground
wallen is offline   Reply With Quote
Old 26/02/2018, 11:47 PM   #2
DTV
Gangsta
 
DTV's Avatar
 
Join Date: Dec 2010
Posts: 534
Reputation: 121
Default Re: Timers.

If you're worried about people losing their stats due to a crash or restart, save a player's stats when they actually change rather than making a timer to have it save every 5 minutes.
__________________
Bringing the nuclear post apocalyptic setting to SA-MP, click the banners to view the forum or Discord server.



DTV is offline   Reply With Quote
Old 27/02/2018, 01:44 PM   #3
PepsiCola23
Gangsta
 
Join Date: May 2015
Posts: 684
Reputation: 3
Default Re: Timers.

Quote:
Originally Posted by DTV View Post
If you're worried about people losing their stats due to a crash or restart, save a player's stats when they actually change rather than making a timer to have it save every 5 minutes.

exactly,why would you auto-save its stats every 1 minute or so.Imagine having 1000/1000 players. Just update them when stats that matter are modified(money,level etc )
PepsiCola23 is offline   Reply With Quote
Old 27/02/2018, 02:24 PM   #4
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,469
Reputation: 525
Default Re: Timers.

If the timer is used badly, and structured so it makes the script stall, then it will cause problems.

Doesn't matter how often you fire the timer, it's about its efficiency.
Sew_Sumi is offline   Reply With Quote
Old 27/02/2018, 02:39 PM   #5
wallen
Huge Clucker
 
wallen's Avatar
 
Join Date: Aug 2015
Location: Italia
Posts: 264
Reputation: 11
Default Re: Timers.

Thanks, i've got a clear point now
__________________
Los Santos DM Battleground
wallen is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with timers (again, sorry) Josh_Main Scripting Help 4 14/09/2016 06:05 PM
Timers Alvin007 Scripting Help 4 06/02/2015 04:39 PM
Timers Cerealguy Scripting Help 2 08/01/2015 06:18 PM
Timers,timers and more timers fubar Help Archive 13 12/10/2010 11:51 AM


All times are GMT. The time now is 12:25 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.