23.02.2015, 21:44
You can also try to use "printf" statements all over the place to print some debug info to the server console.
You might find the problem that way.
During your OnAccountCheck and OnAccountLoad callbacks, print the data and also the playerid.
That's how I usually find most problems.
And so on.
If everything prints correctly (when you used the variables where you store the data), your loading system is fine and you need to look elsewhere (and possibly add some other printf statements everywhere you want to check your functions).
If it doesn't print correctly, you need to check your loading system.
You might find the problem that way.
During your OnAccountCheck and OnAccountLoad callbacks, print the data and also the playerid.
That's how I usually find most problems.
pawn Код:
forward OnAccountCheck(playerid);
public OnAccountCheck(playerid)
{
printf("OnAccountCheck for playerid: %i", playerid);
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows)
{
cache_get_field_content(0, "Password", PlayerInfo[playerid][pPass], mysql, 129);
printf("Password: %s", PlayerInfo[playerid][pPass]);
PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID");
printf("ID: %i", PlayerInfo[playerid][pID]);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Crazy Street Wars", "{FFFFFF}Welcome back to {F81414}Crazy Street Wars.{FFFFFF}\nType in your password below to login.", "Login", "Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Crazy Street Wars", "{FFFFFF} Welcome to {F81414}Crazy Street Wars!{FFFFFF}\nType in your desired password below to register. ", "Register", "Quit");
}
return 1;
}
pawn Код:
forward OnAccountLoad(playerid);
public OnAccountLoad(playerid)
{
printf("OnAccountLoad for playerid: %i", playerid);
PlayerInfo[playerid][pMoney] = cache_get_field_content_int(0, "Money");
printf("Money: %i", PlayerInfo[playerid][pMoney]);
PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
printf("Adminlevel: %i", PlayerInfo[playerid][pAdmin]);
PlayerInfo[playerid][pVip] = cache_get_field_content_int(0, "Vip");
PlayerInfo[playerid][pKills] = cache_get_field_content_int(0, "Kills");
PlayerInfo[playerid][pDeaths] = cache_get_field_content_int(0, "Deaths");
PlayerInfo[playerid][pScore] = cache_get_field_content_int(0, "Score");
PlayerInfo[playerid][pRank] = cache_get_field_content_int(0, "Rank");
PlayerInfo[playerid][pBanned] = cache_get_field_content_int(0, "Banned");
PlayerInfo[playerid][pWarns] = cache_get_field_content_int(0, "Warns");
PlayerInfo[playerid][pVW] = cache_get_field_content_int(0, "VW");
PlayerInfo[playerid][pInt] = cache_get_field_content_int(0, "Interior");
PlayerInfo[playerid][pMin] = cache_get_field_content_int(0, "Min");
PlayerInfo[playerid][pHour] = cache_get_field_content_int(0, "Hours");
PlayerInfo[playerid][pPM] = cache_get_field_content_int(0, "PM");
PlayerInfo[playerid][pColor] = cache_get_field_content_int(0, "Color");
PlayerInfo[playerid][pTurfs] = cache_get_field_content_int(0, "Turfs");
PlayerInfo[playerid][pClan] = cache_get_field_content_int(0, "Clan");
PlayerInfo[playerid][pClRank] = cache_get_field_content_int(0, "ClRank");
PlayerInfo[playerid][pClLeader] = cache_get_field_content_int(0, "ClLeader");
PlayerInfo[playerid][pInvited] = cache_get_field_content_int(0, "Invited");
PlayerInfo[playerid][pInviting] = cache_get_field_content_int(0, "Inviting");
return 1;
}
If everything prints correctly (when you used the variables where you store the data), your loading system is fine and you need to look elsewhere (and possibly add some other printf statements everywhere you want to check your functions).
If it doesn't print correctly, you need to check your loading system.