SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 27/05/2020, 11:02 AM   #11
mems
Big Clucker
 
Join Date: Oct 2019
Posts: 142
Reputation: 0
Default Re: Data being reset when connecting to server.

bump
mems is offline   Reply With Quote
Old 27/05/2020, 06:01 PM   #12
mems
Big Clucker
 
Join Date: Oct 2019
Posts: 142
Reputation: 0
Default Re: Data being reset when connecting to server.

bump..
mems is offline   Reply With Quote
Old 27/05/2020, 09:07 PM   #13
Dignity
High-roller
 
Dignity's Avatar
 
Join Date: May 2013
Location: Belgium
Posts: 1,657
Reputation: 1205
Default Re: Data being reset when connecting to server.

Quote:
Originally Posted by mems View Post
MYSQL is a million times harder than y ini, and no, still won't prefer mysql. any other ideas on how to fix this thing?
i literally cannot save any data...
MySQL is not harder than Y_INI at all... I have no idea why you would choose an inferior method over the clearly superior one. You wouldn't have this problem with MySQL to begin with.

That's just stupid.

On a different note, you showed you "LoadUser_data" function but where is it being called? Certainly nowhere in the code your shared.
Dignity is offline   Reply With Quote
Old 27/05/2020, 09:12 PM   #14
mems
Big Clucker
 
Join Date: Oct 2019
Posts: 142
Reputation: 0
Default Re: Data being reset when connecting to server.

Quote:
Originally Posted by Dignity View Post
MySQL is not harder than Y_INI at all... I have no idea why you would choose an inferior method over the clearly superior one. You wouldn't have this problem with MySQL to begin with.

That's just stupid.

On a different note, you showed you "LoadUser_data" function but where is it being called? Certainly nowhere in the code your shared.
it's being called on the "DIALOG_LOGIN" part. (OnDialogResponse)
mems is offline   Reply With Quote
Old 28/05/2020, 08:45 AM   #15
mems
Big Clucker
 
Join Date: Oct 2019
Posts: 142
Reputation: 0
Default Re: Data being reset when connecting to server.

bump
mems is offline   Reply With Quote
Old 28/05/2020, 11:21 AM   #16
mems
Big Clucker
 
Join Date: Oct 2019
Posts: 142
Reputation: 0
Default Re: Data being reset when connecting to server.

so i've spent a bit of my time creating another gamemode with the same Y_INI stuff, but with different commands, added data saving on onplayerdisconnect, copied the onplayerconnect code from my main gamemode, then pasted it to the new gamemode, but nothing seems to work out. is YSI version the reason, i really want to know
mems is offline   Reply With Quote
Old 28/05/2020, 03:19 PM   #17
mems
Big Clucker
 
Join Date: Oct 2019
Posts: 142
Reputation: 0
Default Re: Data being reset when connecting to server.

bump........
mems is offline   Reply With Quote
Old 28/05/2020, 06:07 PM   #18
mems
Big Clucker
 
Join Date: Oct 2019
Posts: 142
Reputation: 0
Default Re: Data being reset when connecting to server.

alright too much bumping, this is the last bump....
mems is offline   Reply With Quote
Old 29/05/2020, 10:16 PM   #19
mems
Big Clucker
 
Join Date: Oct 2019
Posts: 142
Reputation: 0
Default Re: Data being reset when connecting to server.

Quote:
Originally Posted by Symon View Post
I don't understand, why are you resetting data when a player connect to reload them after login?

I suggest you to move the reset code you have in OnPlayerConnect and place it BEFORE the LoadUserData in the login data. Here to be precise:

pawn Code:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);

Place this code:

pawn Code:
PlayerInfo[playerid][IP] = 0;
    PlayerInfo[playerid][AdminLevel] = 0;
    PlayerInfo[playerid][Money] = 0;
    PlayerInfo[playerid][Score] = 0;
    PlayerInfo[playerid][Kills] = 0;
    PlayerInfo[playerid][Deaths] = 0;
    PlayerInfo[playerid][LoginAttempts] = 0;

Above the one i posted and remove it from OnPlayerConnect.
and yes i just tried your way, which again does not work. whatever i do just won't load anything.. is it YSI's y_ini, is it the code, do i need to down/upgrade YSI version, tell me. I am literally joining the server like im registering. I am sure it could be YSI because last time the Register + Login + OnPlayerConnect codes were untouched until I had started another thread mentioning weapon-config problems, which the solution was to download a better YSI version. Normally these codes are right, everything works normally, but something occured with the YSI includes or something, i am pretty sure........
mems is offline   Reply With Quote
Old 30/05/2020, 09:54 AM   #20
mems
Big Clucker
 
Join Date: Oct 2019
Posts: 142
Reputation: 0
Default Re: Data being reset when connecting to server.

should i change YSI version, if so, what version? which version works properly without any damn issues
mems 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
Reset Data SoFahim Scripting Help 5 29/08/2015 01:40 PM
Reset data (pickup, dynamic area) qmnty Scripting Help 0 12/01/2015 02:13 AM
Reset Weapon Data hoangtn219 Scripting Help 6 12/12/2014 01:49 PM
Reset all mysql data when I write /rcon gmx Dystans Scripting Help 2 14/04/2013 05:44 PM
Reset array data Killer#Mummy Scripting Help 2 14/08/2012 04:02 PM


All times are GMT. The time now is 11:25 PM.


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