03.01.2013, 20:35
Quote:
That's how i update a player's info:
Код:
. . format(l_string,sizeof(l_string), "UPDATE `players` SET `PlayerLevel` = '%d' WHERE `Name` = '%s'",PlayerInfo[playerid][pLevel],name); mysql_function_query(dbHandle, l_string, false, "", ""); format(l_string,sizeof(l_string), "UPDATE `players` SET `AdminLevel` = '%d' WHERE `Name` = '%s'",PlayerInfo[playerid][pAdmin],name); mysql_function_query(dbHandle, l_string, false, "", ""); format(l_string,sizeof(l_string), "UPDATE `players` SET `HelperLevel` = '%d' WHERE `Name` = '%s'",PlayerInfo[playerid][pHelper],name); mysql_function_query(dbHandle, l_string, false, "", ""); format(l_string,sizeof(l_string), "UPDATE `players` SET `DonateRank` = '%d' WHERE `Name` = '%s'",PlayerInfo[playerid][pDonateRank],name); mysql_function_query(dbHandle, l_string, false, "", ""); format(l_string,sizeof(l_string), "UPDATE `players` SET `UpgradePoints` = '%d' WHERE `Name` = '%s'",PlayerInfo[playerid][gPupgrade],name); mysql_function_query(dbHandle, l_string, false, "", ""); . . |
pawn Код:
format(l_string,sizeof l_string, "UPDATE `players` SET\
`PlayerLevel` = %d,\
`AdminLevel = %d,\
`HelperLevel` = %d,\
`DonateRank` = %d,\
`UpgradePoints` = %d\
`WHERE `Name` = '%s'",
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pHelper],
PlayerInfo[playerid][pDonateRank],
PlayerInfo[playerid][gPupgrade],
name
);
mysql_function_query(dbHandle, l_string, false, "", "");