[22:57:53] [debug] Server crashed while executing WCRP.amx [22:57:53] [debug] AMX backtrace: [22:57:53] [debug] #0 native mysql_function_query () from mysql.so [22:57:53] [debug] #1 000d1af8 in ?? (1, 411, 0, 0, 1, 1154205843, -997562389, 1103052800, 1132793531) from WCRP.amx [22:57:53] [debug] #2 000ba450 in public @_yCcreatefamilycar (0, 7050512, 0) from WCRP.amx [22:57:53] [debug] #3 000ba044 in public @yC_createfamilycar (0, 7050512, 0, 0) from WCRP.amx [22:57:53] [debug] #4 native CallRemoteFunction () from samp03svr [22:57:53] [debug] #5 0002da18 in ?? (0, 7050396, 0) from WCRP.amx [22:57:53] [debug] #6 0002d2e4 in ?? (0, 7050396) from WCRP.amx [22:57:53] [debug] #7 000184cc in public OnPlayerCommandText (0, 7050396) from WCRP.amx [22:57:53] [debug] Native backtrace: [22:57:53] [debug] #0 f7449180 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so [22:57:53] [debug] #1 f7441064 in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7C ontextE () from plugins/crashdetect.so [22:57:53] [debug] #2 f7441d64 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7Cont extE () from plugins/crashdetect.so [22:57:53] [debug] #3 f7443cdb in _ZN11CrashDetect7OnCrashERKN2os7ContextE () from plugins/crashdetect.so [22:57:53] [debug] #4 f74484d5 in ?? () from plugins/crashdetect.so [22:57:53] [debug] #5 f77a3d50 in __kernel_rt_sigreturn () from linux-gate.so.1 [22:57:53] [debug] #6 f77a3d70 in __kernel_vsyscall () from linux-gate.so.1 [22:57:53] [debug] #7 f74a0367 in gsignal () from /lib/i386-linux-gnu/i686/cmov/libc.so.6 [22:57:53] [debug] #8 f74a1a23 in abort () from /lib/i386-linux-gnu/i686/cmov/libc.so.6 [22:57:53] [debug] #9 f74de778 in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6 [22:57:53] [debug] #10 f74e47ea in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6 [22:57:53] [debug] #11 f74e543d in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6 [22:57:53] [debug] #12 f7118779 in _ZN7Natives22n_mysql_query_callbackEP6tagAMXPi () from plugins/mysql.so [22:57:53] [debug] #13 080950e4 in ?? () from ./samp03svr [22:57:53] [debug] #14 f7442ad3 in _ZN11CrashDetect17HandleAMXCallbackEiPiS0_ () from plugins/crashdetect.so [22:57:53] [debug] #15 0000000b in ?? () from *§vчHҐvчУL [22:57:53] [debug] УL [22:57:53] [debug] ЧL [22:57:53] [debug] УL [22:57:53] [debug] њЧL [22:57:53] [debug] ЫL [22:57:53] [debug] 4wч [22:57:53] [debug] Registers: [22:57:53] [debug] EAX: 00000000 EBX: 00007a34 ECX: 00007a34 EDX: 00000006 [22:57:53] [debug] ESI: 0000004d EDI: f761b000 EBP: ffeb3bf8 ESP: ffeb3934 [22:57:53] [debug] EIP: f77a3d70 EFLAGS: 00000296 [22:57:53] [debug] Stack: [22:57:53] [debug] ESP+00000000: ffeb3bf8 00000006 00007a34 f74a0367 [22:57:53] [debug] ESP+00000020: ffeb3964 00000000 00000000 00000000 [22:57:53] [debug] ESP+00000040: 00000000 00000000 00000000 00000000 [22:57:53] [debug] ESP+00000060: 00000000 00000000 00000000 00000000 [22:57:53] [debug] ESP+00000080: 00000000 00000000 00000000 00000000 [22:57:53] [debug] ESP+000000a0: 00000000 00000000 00000000 00000000 [22:57:53] [debug] ESP+000000c0: 00000000 00000000 00000000 00000000 [22:57:53] [debug] ESP+000000e0: 00000000 00000000 00000000 00000000 [22:57:53] [debug] ESP+00000100: 00000000 00000000 00000000 00000000 [22:57:53] [debug] ESP+00000120: 00000000 00000000 00000000 00000003 [22:57:53] [debug] ESP+00000140: f761b000 00000007 f74de778 0000000c [22:57:53] [debug] ESP+00000160: 00000000 00000000 00000000 f75d69bc [22:57:53] [debug] ESP+00000180: 00000003 f75d6b5c 00000020 f75d69d1 [22:57:53] [debug] ESP+000001a0: 00000005 00000000 00000000 00000000 [22:57:53] [debug] ESP+000001c0: 00000005 ffeb3b10 f74e5afc 00000000 [22:57:53] [debug] ESP+000001e0: 00000008 ffeb3b30 00000000 00000000 [22:57:53] [debug] ESP+00000200: 00000004 ffeb3b50 f751ba37 60000000 [22:57:53] [debug] ESP+00000220: 00000020 ffeb3b70 00000000 00000000 [22:57:53] [debug] ESP+00000240: 00000003 ffeb3b90 f761b000 f761b420 [22:57:53] [debug] ESP+00000260: 0000000b ffeb3bb0 ffeb3d58 00000902 [22:57:53] [debug] ESP+00000280: 0000000e 00000000 f74d7782 f76cd017 [22:57:53] [debug] ESP+000002a0: 0000004d 0000004d 00000007 f7730e57 [22:57:53] [debug] ESP+000002c0: ffeb5b3f f761b420 f74e47ea 00000001 [22:57:53] [debug] ESP+000002e0: 00000000 ffeb3c48 f75d6b5c f7363a0c [22:57:53] [debug] ESP+00000300: 0a34f448 00000010 f74e543d 0a34f448 [22:57:53] [debug] ESP+00000320: f5627690 f7731789 f776c000 ffeb3d04 [22:57:53] [debug] ESP+00000340: 00000000 00000000 0a34f448 0000000c [22:57:53] [debug] ESP+00000360: f71ff29d f77317f9 0a34f448 ffeb3d44 [22:57:53] [debug] ESP+00000380: 0a34f448 0000000c c0914cfd ffeb3d00 [22:57:53] [debug] ESP+000003a0: 00000005 00000000 00000000 09e255a0 [22:57:53] [debug] ESP+000003c0: 0a69d064 0a809e0c 0a44a6ec 0a2c9f34 [22:57:53] [debug] ESP+000003e0: 081a199c 081a199c 081a199c 081a199c [22:57:53] [debug] Loaded modules: [22:57:53] [debug] 00000000 - 00187dc3 samp03svr [22:57:53] [debug] f77a3000 - f77a3e96 linux-gate.so.1 [22:57:53] [debug] f7791000 - f779381b /lib/i386-linux-gnu/i686/cmov/libdl.so.2 [22:57:53] [debug] f7775000 - f778fd2b /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 [22:57:53] [debug] f7682000 - f777bce6 /usr/lib32/libstdc++.so.6 [22:57:53] [debug] f763c000 - f7680b43 /lib/i386-linux-gnu/i686/cmov/libm.so.6 [22:57:53] [debug] f761f000 - f763b3c4 /lib/i386-linux-gnu/libgcc_s.so.1 [22:57:53] [debug] f7472000 - f762722f /lib/i386-linux-gnu/i686/cmov/libc.so.6 [22:57:53] [debug] f77a6000 - f77c6d6c /lib/ld-linux.so.2 [22:57:53] [debug] f742b000 - f746dac4 plugins/crashdetect.so [22:57:53] [debug] f7385000 - f742b14c plugins/streamer.so [22:57:53] [debug] f7797000 - f779e09f /lib/i386-linux-gnu/i686/cmov/librt.so.1 [22:57:53] [debug] f7364000 - f73841ed plugins/dns.so [22:57:53] [debug] f7354000 - f73631d4 plugins/sscanf.so [22:57:53] [debug] f7348000 - f7351918 plugins/Whirlpool.so [22:57:53] [debug] f7084000 - f734b07c plugins/mysql.so [22:57:53] [debug] f706c000 - f70773ef /lib/i386-linux-gnu/i686/cmov/libnss_files.so.2 [22:57:53] [debug] f7080000 - f7081f70 plugins/nativechecker.so [22:57:53] [debug] f7079000 - f707d97b /lib/i386-linux-gnu/i686/cmov/libnss_dns.so.2 [22:57:53] [debug] f67fa000 - f68122fb /lib/i386-linux-gnu/i686/cmov/libresolv.so.2 |
YCMD:createfamilycar(playerid, params[], help) {
if(help) {
SendClientMessage(playerid, X11_WHITE, "Creates a family car");
return 1;
}
new famid, model, c1, c2, lock;
if (!sscanf(params, "ddD(0)D(0)D(0)", famid, model, c1, c2, lock))
{
if(!IsValidFamily(famid)) {
SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid Family");
return 1;
}
if(model < 400 || model > 611) {
SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid Vehicle!");
return 1;
}
if(c1 < 0 || c1 > 255 || c2 < 0 || c2 > 255) {
SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid Model!");
return 1;
}
new Float:X, Float:Y, Float:Z, Float:Angle;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
famid = SQLIDFromFamily(famid);
CreateFamilyCar(famid, model, c1, c2, ELockType:lock, X, Y, Z, Angle);
} else {
SendClientMessage(playerid, X11_WHITE, "USAGE: /createfamilycar [familyid] [model] [c1] [c2] [lock]");
}
return 1;
}
CreateFamilyCar(famid, model, c1, c2, ELockType:lock, Float:X, Float:Y, Float:Z, Float:Angle) {
#pragma unused lock
query[0] = 0;//[256];
format(query, sizeof(query), "INSERT INTO `familycars` (`model`,`colour1`,`colour2`,`X`,`Y`,`Z`,`Angle`,`owner`) VALUES (%d,%d,%d,%f,%f,%f,%f,%d)",model,c1,c2,X,Y,Z,Angle,famid);
mysql_function_query(g_mysql_handle, query, true, "onCreateFamilyVehicle", "ddddffff", famid, model, c1, c2, X, Y, Z, Angle);
}
YCMD:createplayercar(playerid, params[], help) {
new model,c1,c2,lock;
new playa;
if(help) {
SendClientMessage(playerid, X11_WHITE, "Creates a car for a player");
return 1;
}
if (!sscanf(params, "k<playerLookup_acc>dddd", playa,model, c1, c2, lock))
{
if(!IsPlayerConnectEx(playa)) {
SendClientMessage(playerid, X11_WHITE, "Error: player not connected");
return 1;
}
new EAdminFlags:aflags = EAdminFlags:GetPVarInt(playerid, "AdminFlags");
if(playerid == playa) {
if(~aflags & EAdminFlags_CanRefundSelf) {
SendClientMessage(playerid, X11_TOMATO_2, "You cannot refund yourself!");
return 1;
}
}
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
if(c1 < 0 || c1 > 255 || c2 < 0 || c2 > 255)
{
SendClientMessage(playerid, X11_RED2, " Color ID can't be below 0 or above 255!");
return 1;
}
if(lock < 0 || lock > 7)
{
SendClientMessage(playerid, X11_RED2, " The lock ID can't be below 0 or above 7!");
return 1;
}
if(!isValidModel(model)) {
SendClientMessage(playerid, X11_RED2, " Invalid Vehicle Model");
return 1;
}
CreatePlayerCar(playa, model, c1, c2, X, Y, Z, A, ELockType:lock);
new string[128];
format(string, sizeof(string), "* Vehicle successfully created.");
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
format(string, sizeof(string), "An admin added a %s to your cars.", VehiclesName[model-400]);
SendClientMessage(playa, X11_ORANGE, string);
if(GetPVarInt(playerid, "AdminHidden") != 2) {
format(string, sizeof(string), "* %s has given %s a %s",GetPlayerNameEx(playerid, ENameType_AccountName), GetPlayerNameEx(playa, ENameType_CharName), VehiclesName[model-400]);
ABroadcast(X11_YELLOW, string, EAdminFlags_AdminManage);
}
} else {
SendClientMessage(playerid, X11_WHITE, "USAGE: /createplayercar [playerid/name] [model] [colour1] [colour2] [locktype]");
SendClientMessage(playerid, X11_WHITE, "Lock types: 0 = Default, 1 = Simple, 2 = remote, 3 = remote, 4 = advanced, 5 = satelitte, 6 = titanium laser, 7 = bio");
}
return 1;
}
CreatePlayerCar(playerid, model, c1, c2, Float:X, Float:Y, Float:Z, Float:Angle, ELockType:locktype, putincar = 0) {
query[0] = 0;//[256];
format(query,sizeof(query),"INSERT INTO `playercars` (`owner`,`model`,`X`,`Y`,`Z`,`Angle`,`colour1`,`colour2`,`locktype`) VALUES (%d,%d,%f,%f,%f,%f,%d,%d,%d)",GetPVarInt(playerid, "CharID"),model,X,Y,Z,Angle,c1,c2,_:locktype);
mysql_function_query(g_mysql_handle, query, true, "onPlayerVehicleCreate", "ddddffffdd",playerid,model,c1,c2,X,Y,Z,Angle,_:locktype,putincar);
return 0;
}
I'm using BlueG's Mysql R7, I'm looking forward to convert to the new one but It will take time and all of that, So I just want to fix the bugs in the script, Then upgrade the MySQL to the newest
|
YCMD:createplayercar(playerid, params[], help) {
new model,c1,c2,lock;
new playa;
print("debug message 1"); //prints to log
if(help) {
SendClientMessage(playerid, X11_WHITE, "Creates a car for a player");
return 1;
}
if (!sscanf(params, "k<playerLookup_acc>dddd", playa,model, c1, c2, lock))
{
if(!IsPlayerConnectEx(playa)) {
SendClientMessage(playerid, X11_WHITE, "Error: player not connected");
return 1;
}
print("debug message 2") // and so on.
new EAdminFlags:aflags = EAdminFlags:GetPVarInt(playerid, "AdminFlags");
if(playerid == playa) {
if(~aflags & EAdminFlags_CanRefundSelf) {
SendClientMessage(playerid, X11_TOMATO_2, "You cannot refund yourself!");
return 1;
}
}
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X, Y, Z);
print("debug message 3") //
GetPlayerFacingAngle(playerid, A);
if(c1 < 0 || c1 > 255 || c2 < 0 || c2 > 255)
{
SendClientMessage(playerid, X11_RED2, " Color ID can't be below 0 or above 255!");
return 1;
}
if(lock < 0 || lock > 7)
{
SendClientMessage(playerid, X11_RED2, " The lock ID can't be below 0 or above 7!");
return 1;
}
print("debug message 4") //
if(!isValidModel(model)) {
SendClientMessage(playerid, X11_RED2, " Invalid Vehicle Model");
return 1;
}
print("debug message 5") //
CreatePlayerCar(playa, model, c1, c2, X, Y, Z, A, ELockType:lock);
print("debug message 6") //for example, if createplayercar above caused the crash, this message will not appear in the log.
new string[128];
format(string, sizeof(string), "* Vehicle successfully created.");
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
format(string, sizeof(string), "An admin added a %s to your cars.", VehiclesName[model-400]);
SendClientMessage(playa, X11_ORANGE, string);
if(GetPVarInt(playerid, "AdminHidden") != 2) {
format(string, sizeof(string), "* %s has given %s a %s",GetPlayerNameEx(playerid, ENameType_AccountName), GetPlayerNameEx(playa, ENameType_CharName), VehiclesName[model-400]);
print("debug message 7") //
ABroadcast(X11_YELLOW, string, EAdminFlags_AdminManage);
}
} else {
SendClientMessage(playerid, X11_WHITE, "USAGE: /createplayercar [playerid/name] [model] [colour1] [colour2] [locktype]");
SendClientMessage(playerid, X11_WHITE, "Lock types: 0 = Default, 1 = Simple, 2 = remote, 3 = remote, 4 = advanced, 5 = satelitte, 6 = titanium laser, 7 = bio");
}
return 1;
}