Рекомендованные сообщения



Не найдено.

5 posts in this topic

Спойлер

stock SaveAccount(playerid)
{
	if(PlayerLogged[playerid] == false || IsPlayerConnected(playerid) == 0) return 1;
	new src[500];
	format(query,sizeof(query),"UPDATE "T_ACCOUNTS" SET ");
	format(src,sizeof(src),"ip='%s',",PI[playerid][pIP]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"level=%d,",PI[playerid][pLevel]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"admin=%d,",PI[playerid][pAdmin]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"sex=%d,",PI[playerid][pSex]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"age=%d,",PI[playerid][pAge]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"securitycode='%i',",PI[playerid][pSecurityCode]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"model=%d,",PI[playerid][pModel]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"memberskin=%d,",PI[playerid][pMemberSkin]);
	strcat(query,src,sizeof(query));
	if(PI[playerid][pCash] > 1000000000 || PI[playerid][pCash] < 0) PI[playerid][pCash] = 0;
	format(src,sizeof(src),"cash=%d,",PI[playerid][pCash]);
	strcat(query,src,sizeof(query));
	if(PI[playerid][pBank] > 1000000000 || PI[playerid][pBank] < 0) PI[playerid][pBank] = 0;
	format(src,sizeof(src),"bank=%d,",PI[playerid][pBank]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"mute=%d,",PI[playerid][pMuted]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"warn=%d,",PI[playerid][pWarn]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"leader=%d,",PI[playerid][pLeader]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"templeader=%d,",PI[playerid][pTempLeader]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"member=%d,",PI[playerid][pMember]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"rank=%d,",PI[playerid][pRank]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"pick=%d,",PI[playerid][pPick]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"exp=%d,",PI[playerid][pExp]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"news=%d,",PI[playerid][pNews]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"crimes=%d,",PI[playerid][pCrimes]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"wanted=%d,",PI[playerid][pWanted]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"wantedtime=%d,",PI[playerid][pWantedTime]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"wantedwho='%s',",PI[playerid][pWantedWho]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"wantedreason='%s',",PI[playerid][pWantedReason]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"jail=%d,",PI[playerid][pJail]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"job=%d,",PI[playerid][pJob]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"jailtime=%d,",PI[playerid][pJailTime]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"checktime=%d,",PI[playerid][pCheckTime]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"drugs=%d,",PI[playerid][pDrugs]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"patron=%d,",PI[playerid][pPatron]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"gunamount=%d,",PI[playerid][pGunAmount]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"heal='%f',",PI[playerid][pHeal]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"married=%d,",PI[playerid][pMarried]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"whomarried='%s',",PI[playerid][pWhoMarried]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"paycheck='%i',",PI[playerid][pPayCheck]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"charity='%i',",PI[playerid][pCharity]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"vip='%i',",PI[playerid][pVip]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"viptime='%i',",PI[playerid][pVipTime]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"time='%i',",PI[playerid][pTime]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"fstyle='%i',",PI[playerid][pFightStyle]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"credits='%i',",PI[playerid][pCredits]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"totalcredits='%i',",PI[playerid][pTotalCredits]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"skin1='%i',",PI[playerid][pSkin][0]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"skin2='%i',",PI[playerid][pSkin][1]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"skin3='%i',",PI[playerid][pSkin][2]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"spawnchange='%i',",PI[playerid][pSpawnChange]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"sdpistol='%i',",PI[playerid][pSkill]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"deserteagle='%i',",PI[playerid][pSkill][1]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"shotgun='%i',",PI[playerid][pSkill][2]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"mp5='%i',",PI[playerid][pSkill][3]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"ak47='%i',",PI[playerid][pSkill][4]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"m4='%i',",PI[playerid][pSkill][5]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"pistol='%i',",PI[playerid][pGunSkill][6]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"microuzi='%i',",PI[playerid][pGunSkill][7]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"hunger='%i',",PI[playerid][pHunger]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"healths='%f',",PI[playerid][pHealthS]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"sportexp='%i',",PI[playerid][pSportExp]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"online='%i',",PI[playerid][pOnline]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"zakon='%i',",PI[playerid][pZakon]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"checkcode='%i',",PI[playerid][pCheckCode]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"city='%i',",PI[playerid][pCity]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"bed='%i',",PI[playerid][pBed]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"watch='%i',",PI[playerid][pWatch]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"ciggare='%i',",PI[playerid][pCiggare]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"sprunk='%i',",PI[playerid][pSprunk]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"mask='%i',",PI[playerid][pMask]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"phonebalance='%i',",PI[playerid][pPhoneBalance]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"truckskill='%i',",PI[playerid][pTruckSkill]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cModel='%i',",PI[playerid][cModel]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cFuel='%i',",PI[playerid][cFuel]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cFuel='%i',",PI[playerid][cFuel]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cClass='%i',",PI[playerid][cClass]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cColor1='%i',",PI[playerid][cColor][0]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cColor2='%i',",PI[playerid][cColor][1]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cLock='%i',",PI[playerid][cLock]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cCost='%i',",PI[playerid][cCost]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cVehcom='%s',",PI[playerid][cVehcom]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cPaintjob='%i',",PI[playerid][cPaintjob]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"cProbeg='%.2f',",PI[playerid][cProbeg]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"aptechka='%i',",PI[playerid][pAptechka]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"Voennik='%i',",PI[playerid][pVoennik]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"music='%i',",PI[playerid][pMusic]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"datavhod='%s',",date("%dd.%mm.%yyyy",gettime()));
	strcat(query,src,sizeof(query));
 	format(PI[playerid][pRepcars],16,"%i, %i",PI[playerid][pRepcar][0],PI[playerid][pRepcar][1]);
	format(src,sizeof(src),"repcar='%s',",PI[playerid][pRepcars]);
	strcat(query,src,sizeof(query));
	format(PI[playerid][pImproves],32,"%i, %i, %i, %i",PI[playerid][pImprove][0],PI[playerid][pImprove][1],PI[playerid][pImprove][2],PI[playerid][pImprove][3]);
	format(src,sizeof(src),"improves='%s',",PI[playerid][pImproves]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"veh_reg='%i',",PI[playerid][pRegVehicle]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"pcara='%i',",PI[playerid][pCarA]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"pcarb='%i',",PI[playerid][pCarB]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"pcarc='%i',",PI[playerid][pCarC]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"pcard='%i',",PI[playerid][pCarD]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"phonenumber='%i',",PI[playerid][pPhoneNumber]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"phnumber1='%i',",PhoneNumbers[playerid][0]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"phnumber2='%i',",PhoneNumbers[playerid][1]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"phnumber3='%i',",PhoneNumbers[playerid][2]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"phnumber4='%i',",PhoneNumbers[playerid][3]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"phnumber5='%i',",PhoneNumbers[playerid][4]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"phnumber6='%i',",PhoneNumbers[playerid][5]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"phnumber7='%i',",PhoneNumbers[playerid][6]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"phnumber8='%i',",PhoneNumbers[playerid][7]);
	strcat(query,src,sizeof(query));
	format(PI[playerid][pLics],16,"%i, %i, %i, %i",PI[playerid][pLic][0],PI[playerid][pLic][1],PI[playerid][pLic][2],PI[playerid][pLic][3]);
	format(src,sizeof(src),"lic='%s',",PI[playerid][pLics]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"pInt='%d',",PI[playerid][pInt]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"pWorld='%d',",PI[playerid][pWorld]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"PosX='%f',",PI[playerid][PosX]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"PosY='%f',",PI[playerid][PosY]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"PosZ='%f',",PI[playerid][PosZ]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"trucklevel='%i'",PI[playerid][pTruckLevel]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src)," WHERE name='%s' LIMIT 1",GetName(playerid));
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"family=%d,",PI[playerid][pFamily]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"familysozd=%d,",PI[playerid][pFamilySozd]);
	strcat(query,src,sizeof(query));
	format(src,sizeof(src),"familyzam=%d,",PI[playerid][pFamilyZam]);
	strcat(query,src,sizeof(query));
 	mysql_tquery(dbHandle, query, "", "");
	return 1;
}

 

 

Share this post


Link to post
Share on other sites

@archiboy6, это вся функция? Обратите внимание на ее конец.В функции лишь перечисляются названия полей, которые нужно обновить. Но нет условия, у кого именно нужно обновить. То есть конец должен выглядеть примерно так:

Спойлер

format(src,sizeof(src),"familyzam=%d",PI[playerid][pFamilyZam]);
strcat(query,src,sizeof(query));
format(src,sizeof(src),"WHERE name='%s'", PI[playerid][pName]);
strcat(query,src,sizeof(query));
mysql_tquery(dbHandle, query, "", "");

 

 

Причем перед WHERE не должно быть запятой (я ее убрал в коде своем).

Share this post


Link to post
Share on other sites

@odosenok Деньги и лицензии не сохраняются 

Share this post


Link to post
Share on other sites

@archiboy6, в базе данных значение денег правильное?

Share this post


Link to post
Share on other sites

@odosenok Когда выдаю, в базу деньги не зачисляются

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • glvde.
      By glvde.
      Хранение данных (версия MySQL): R41-4.
      Командный процессор: Pawn.CMD.
      Количество строк в моде (без маппинга): 44006.
      Анти-чит: Nexius-AC.
      Автор данного мода: -.

      Скриншоты: 
       
       
       
       
       

      На данный момент, мод продаётся за 3699₽ на соседнем борде Pawno-Info (не реклама, скрины взял из темы с продажей).

      Не исключаю того, что в моде имеются баги.
      По поводу дальнейшей доработки узнать можно будет в моей группе - vk.com/way_dev
      Так же есть доработанная версия данного мода, за покупкой обращаться в ВК - vk.com/way.developer
    • glvde.
      By glvde.
      Smart RolePlay | Новый слив с продажи
      Просмотр файла Хранение данных (версия MySQL): R41-4.
      Командный процессор: Pawn.CMD.
      Количество строк в моде (без маппинга): 44006.
      Анти-чит: Nexius-AC.
      Автор данного мода: -.

      Скриншоты: 
       
       
       
       
       

      На данный момент, мод продаётся за 3699₽ на соседнем борде Pawno-Info (не реклама, скрины взял из темы с продажей).

      Не исключаю того, что в моде имеются баги.
      По поводу дальнейшей доработки узнать можно будет в моей группе - vk.com/way_dev
      Так же есть доработанная версия данного мода, за покупкой обращаться в ВК - vk.com/way.developer
      Добавил glvde. Добавлено 21.01.2021 Категория Моды Автор -  
    • Radmiz
      By Radmiz
          if(pickupid == sadpick){         if(GetPVarInt(playerid,"Sadov") == 0) {             SetPVarInt(playerid,"Sadov", 1);             SetPlayerSkin(playerid, 73);             SetPlayerCheckpoint(playerid,2157.0464,-1707.6362,15.0859,3.0);               SendClientMessage(playerid,0x00ff39,"Âû óñòðîèëèñü íà ðàáîòó ñàäîâíèêà");               SendClientMessage(playerid,0xfeff00,"Çà 1 ïîñàæàíûé êóñò âàì áóäóò ïëàòèòü ïî 345$");         }         else {             PI[playerid][pCash] += GetPVarInt(playerid,"SadovM")*345;             SetPlayerSkin(playerid,PI[playerid][pSkin]);             ClearAnimations(playerid);             DeletePVar(playerid,"Sadov");             DeletePVar(playerid,"SadovM");             DeletePVar(playerid,"SadovW");             SendClientMessage(playerid,0xff0000,"Âû óâîëèëèñü ñ ðàáîòû ñàäîâíèêà");             DisablePlayerCheckpoint(playerid);  
      я хз что за иероглифы