SA-MP Forums

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

Thread Tools Display Modes
Old 29/03/2020, 02:39 PM   #1
Big Clucker
Join Date: Dec 2011
Location: Czech Republic - Prachatice/Písek
Posts: 109
Reputation: 5
Default MySQL save while Kick/Ban

Hello guys, can u please help me with my problem?

Using MySQL for saving stats, everythinks work fine while normal disconnect, but when i call Kick or Ban player, his account didnt save (save with 0 value). Any solutions?
MichiCZ is offline   Reply With Quote
Old 29/03/2020, 03:24 PM   #2
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 618
Reputation: 57
Default Re: MySQL save while Kick/Ban

Actually, I have an idea. Delay the ban/kick and save the player data before kick/ban.
SiaReyes is offline   Reply With Quote
Old 30/03/2020, 04:46 AM   #3
Big Clucker
Nuginity's Avatar
Join Date: Feb 2020
Location: Indonesia (Jakarta)
Posts: 59
Reputation: 2
Default Re: MySQL save while Kick/Ban

hmmm try to "UPDATE" or "INSERT INTO" banned database, everytime you ban the player. Actually this method its very safe than saving ban data every player disconnect
Nusantara Freeroam
Current Stage : ALPHA
We Need an Indonesian's Scripter now!
Nuginity is offline   Reply With Quote
Old 30/03/2020, 06:57 AM   #4
Little Clucker
Join Date: Sep 2019
Location: Indonesia
Posts: 18
Reputation: 0
Default Re: MySQL save while Kick/Ban

Why not try to, Make a timer when the player will be kicked or banned, before that save the call save account
  • Kick(playerid);
  • Ban(playerid);
brianrestup is offline   Reply With Quote
Old 30/03/2020, 12:41 PM   #5
Big Clucker
GeorgeLimit's Avatar
Join Date: Mar 2018
Location: Jawa Timur, Indonesia
Posts: 150
Reputation: 0
Default Re: MySQL save while Kick/Ban

Maybe this can solved
new kickuser;
CMD:kick(playerid, params[])
    if(params != INVALID_PLAYER_ID || params != playerid)
        if(sscanf(params, "i", kickuser)){
            //Your save Callback or Code
            SetTimerEx("KickUser",10000,0,"i",kickuser); //10 Second is better with callback
     return 1;
forward KickUser(kickuser);
public KickUser(kickuser)
     return 1;
GeorgeLimit is online now   Reply With Quote

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
save kick and ban Spawe Scripting Help 6 16/11/2018 05:34 PM
Cash don't save until Kick. CrossOv3r Scripting Help 2 26/09/2012 03:46 AM
Force Save On Kick Abreezy Scripting Help 1 16/01/2012 01:46 AM
Dini don't save the player file after a kick. Yakushi Icefox Help Archive 2 15/07/2011 06:40 PM
mysql kick log GeonMake Help Archive 4 17/06/2011 07:03 PM

All times are GMT. The time now is 05:54 AM.

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