Not updating
#1

Hey guys i have a new gamemode but the stats are not updating mysql version ins R41-2

Код HTML:
enum pInfo
{
	pSQLID, pName[MAX_PLAYERS], pPassword, pAge, pAdmin, pHelper, pMoney
};
new PlayerInfo[MAX_PLAYERS][pInfo];

public Update(playerid, type)
{
	if(IsPlayerConnected(playerid))
	{
		new query1[255];
		{
			switch(type)
			{
				case pAdminx:
				{
					mysql_format(g_Sql, query1, sizeof(query1), "UPDATE `users` SET `Admin` = '%d' WHERE `ID` = '%d'", PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pSQLID]);
					mysql_tquery(g_Sql, query1, "", "");
				}
				case pMoneyx:
				{
					mysql_format(g_Sql, query1, sizeof(query1), "UPDATE `users` SET `Money` = '%d' WHERE `Name` = '%s'", PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pName]);
					mysql_tquery(g_Sql, query1, "", "");
				}
			}
		}
	}
	return 1;
}
And the command

Код HTML:
CMD:makeadmin(playerid, params[])
{
    new strglobal[856];
	//if(PlayerInfo[playerid][pAdmin] < 6) return SCM(playerid, -1, "Nu ai gradul necesar pentru a folosi aceasta comanda.");
	new giveplayerid, adminlevel;
	if(sscanf(params, "ui", giveplayerid, adminlevel)) return SCM(playerid, -1, "/makeadmin <Name/PlayerID> <0-5>");
	if(giveplayerid == INVALID_PLAYER_ID) return SCM(playerid, -1, "/makeadmin <Name/PlayerID> <0-5>");
    if(adminlevel > 0 || adminlevel < 6)
    {
		format(strglobal, sizeof(strglobal), "* Congratulations %s for becoming Administrator Rank %d.", GetName(giveplayerid), adminlevel);
		SCMALL(-1, strglobal);
		format(strglobal, sizeof(strglobal), "%s has made %s a admin (%d).", GetName(playerid), GetName(giveplayerid), adminlevel);
		SCM(playerid, -1, strglobal);
		new text[456];
		format(text,456, "AdmBot: {FFFFFF}%s has made %s a admin (%d).", GetName(playerid), GetName(giveplayerid), adminlevel);
		SCM(giveplayerid, -1, text);
		SCM(giveplayerid, -1, "AdmBot: {FFFFFF}You can use [/ah] for commands list.");
	}
 	if(adminlevel == 0)
    {
		format(strglobal, sizeof(strglobal), "%s stripped %s of his admin rank.", GetName(playerid), GetName(giveplayerid));
		SCM(playerid, -1, strglobal);
		new text[456];
		format(text,456, "AdmBot: {FFFFFF}%s stripped %s of his admin rank.", GetName(playerid), GetName(giveplayerid));
		SCM(giveplayerid, -1, text);
	}
	PlayerInfo[giveplayerid][pAdmin] = adminlevel;
	Update(giveplayerid, pAdminx);
	PlayerInfo[giveplayerid][pMoney] = 14434;
	Update(giveplayerid, pMoneyx);
	//mysql_format(g_Sql, query, sizeof(query), "UPDATE `users` SET `Admin` = '%d' WHERE `Name` = '%e'", adminlevel, GetName(toplayerid));
	//mysql_query(g_Sql, query);
	return 1;
}
it can update with this only

Код HTML:
//mysql_format(g_Sql, query, sizeof(query), "UPDATE `users` SET `Admin` = '%d' WHERE `Name` = '%e'", adminlevel, GetName(toplayerid));
	//mysql_query(g_Sql, query);
but not with this

Код HTML:
PlayerInfo[giveplayerid][pAdmin] = adminlevel;
	Update(giveplayerid, pAdminx);
Reply


Messages In This Thread
Not updating - by StR_MaRy - 17.08.2017, 00:31
Re: Not updating - by 10MIN - 17.08.2017, 13:22
Re: Not updating - by StR_MaRy - 17.08.2017, 13:41
Re: Not updating - by JesterlJoker - 17.08.2017, 14:05
Re: Not updating - by StR_MaRy - 17.08.2017, 14:39

Forum Jump:


Users browsing this thread: 1 Guest(s)