[20:52:59] [debug] Server crashed while executing BCRP.amx [20:52:59] [debug] AMX backtrace: [20:52:59] [debug] #0 native mysql_function_query () [10008f00] from mysql.dll [20:52:59] [debug] #1 00033748 in ?? () from BCRP.amx [20:52:59] [debug] #2 001026e4 in public cmd_makeleader () from BCRP.amx [20:52:59] [debug] #3 native CallLocalFunction () [00472c00] from samp-server.exe [20:52:59] [debug] #4 00008ccc in public OnPlayerCommandText () from BCRP.amx [20:52:59] [debug] System backtrace: [20:53:00] [debug] #0 7c91a3bc in RtlReAllocateHeap () from C:\WINDOWS\system32\ntdll.dll [20:53:00] [debug] #1 7c911917 in RtlInitializeCriticalSection () from C:\WINDOWS\system32\ntdll.dll [20:53:00] [debug] #2 78583db8 in malloc () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCR90.dll [20:53:00] [debug] #3 7858375e in malloc_crt () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCR90.dll [20:53:00] [debug] #4 7854f6aa in flsbuf () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCR90.dll [20:53:00] [debug] #5 7854f427 in flsbuf () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCR90.dll [20:53:00] [debug] #6 7854eaee in putc () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCR90.dll [20:53:00] [debug] #7 7848c23c in std::basic_filebuf<char,std::char_traits<char> >::basic_filebuf<char,std::char_traits<char> > () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCP90.dll [20:53:00] [debug] #8 7848c655 in std::basic_filebuf<char,std::char_traits<char> >::overflow () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCP90.dll [20:53:00] [debug] #9 7848c116 in std::basic_streambuf<char,std::char_traits<char> >::xsputn () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCP90.dll [20:53:00] [debug] #10 10005ae7 in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\mysql.dll [20:53:00] [debug] #11 1000724e in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\mysql.dll [20:53:00] [debug] #12 10008f54 in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\mysql.dll [20:53:00] [debug] #13 004010b6 in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\samp-server.exe [20:53:00] [debug] #14 010539e2 in AmxCallback () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll [20:53:00] [debug] #15 01055e26 in amx_Exec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll [20:53:00] [debug] #16 0104bf3f in crashdetect::DoAmxExec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll [20:53:00] [debug] #17 01053a0e in AmxExec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll [20:53:00] [debug] #18 00472f0e in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\samp-server.exe [20:53:00] [debug] #19 004010b6 in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\samp-server.exe [20:53:00] [debug] #20 010539e2 in AmxCallback () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll [20:53:00] [debug] #21 01055e26 in amx_Exec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll [20:53:00] [debug] #22 0104bf3f in crashdetect::DoAmxExec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll [20:53:00] [debug] #23 01053a0e in AmxExec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll [20:53:00] [debug] #24 0046d9d0 in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\samp-server.exe
CMD:makeleader(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1337) { new id, lvl; if(sscanf(params, "ud", id, lvl)) SendClientMessage(playerid, COLOR_GRAD2, "{FFFFFF}[{CD661D}Balkan Country{FFFFFF}]: /makeleader [ID/Dio imena] [ID Org]"); else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "{FFFFFF}[{FF0000}Balkan Country{FFFFFF}]: {AFAFAF}Igrač nije online!"); else { new orgid = PlayerInfo[id][pLeader]; new pName[24], string[380]; GetPlayerName(id, pName, 24); if(lvl == 0) { if(strcmp(oClan[orgid][0][orgClan], pName, true) == 0) { strmid(oClan[orgid][0][orgClan], "Niko", 0, strlen("Niko"), 255); PlayerInfo[id][pLeader] = 0; format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je skinuo lidera!", GetPlayerNameEx(playerid)); SendClientMessage(id, -1, string); format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Skinuli ste lidera igraču %s!", GetPlayerNameEx(id)); SendClientMessage(playerid, -1, string); PlayerInfo[id][pLeader] = 0; PlayerInfo[id][pRank] = 0; UpdateText(3, orgid); SetPlayerSkin(id, 1); PlayerInfo[id][pChar] = 1; SacuvajIgraca(id); SaveOrg(orgid); } else if(strcmp(oClan[orgid][1][orgClan], pName, true) == 0) { strmid(oClan[orgid][1][orgClan], "Niko", 0, strlen("Niko"), 255); PlayerInfo[id][pLeader] = 0; format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je skinuo lidera!", GetPlayerNameEx(playerid)); SendClientMessage(id, -1, string); format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Skinuli ste lidera igraču %s!", GetPlayerNameEx(id)); SendClientMessage(playerid, -1, string); PlayerInfo[id][pRank] = 0; UpdateText(3, orgid); SetPlayerSkin(id, 1); PlayerInfo[id][pChar] = 1; SacuvajIgraca(id); SaveOrg(orgid); } PlayerInfo[id][pLeader] = 0; PlayerInfo[id][pRank] = 0; } else if(lvl > 0 && lvl < MAX_ORG) { if(PlayerInfo[id][pLeader] != 0) { SendClientMessage(playerid,WHITE,"[{FF0000}Balkan Country{FFFFFF}]{AFAFAF} Igrač je već lider, prvo mu skini lidera!"); return 1; } if(strcmp(oClan[lvl][0][orgClan], "Niko", true) == 0) { SetPlayerSkin(id, OI[lvl][oLiderSkin]); PlayerInfo[id][pChar] = OI[lvl][oLiderSkin]; strmid(oClan[lvl][0][orgClan], pName, 0, strlen(pName), 255); PlayerInfo[id][pLeader] = lvl; format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je dodjelio lidera %s!", GetPlayerNameEx(playerid), OI[lvl][oIme]); SendClientMessage(id, -1, string); format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Dodjelili ste lidera %s igraču %s!", OI[lvl][oIme], GetPlayerNameEx(id)); SendClientMessage(playerid, -1, string); PlayerInfo[id][pRank] = 6; UpdateText(3, lvl); SacuvajIgraca(id); SaveOrg(lvl); } else { if(strcmp(oClan[lvl][1][orgClan], "Niko", true) == 0) { SetPlayerSkin(id, OI[lvl][oLiderSkin]); PlayerInfo[id][pChar] = OI[lvl][oLiderSkin]; strmid(oClan[lvl][1][orgClan], pName, 0, strlen(pName), 255); PlayerInfo[id][pLeader] = lvl; format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je dodjelio lidera %s!", GetPlayerNameEx(playerid), OI[lvl][oIme]); SendClientMessage(id, -1, string); format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Dodjelili ste lidera %s igraču %s!",OI[lvl][oIme], GetPlayerNameEx(id)); SendClientMessage(playerid, -1, string); PlayerInfo[id][pRank] = 6; UpdateText(3, lvl); SacuvajIgraca(id); SaveOrg(lvl); } else { SendClientMessage(playerid, -1, "{FFFFFF}[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Mjesto lidera za tu organizaciju je popunjeno!"); } } } else { SendClientMessage(playerid, -1, "{FFFFFF}[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Pograљan ID organizacije!"); } } } else { SendClientMessage(playerid,WHITE,"[{FF0000}Balkan Country{FFFFFF}]{AFAFAF} Admini samo!"); } return 1; }
I combine callback OnPlayerCommandReceived and zcmd comand, so I have strcmp and zcmd command processors.
|
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; }
Compile your script in debug mode, then it will show the exact lines of the crash stack.
|