17.12.2012, 19:35
Here is code for these function inside ... SacuvajIgraca:
and SaveOrg code:
.... OnPlayerCommandReceived is too long because it contains a lot of "strcmp" commands... and without this callback I have 139 zcmd commands...
Maybe the problem is in one of these function SaveOrg or SacuvajIgraca... help!
Код:
public SacuvajIgraca(playerid) { if(IsPlayerConnected(playerid)) { new ti = GetTickCount(); if(gPlayerLogged[playerid] || gRegaSe[playerid]) { new string[200], str[1100]; new loginname[MAX_PLAYER_NAME]; GetPlayerName(playerid,loginname,sizeof(loginname)); format(string,sizeof(string),"UPDATE `korisnici` SET Level=%d, AdminLevel=%d, ConnectedTime=%d, Registered=%d, Sex=%d, Age=%d, Origin=%d,", PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pConnectTime],PlayerInfo[playerid][pReg],PlayerInfo[playerid][pSpol],PlayerInfo[playerid][pGodine],PlayerInfo[playerid][pDrzava]); strcat(str, string); format(string,sizeof(string),"CK=%d, Muted=%d, Respect=%d, Money=%d, Bank=%d, Crimes=%d, Kills=%d, Deaths=%d, Arrested=%d, WantedDeaths=%d,",PlayerInfo[playerid][pCK], PlayerInfo[playerid][pMuted], PlayerInfo[playerid][pExp], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pAccount], PlayerInfo[playerid][pCrimes], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pArrested], PlayerInfo[playerid][pWantedDeaths]); strcat(str, string); format(string,sizeof(string),"Phonebook=%d, Job=%d, Paycheck=%d, HeadValue=%d, Jailed=%d, JailTime=%d,",PlayerInfo[playerid][pPhoneBook],PlayerInfo[playerid][pJob],PlayerInfo[playerid][pPayCheck],PlayerInfo[playerid][pHeadValue],PlayerInfo[playerid][pJailed],PlayerInfo[playerid][pJailTime]); strcat(str, string); format(string,sizeof(string),"Materials=%d, Drugs=%d, Leader=%d, Member=%d, Rank=%d, PayDay=%d, PayDayHad=%d,",PlayerInfo[playerid][pMats], PlayerInfo[playerid][pDrugs], PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pMember], PlayerInfo[playerid][pRank], PlayerInfo[playerid][pPayDay],PlayerInfo[playerid][pPayDayHad]); strcat(str, string); format(string,sizeof(string),"SexSkill=%d, BoxSkill=%d, LawSkill=%d, MechSkill=%d, LawSkill=%d, CarSkill=%d, NewsSkill=%d, Ban=%d,", PlayerInfo[playerid][pSpolSkill], PlayerInfo[playerid][pBoxSkill], PlayerInfo[playerid][pLawSkill], PlayerInfo[playerid][pMechSkill], PlayerInfo[playerid][pJackSkill], PlayerInfo[playerid][pCarSkill], PlayerInfo[playerid][pNewsSkill], PlayerInfo[playerid][pBan]); strcat(str, string); format(string,sizeof(string),"Interior=%d, PhoneNr=%d, Car=%d, House=%d, Bizz=%d, pHealth=%.1f, Spawn=%d,",PlayerInfo[playerid][pInt], PlayerInfo[playerid][pPnumber], PlayerInfo[playerid][pPcarkey], PlayerInfo[playerid][pPhousekey], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pSpawn]); strcat(str, string); format(string,sizeof(string),"Warnings=%d, VirWorld=%d, mRuta=%d, ",PlayerInfo[playerid][pWarns],PlayerInfo[playerid][pVirWorld], PlayerInfo[playerid][pmRuta]); strcat(str, string); format(string,sizeof(string),"Lighter=%d, Cigarettes=%d, GameSupport=%d, PinKod=%d, Kredit=%d, Naocale=%d,",PlayerInfo[playerid][pLighter],PlayerInfo[playerid][pCigarettes],PlayerInfo[playerid][pGameSupport],PlayerInfo[playerid][pPinKod],PlayerInfo[playerid][pKredit],PlayerInfo[playerid][pNaocale]); strcat(str, string); format(string,sizeof(string),"MuteTime=%d, Kapa=%d, Kosa=%d, VIP=%d, BCB=%d, Wark=%d, Ward=%d, Stan=%d,",PlayerInfo[playerid][pMuteTime], PlayerInfo[playerid][pKapa],PlayerInfo[playerid][pKosa], PlayerInfo[playerid][pVIP], PlayerInfo[playerid][pBCB], PlayerInfo[playerid][pWark], PlayerInfo[playerid][pWard], PlayerInfo[playerid][pStan]); strcat(str, string); format(string,sizeof(string),"Letjelica=%d, Plovilo=%d, Motor=%d, Biciklo=%d, Duhan=%d,",PlayerInfo[playerid][pLet], PlayerInfo[playerid][pPlo],PlayerInfo[playerid][pMot], PlayerInfo[playerid][pBic], PlayerInfo[playerid][pDuhan]); strcat(str, string); format(string,sizeof(string),"PUgovor=%d, Area=%d, AreaTime=%d, Firma=%d,",PlayerInfo[playerid][pPUgovor],PlayerInfo[playerid][pArea],PlayerInfo[playerid][pAreaTime],PlayerInfo[playerid][pFirma]); strcat(str, string); format(string,sizeof(string),"rent=%d, bicrent=%d, motrent=%d, letrent=%d, plorent=%d, mkredit=%d, Radio=%d, Listovi=%d, DSjeme=%d WHERE Nick = '%s'",PlayerInfo[playerid][pRent],PlayerInfo[playerid][pBicRent],PlayerInfo[playerid][pMotRent],PlayerInfo[playerid][pLetRent],PlayerInfo[playerid][pPloRent], PlayerInfo[playerid][pMobKredit], PlayerInfo[playerid][pRadio], PlayerInfo[playerid][pListovi], PlayerInfo[playerid][pDSjeme], loginname); strcat(str, string); mysql_function_query(1,str, false, "", ""); brojSave[playerid]++; } printf("Spremanje %s - %d ms", GetPlayerNameEx(playerid), GetTickCount() - ti); } return 1; }
Код:
stock SaveOrg(idx) { new string[128]; new ti = GetTickCount(); for(new i = 0; i < 40; i++) { format(string,sizeof(string),"UPDATE `orgclanovi` SET Clan%d='%s' WHERE idorg=%d", i, oClan[idx][i][orgClan] ,idx); mysql_function_query(1,string, false, "", ""); } printf("Spremanje orgi %d - %d ms", idx, GetTickCount() - ti); return 1; }
Maybe the problem is in one of these function SaveOrg or SacuvajIgraca... help!
![Cheesy](images/smilies/biggrin.png)