12.01.2017, 21:21
Hello
i got some issues using lastest version of mysql
Issues:
// example :
output:
also it's logging with any password
so
has no effect
i don't know why :/ others functions:
this message not sended to players
logs:
after player spawn there nothing else so MySQLValided not called :/
i got some issues using lastest version of mysql
Issues:
// example :
PHP код:
public onMySQLCheck(playerid)
{
new
rows;
cache_get_row_count(rows);
if(rows == 1)
{
cache_get_value_name(0, "Password", PlayerInfo[playerid][Password]);
ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Login", "Welcome !\nthis account already registred. Please fill in your password:", "Login", "Quit");
return 1;
}
else
{
new RegisterDS[1024];
format(RegisterDS, sizeof(RegisterDS),""W"Welcome to San Andreas Playground"YE"%s\n\n", GetName(playerid));
strcat(RegisterDS,""W"You are not registered yet on this server,\n");
strcat(RegisterDS,""W"Enter your password below to register\n");
strcat(RegisterDS,""W"By registering all your statistics will be saved in server database!\n\n");
strcat(RegisterDS,""R"Info"W":\n");
strcat(RegisterDS,""R"- "W"Your password must contain at least 4 characters\n");
strcat(RegisterDS,""R"- "W"Remember your password, you will need it for your next login\n");
ShowPlayerDialog(playerid, Register, DIALOG_STYLE_PASSWORD, ""R" "W"VL Register Account", RegisterDS, "Register","" );
}
return 1;
}
// register dialog work fine just this not work
case Login:
{
if(!response) Kick(playerid);
new
query[100],
playername[MAX_PLAYER_NAME];
printf("Test with account Variable inputext = %s | Variable PlayerPassword = %s", inputtext, PlayerInfo[playerid][Password]);
if(!strcmp(inputtext, PlayerInfo[playerid][Password], true))
{
mysql_format(register, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%e' LIMIT 1", playername);
mysql_tquery(register, query, "OnMySQLValided", "i", playerid);
}
else
{
SendClientMessage(playerid, -1, "You have specified an incorrect password!");
ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Login", "Welcome !\nthis account already registred. Please fill in your password:", "Login", "Quit");
}
}
PHP код:
Test with account Variable inputext = yaa | Variable PlayerPassword =
so
PHP код:
if(!strcmp(inputtext, PlayerInfo[playerid][Password], true))
i don't know why :/ others functions:
PHP код:
public OnMySQLValided(playerid)
{
new rows, fields;
cache_get_field_count(fields);
cache_get_row_count(rows);
if(rows == 1)
{
cache_get_value_name_int(0, "Admin", PlayerInfo[playerid][Admin]);
cache_get_value_name_int(0, "VIP", PlayerInfo[playerid][VIP]);
cache_get_value_name_int(0, "Money", PlayerInfo[playerid][Money]);
cache_get_value_name(0, "DeathMessage", PlayerInfo[playerid][pDM]);
cache_get_value_name_int(0, "Deaths", PlayerInfo[playerid][pDeaths]);
cache_get_value_name_int(0, "Kills", PlayerInfo[playerid][pKills]);
cache_get_value_name_int(0, "Bans", PlayerInfo[playerid][pBans]);
cache_get_value_name_int(0, "Kicks", PlayerInfo[playerid][pKicks]);
cache_get_value_name_int(0, "Car", MyCar[playerid]);
new query[150];
mysql_format(register, query, sizeof(query), "SELECT * FROM `accounts_2` WHERE `Name` = '%s' LIMIT 1", GetName(playerid));
mysql_tquery(register, query, "LoadPlayersHours", "i", playerid);
}
return 1;
}
public LoadPlayersHours(playerid)
{
new rows, fields;
cache_get_field_count(fields);
cache_get_row_count(rows);
if(rows == 1)
{
cache_get_value_name_int(0, "Hours", PlayerInfo[playerid][pHours]);
cache_get_value_name_int(0, "Minutes", PlayerInfo[playerid][pMin]);
cache_get_value_name_int(0, "BankValue", BankInfo[playerid][Deposit]);
cache_get_value_name_int(0, "SkinID", PlayerInfo[playerid][pSkin]);
cache_get_value_name_int(0, "Reaction", PlayerInfo[playerid][Reaction]);
}
GivePlayerMoney(playerid, PlayerInfo[playerid][Money]);
SendClientMessage(playerid, -1, "You have successfully logged in.");
IsLoggedIn[playerid] = 1;
return 1;
}
PHP код:
SendClientMessage(playerid, -1, "You have successfully logged in.");
PHP код:
[23:13:40] [DEBUG] CResultSet::Create(connection=0x99bc858, query_str='SELECT * FROM `accounts` WHERE `Name` = '' LIMIT 1')
[23:13:40] [DEBUG] created new resultset '0x9d2ce80'
[23:13:40] [DEBUG] fetched MySQL result '0x9d02158'
[23:13:40] [DEBUG] allocated 0 bytes for PAWN result
[23:13:40] [DEBUG] CCallback::Execute(amx=0x999c558, index=98, num_params=1)
[23:13:40] [INFO] Executing callback 'OnMySQLValided' with 1 parameter...
[23:13:40] [DEBUG] processing internal specifier 'c'
[23:13:40] [DEBUG] pushed value '0' onto AMX stack
[23:13:40] [DEBUG] executing AMX callback with index '98'
[23:13:40] [DEBUG] cache_get_field_count(0xF4A801F8) (D:\pawn-editor\include\SAPData\Server\Functions.pwn:45)
[23:13:40] [DEBUG] cache_get_field_count: return value: '1' (D:\pawn-editor\include\SAPData\Server\Functions.pwn:45)
[23:13:40] [DEBUG] cache_get_row_count(0xF4A801FC) (D:\pawn-editor\include\SAPData\Server\Functions.pwn:46)
[23:13:40] [DEBUG] cache_get_row_count: return value: '1' (D:\pawn-editor\include\SAPData\Server\Functions.pwn:46)
[23:13:40] [DEBUG] AMX callback executed with error '0'
[23:13:40] [INFO] Callback successfully executed.