public OnPlayerConnect(playerid)
{
new clean[PlayerInfo]; Playa[playerid] = clean;
Playa[playerid][Vehicle] = -1; Playa[playerid][Level] = 1; Playa[playerid][Respect] = 1;
String[0] = '\0';
format(String, 128, "{FFFFFF}Welcome, {FF0000}%s{FFFFFF}!\nPlease select your language wich you will use to play on this server", SendName(playerid));
ShowPlayerDialog(playerid, AccD, DIALOG_STYLE_MSGBOX, "Language", String, "Romana", "English");
return 1;
}
case AccD: //Language
{
if(response)
{
Playa[playerid][Language] = 1; msQuery[0] = '\0';
mysql_format(Velocity, msQuery, 256, "SELECT * FROM `accounts` WHERE `Name` = '%s' LIMIT 1", SendName(playerid));
mysql_tquery(Velocity, msQuery, "CheckPlayerLogin", "d", playerid);
}
else
{
Playa[playerid][Language] = 0; msQuery[0] = '\0';
mysql_format(Velocity, msQuery, 256, "SELECT * FROM `accounts` WHERE `Name` = '%s' LIMIT 1", SendName(playerid));
mysql_tquery(Velocity, msQuery, "CheckPlayerLogin", "d", playerid);
}
Playa[playerid][Respect] = cache_get_field_content_int(0, "Respect", Velocity);
[17:45:50 05/08/18] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Respect", connection: 1
[17:45:50 05/08/18] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Respect", data: "1"
Playa[playerid][Level] = cache_get_field_content_int(0, "Level", Velocity);
[17:45:50 05/08/18] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Level", connection: 1
[17:45:50 05/08/18] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Level", data: "1"
format(String2, 150, "{FFFFFF}Level: {00FF00}%d\n", Playa[playerid][Level]);
strcat(String, String2);
format(String2, 150, "{FFFFFF}Respect Points: {00FF00}%d{FFFFFF}/{00FF00}%d\n\n", Playa[playerid][Respect], Playa[playerid][Level] * 3);
strcat(String, String2);
strcat(String, "{FFFFFF}For more statistics, use {FF0000}/stats{FFFFFF}.\n\n");
msQuery[0] = '\0'; new h, m, s; TotalGameTime(playerid, h, m, s);
//----------------------------------------------------------------------
mysql_format(Velocity, msQuery, 2048, "UPDATE `accounts` SET `Level` = '%d', `Respect` = '%d', `Admin` = '%d', `VIP` = '%d', `Hours` = '%d', `Minutes` = '%d', `Coins` = '%d',\
`Money` = '%d', `Score` = '%d', `Day` = '%d', `Month` = '%d', `Year` = '%d' WHERE `ID` = '%d'",
Playa[playerid][Level], Playa[playerid][Respect], Playa[playerid][Admin], Playa[playerid][Vip], h, m, Playa[playerid][Coins],
GetPlayerMoney(playerid), GetPlayerScore(playerid), Playa[playerid][Day], Playa[playerid][Month], Playa[playerid][Year], Playa[playerid][ID][1]);
mysql_pquery(Velocity, msQuery);
mysql_format you don't need to use this, when you dont update string value
|