MYSQL WONT SAVE PLAYER STATS
#1

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.
Reply
#2

Post code..please
Reply
#3

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

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);
}
Reply
#5

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

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

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);
}
}
Reply
#7

Okay, I consider you're stupid.
Reply
#8

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

XD
Reply
#9

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 -.-
Reply
#10

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)