SA-MP Forums Archive
MYSQL WONT SAVE PLAYER STATS - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MYSQL WONT SAVE PLAYER STATS (/showthread.php?tid=593704)



MYSQL WONT SAVE PLAYER STATS - xDanielx - 08.11.2015

Hi guys,i got old database of players and when they login with same name and password like before,their stats there,but if that player gets more score,xp,money or anything ( same with new player) nothing will save....So when new players comes in server,his name stays registered but score and other stuff no.Please help.


Re: MYSQL WONT SAVE PLAYER STATS - Ritzy2K - 08.11.2015

Post code..please


Re: MYSQL WONT SAVE PLAYER STATS - Riddick94 - 08.11.2015

Show the code where you have saving player's data (if you have one, that's a first question).


Re: MYSQL WONT SAVE PLAYER STATS - xDanielx - 08.11.2015

Is this?Or maybe i dont have it


public OnPlayerDisconnect(playerid, reason)
{
new namez[MAX_PLAYER_NAME];
if(IsValidLineSegment(Rope[playerid])) DestroyLineSegment(Rope[playerid]);
Rappel[playerid] = 0;
IsRappelling[playerid] = 0;
KillTimer(LandingChecker[playerid]);
KillTimer(playerData[playerid][skydiveTimer]);
GetPlayerName(playerid, namez, MAX_PLAYER_NAME);
if(FindIP(namez))
{
return 1;
}
SetPlayerColor(playerid, 0xFFFFFFFF);
if(playerData[playerid][playerLoggedIn])
{
savePlayerStats(playerid);
}


Re: MYSQL WONT SAVE PLAYER STATS - Riddick94 - 08.11.2015

Put your code in BBCode tags [.pawn] [./pawn] (without the dots).

Show us "savePlayerStats(playerid)" stock function from your script.


Re: MYSQL WONT SAVE PLAYER STATS - xDanielx - 08.11.2015

I HOPE THIS IS WHAT U ASKED.....

public OnPlayerDisconnect(playerid, reason)
{
new namez[MAX_PLAYER_NAME];
if(IsValidLineSegment(Rope[playerid])) DestroyLineSegment(Rope[playerid]);
Rappel[playerid] = 0;
IsRappelling[playerid] = 0;
KillTimer(LandingChecker[playerid]);
KillTimer(playerData[playerid][skydiveTimer]);
GetPlayerName(playerid, namez, MAX_PLAYER_NAME);
if(FindIP(namez))
{
return 1;
}
SetPlayerColor(playerid, 0xFFFFFFFF);
if(playerData[playerid][playerLoggedIn])
{
savePlayerStats(playerid);
}

if(reason == 1) // Manual game-quit.
{
new administratorAlert[128];

if(playerData[playerid][playerIsTazed])
{
format(administratorAlert, sizeof(administratorAlert), "{C73E3E}[AVOID-DETECTION] {FFFFFF}%s(%i) quit the game while tazed.", playerData[playerid][playerNamee], playerid);
adminchat(COLOR_WHITE, administratorAlert);
}
else if(playerData[playerid][playerIsCuffed])
{
format(administratorAlert, sizeof(administratorAlert), "{C73E3E}[AVOID-DETECTION] {FFFFFF}%s(%i) quit the game while cuffed.", playerData[playerid][playerNamee], playerid);
adminchat(COLOR_WHITE, administratorAlert);
}
else if(playerData[playerid][playerIsTied])
{
format(administratorAlert, sizeof(administratorAlert), "{C73E3E}[AVOID-DETECTION] {FFFFFF}%s(%i) quit the game while tied.", playerData[playerid][playerNamee], playerid);
adminchat(COLOR_WHITE, administratorAlert);
}
}


Re: MYSQL WONT SAVE PLAYER STATS - Riddick94 - 08.11.2015

Okay, I consider you're stupid.


Re: MYSQL WONT SAVE PLAYER STATS - Ritzy2K - 08.11.2015

This is what will happen if you download a script and feel like a coder

XD


Re: MYSQL WONT SAVE PLAYER STATS - xDanielx - 08.11.2015

Dude im not stupid im just not into samp scripting,my friend gave it to me...If i know problem i will solve it alone -.-


Re: MYSQL WONT SAVE PLAYER STATS - xDanielx - 08.11.2015

Quote:
Originally Posted by [ND]xXZeusXx.
Посмотреть сообщение
This is what will happen if you download a script and feel like a coder

XD
I never said that im coder,i asked for help,i got bad words..Nice (Y)