Need help a bit
#1

sorry for the inconvenience but I need help a bit
my problem is that when player left the server it doesn't save the player stats and I am using MySQL and threading the queries

and I am using blueg's r33 plugin.

the code:
Код:
public OnAccountLoad(playerid)
{
 PlayerInfo[playerid][Score] = cache_get_field_content_int(0, "Score");
 PlayerInfo[playerid][Cash] = cache_get_field_content_int(0, "Cash");
 PlayerInfo[playerid][Level] = cache_get_field_content_int(0, "Level");
 PlayerInfo[playerid][Kills] = cache_get_field_content_int(0, "Kills");
 PlayerInfo[playerid][Deaths] = cache_get_field_content_int(0, "Deaths");
 PlayerInfo[playerid][pMute] = cache_get_field_content_int(0, "pMute");
 PlayerInfo[playerid][Warns] = cache_get_field_content_int(0, "Warns");
 GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
 SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
 JustLogged[playerid] = 1;
 Logged[playerid] = 1;
 SendClientMessage(playerid, COLOR_RED, "{FF0000}[UF] {BDBDBD}» {fde2c3}You have been successfully {00FF00}Logged-In!");
 return 1;
 }
MySQL_log :

Код:
[16:25:25] [DEBUG] mysql_format - connection: 1, len: 300, format: "UPDATE `Accounts` SET Score=%d, Cash=%d, Level=%d, Kills=%d, Deaths=%d, muted=%d, Warns=%d WHERE Name='%s'"
[16:25:25] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `Accounts` SET Score=2, Cash=49540, Level=0, Kills=0, Dea", callback: "(null)", format: "(null)"
[16:25:25] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[16:25:25] [DEBUG] mysql_tquery - scheduling query "UPDATE `Accounts` SET Score=2, Cash=49540, Level=0, Kills=0, Deaths=0, muted=0, Warns=0 WHERE Name='sptzodric'"..
[16:25:25] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
[16:25:25] [DEBUG] CMySQLQuery::Execute[()] - query was successful
[16:25:25] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving
[16:25:25] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
[16:25:25] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
pls help
Reply
#2

pls anyone help ?
Reply
#3

Show the code which save the data in the table
Reply
#4

Код:
case DIALOG_REGISTER: 
	{
	new pname[24], plIP[15];
    GetPlayerName(playerid, pname, 24);
    GetPlayerIp(playerid, plIP, 15);
	if(!response) return Kick(playerid); 
	if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "In order to play, you need to register.\nYour password must be at least 6 characters long!", "Register", "Quit");
	new query[300];
	WP_Hash(PlayerInfo[playerid][Password], 129, inputtext);
	mysql_format(mysql, query, sizeof(query), "INSERT INTO `Accounts` (`Name`, `Password`, `RegisterDate`, `IP`) VALUES('%s', '%s', NOW(), '%s')", pname, PlayerInfo[playerid][Password], plIP);
	mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
	Logged[playerid] = 1;
	}
here when player register
Reply
#5

pls anyone ?
Reply
#6

You have to use SELECT query in function mysql_query

I prefer to use normal MySQL functions - mysql_query, mysql_store_result, mysql_fetch_row - I am using them in my gamemode and works fine
Reply
#7

Quote:
Originally Posted by ball
Посмотреть сообщение
You have to use SELECT query in function mysql_query

I prefer to use normal MySQL functions - mysql_query, mysql_store_result, mysql_fetch_row - I am using them in my gamemode and works fine
You are using version r6 and you should update your mysql plugin to latest version.
Reply
#8

k thank you so much guys worked thanks again.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)