19.08.2013, 21:48
I've got a problem while trying to read values using db_get_field_assoc. It keeps crashing the server.
Here's the problem code
And here's the crash log I get ( Using crashdetect )
Here's the problem code
pawn Код:
if(db_num_rows(Result)) {
new PickedSkin[100];
db_get_field_assoc(Result, "SKIN", PickedSkin, 100);
new C1Message[90];
format(C1Message, 90, "SKIN %i", strval(PickedSkin));
TextDrawSetString(SkinLine, C1Message);
new C2Message[90];
format(C2Message, 90, "~b~%s", Name);
TextDrawSetString(CharacterName, C2Message);
new C3Message[90];
new PickedAge[100];
db_get_field_assoc(Result, "AGE", PickedAge, 100);
format(C3Message, 90, "%i Years old", strval(PickedAge));
TextDrawSetString(AgeLine, C3Message);
new C4Message[90];
new PickedGender[100];
db_get_field_assoc(Result, "GENDER", PickedGender, 100);
format(C4Message, 90, "%s", PickedGender);
TextDrawSetString(GenderLine, C4Message);
new C5Message[90];
new PickedMoney[100];
db_get_field_assoc(Result, "MONEY", PickedMoney, 100);
format(C5Message, 90, "~g~%i$", strval(PickedMoney));
TextDrawSetString(Finance, C5Message);
Код:
[00:42:55] [debug] Server crashed while executing crp.amx [00:42:55] [debug] AMX backtrace: [00:42:55] [debug] #0 native db_get_field_assoc () [0044de30] from samp-server.exe [00:42:55] [debug] #1 000078a4 in ?? (0x00000000) from crp.amx [00:42:55] [debug] #2 0000310c in public OnDialogResponse (0x00000000, 0x00000004, 0x00000001, 0xffffffff, 0x00004674) from crp.amx [00:42:55] [debug] Native backtrace: [00:42:55] [debug] #0 0044dad1 in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\samp-server.exe [00:42:55] [debug] #1 004010b6 in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\samp-server.exe [00:42:55] [debug] #2 688f60ba in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\plugins\crashdetect.DLL [00:42:55] [debug] #3 688f7fee in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\plugins\crashdetect.DLL [00:42:55] [debug] #4 688f0091 in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\plugins\crashdetect.DLL [00:42:55] [debug] #5 688f610a in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\plugins\crashdetect.DLL [00:42:55] [debug] #6 0046da61 in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\samp-server.exe [00:42:55] [debug] #7 004527d0 in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\samp-server.exe [00:42:55] [debug] #8 688f610a in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\plugins\crashdetect.DLL [00:42:55] [debug] #9 0046d7e0 in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\samp-server.exe [00:42:55] [debug] #10 00498ba9 in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\samp-server.exe [00:42:55] [debug] #11 0045b22a in ?? () from C:\Users\Administrator\Desktop\SQL SAMP\samp-server.exe [00:42:55] [debug] #12 769b1129 in ?? () from C:\WINDOWS\SYSTEM32\KERNELBASE.dll [00:42:55] [debug] #13 769b11f8 in ?? () from C:\WINDOWS\SYSTEM32\KERNELBASE.dll [00:42:55] [debug] #14 769b1221 in ?? () from C:\WINDOWS\SYSTEM32\KERNELBASE.dll