05.01.2018, 04:44
Eu estou tendo dъvidas de como posso melhorar a minha callback de salvamento de contas. Estava cogitando utilizar o mйtodo strcat mas acho muito arriscado. Alguйm teria como me dar um conselho sobre como eu posso melhorar esse cуdigo?
Код:
new query[128]; format(query, sizeof(query), "UPDATE `accounts` SET `admin` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pAdmin], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `admintemp` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pAdminTemp], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `helper` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pHelper], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `vip` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pVIP], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `expire` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pExpire], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `level` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pLevel], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `exp` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pExp], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `money` = '%i' WHERE `name` = '%q'", GetPlayerMoneyEx(playerid), PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `bank` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pBank], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `ouros` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pOuros], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `moedasazuis` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pMA], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `sex` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pSex], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `age` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pAge], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `skin` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pSkin], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `ban` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pBan], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `cellphone` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pCellphone], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `phonebook` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pPhoneBook], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `job` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pJob], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `connecttime` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pConnectTime], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `contracttime` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pContractTime], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `headvalue` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pHeadValue], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `headvaluet` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pHeadValueT], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `family` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pFamily], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `member` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pMember], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `leader` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pLeader], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `rank` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pRank], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `spawn` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pSpawn], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `kills` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pKills], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `deaths` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pDeaths], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `doenca` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pDoenca], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `hospital` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pHospital], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `hospitaltime` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pHospTime], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `canhospital` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pCanHospital], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `jailed` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pJailed], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `jailtime` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pJailTime], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `crimes` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pCrimes], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `wantedlevel` = '%i' WHERE `name` = '%q'", WantedPoints[playerid], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `carlic` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pCarLic], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `flylic` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pFlyLic], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `boatlic` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pBoatLic], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `ammulic` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pAmmuLic], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `registered` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pReg], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `married` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pMarried], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `marriedto` = '%q' WHERE `name` = '%q'", APlayerData[playerid][pMarriedTo], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `ajustado` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pAjustado], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `hajustado` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pHAjustado], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `mutedchat` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pMutedChat], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `muted` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pMuted], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `giftbox` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pGiftBox], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `payday` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pPayDay], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `lottonr` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pLottoNr], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `upgrade` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pUpgrade], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `adminfuncao` = '%q' WHERE `name` = '%q'", APlayerData[playerid][pFuncao], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `lastlogin` = '%q' WHERE `name` = '%q'", APlayerData[playerid][pLastLogin], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `orgvip` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pOrgVIP], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `agendado` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pAgendado], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `adminagendou` = '%q' WHERE `name` = '%q'", APlayerData[playerid][pAdminAgendou], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `motivoagendou` = '%q' WHERE `name` = '%q'", APlayerData[playerid][pMotivoAgendou], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `tempoagendado` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pTempoAgendado], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `warns` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pWarns], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `health` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pSHealth], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `armour` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pSArmour], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `drugperk` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pDrugPerk], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `maconha` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pMaconha], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `cocaina` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pCocaina], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `crack` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pCrack], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `materiais` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pMateriais], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `housekey` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pHouseKey], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `housecarkey` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pHouseCarKey], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `bizzkey` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pBizzKey], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `fazkey` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pFazKey], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `fome` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pFome], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `sede` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pSede], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `lawskill` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pLawSkill], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `detskill` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pDetSkill], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `mechskill` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pMechSkill], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `boxskill` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pBoxSkill], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `sexskill` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pSexSkill], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `drogasskill` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pDrogasSkill], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `newsskill` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pNewsSkill], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `carskill` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pCarSkill], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `capacete` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pCapacete], PlayerName(playerid)); db_query(Connect, query); format(query, sizeof(query), "UPDATE `accounts` SET `sino` = '%i' WHERE `name` = '%q'", APlayerData[playerid][pSino], PlayerName(playerid)); db_query(Connect, query);