26.04.2011, 18:02
Yeah, of course:
Код:
public SavePlayerStats(playerid) { new Float:hp; new EscapeName[MAX_PLAYER_NAME]; new Float:am; new Float:saveX[MAX_PLAYERS], Float:saveY[MAX_PLAYERS], Float:saveZ[MAX_PLAYERS]; GetPlayerName(playerid, pname, sizeof (pname)); GetPlayerIp(playerid, ip, 16); GetPlayerHealth(playerid,hp); GetPlayerArmour(playerid,am); GetPlayerPos(playerid, saveX[playerid], saveY[playerid], saveZ[playerid]); pInfo[playerid][money] = GetPlayerMoneyEx(playerid); SaveWeaponsToFile(playerid); mysql_real_escape_string(pname, EscapeName); format(file, sizeof file,"UPDATE `users` SET `adminlevel` = '%d', `money` = '%d', `license` = '%d', `weaponlicense` = '%d', `flylicense` = '%d', `job` = '%d' WHERE `username` = '%s'",pInfo[playerid][adminlevel],pInfo[playerid][money],pInfo[playerid][license],pInfo[playerid][weaponlic],pInfo[playerid][flylic],gTeam[playerid],EscapeName); mysql_query(file); format(file, sizeof file,"UPDATE `users` SET `faction` = '%d', `rank` = '%d', `skin` = '%d', `health` = '%f', `armour` = '%f', `bankmoney` = '%d', `fightstyle` = '%d', `chainlock` = '%d', `cigarets` = '%d' WHERE `username` = '%s'",pInfo[playerid][faction],pInfo[playerid][rank],pInfo[playerid][skin],floatround(hp),floatround(am),pInfo[playerid][bankmoney],pInfo[playerid][fightstyle],pInfo[playerid][chainlock],pInfo[playerid][cigarets],EscapeName); mysql_query(file); mysql_store_result(); format(file, sizeof file,"UPDATE `users` SET `beer` = '%d', `sprunk` = '%d', `weed` = '%d', `seeds` = '%d', `prepaid` = '%d', `jerrycan` = '%d', `cellphone` = '%d', `phonenum` = '%d', `dlock` = '%d' WHERE `username` = '%s'",pInfo[playerid][beer],pInfo[playerid][sprunk],pInfo[playerid][weed],pInfo[playerid][seeds],pInfo[playerid][prepaid],pInfo[playerid][jerrycan],pInfo[playerid][havephone],pInfo[playerid][phonenum],pInfo[playerid][dlock],EscapeName); mysql_query(file); mysql_store_result(); format(file, sizeof file,"UPDATE `users` SET `cellphone` = '%d', `weed` = '%d', `seeds` = '%d', `jerrycan` = '%d', `prepaid` = '%d', `dlock` = '%d' WHERE `username` = '%s'",pInfo[playerid][havephone],pInfo[playerid][weed],pInfo[playerid][seeds],pInfo[playerid][jerrycan],pInfo[playerid][prepaid],pInfo[playerid][dlock],EscapeName); mysql_query(file); mysql_store_result(); format(file, sizeof file,"UPDATE `users` SET `gps` = '%d', `warns` = '%d', `vip` = '%d', `kills` = '%d', `deaths` = '%d', `spawnX` = '%f', `spawnY` = '%f', `spawnZ` = '%f' WHERE `username` = '%s'",pInfo[playerid][GPS],pInfo[playerid][warns],pInfo[playerid][VIP],pInfo[playerid][kills],pInfo[playerid][deaths],saveX[playerid],saveY[playerid],saveZ[playerid],EscapeName); mysql_query(file); mysql_free_result(); format(file, sizeof file,"UPDATE `users` SET `jailedtime` = '%d', `ajailedtime` = '%d' WHERE `username` = '%s'",JailEndTime[playerid]-GetTickCount(),JailEndTime[playerid]-GetTickCount(),EscapeName); mysql_query(file); mysql_free_result(); }