28.04.2015, 19:46
Код:
cache_get_field_content_int(row, const field_name[], connectionHandle = 1)
Код:
PlayerInfo[playerid][pSpawn] = cache_get_field_content_int(0, "Spawn"); PlayerInfo[playerid][pGender] = cache_get_field_content_int(0, "Gender"); PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level"); PlayerInfo[playerid][pEntered] = cache_get_field_content_int(0, "Entered"); PlayerInfo[playerid][pMinutes] = cache_get_field_content_int(0, "Minutes"); PlayerInfo[playerid][pTMinutes] = cache_get_field_content_int(0, "TMinutes"); PlayerInfo[playerid][pHours] = cache_get_field_content_int(0, "Hours"); PlayerInfo[playerid][pAge] = cache_get_field_content_int(0, "Age"); PlayerInfo[playerid][pADMute] = cache_get_field_content_int(0, "ADMute"); PlayerInfo[playerid][pModel] = cache_get_field_content_int(0, "Model"); PlayerInfo[playerid][pModel1] = cache_get_field_content_int(0, "Model1"); PlayerInfo[playerid][pModel2] = cache_get_field_content_int(0, "Model2"); PlayerInfo[playerid][pModel3] = cache_get_field_content_int(0, "Model3"); PlayerInfo[playerid][pMapper] = cache_get_field_content_int(0, "Mapper"); PlayerInfo[playerid][pBanned] = cache_get_field_content_int(0, "Banned"); PlayerInfo[playerid][pNumber] = cache_get_field_content_int(0, "Number"); PlayerInfo[playerid][pKill] = cache_get_field_content_int(0, "Kill"); PlayerInfo[playerid][pDeath] = cache_get_field_content_int(0, "Death"); PlayerInfo[playerid][pInt] = cache_get_field_content_int(0, "Interior"); PlayerInfo[playerid][pVW] = cache_get_field_content_int(0, "Virtual World");
EDIT:
Also, is this the most efficient way of saving everything?
Код:
mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `VehVW`=%d, `WalkStyle`=%d, `Fac`=%d, `FacRank`=%d, `FacLeader`=%d, 'FacDiv'=%d, 'FacDivLeader'=%d, 'FacDuty'=%d, 'Weapon[0]'=%d, 'Weapon[1]'=%d WHERE `ID`=%d", PlayerInfo[playerid][pVehVW], PlayerInfo[playerid][pWalkStyle], PlayerInfo[playerid][pFac], PlayerInfo[playerid][pFacRank], PlayerInfo[playerid][pFacLeader], PlayerInfo[playerid][pFacDiv], PlayerInfo[playerid][pFacDivLeader], PlayerInfo[playerid][pFacDuty], PlayerInfo[playerid][pWeapon][0], PlayerInfo[playerid][pWeapon][1], PlayerInfo[playerid][ID]); mysql_tquery(mysql, query, "", ""); mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `Weapon[2]`=%d, `Weapon[3]`=%d, `Weapon[4]`=%d, `Weapon[5]`=%d, `Weapon[6]`=%d, 'Weapon[7]'=%d, 'Weapon[8]'=%d, 'Weapon[9]'=%d, 'Weapon[10]'=%d, 'Weapon[11]'=%d, 'Weapon[12]'=%d WHERE `ID`=%d", PlayerInfo[playerid][pWeapon][2], PlayerInfo[playerid][pWeapon][3], PlayerInfo[playerid][pWeapon][4], PlayerInfo[playerid][pWeapon][5], PlayerInfo[playerid][pWeapon][6], PlayerInfo[playerid][pWeapon][7], PlayerInfo[playerid][pWeapon][8], PlayerInfo[playerid][pWeapon][9], PlayerInfo[playerid][pWeapon][10], PlayerInfo[playerid][pWeapon][11], PlayerInfo[playerid][pWeapon][12], PlayerInfo[playerid][ID]); mysql_tquery(mysql, query, "", "");