Server crash on kick
#1

So, i've created a function that kicks players:
Код:
forward kick(playerid, reason[]);
public kick(playerid, reason[])
{
	new kickreason[512];
	format(kickreason, sizeof(kickreason), ""#COL_WHITE"You've been "#COL_RED"kicked "#COL_WHITE"from the server.\n"#COL_WHITE"Reason: "#COL_YELLOW"%s", reason);
	ShowPlayerDialog(playerid, dKickMessage, DIALOG_STYLE_MSGBOX, ""#COL_RED"Notification", kickreason, "Close", "");
	kickt = SetTimerEx("ki", 50, false, "d", playerid);
	return 1;
}

forward ki(playerid);
public ki(playerid)
{
	Kick(playerid);
	return 1;
}
And when the function "KI" initiates, the server crashes.
Код:
[23:40:53] [debug] Server crashed while executing green.amx
[23:40:53] [debug] AMX backtrace:
[23:40:53] [debug] Native backtrace:
[23:40:53] [debug] #0 651151e2 in ?? () from plugins\profiler.DLL
[23:40:53] [debug] #1 65115976 in ?? () from plugins\profiler.DLL
[23:40:53] [debug] #2 65110116 in ?? () from plugins\profiler.DLL
[23:40:53] [debug] #3 6510ab72 in ?? () from plugins\profiler.DLL
[23:40:53] [debug] #4 66264078 in ?? () from plugins\crashdetect.DLL
[23:40:53] [debug] #5 6625a767 in ?? () from plugins\crashdetect.DLL
[23:40:53] [debug] #6 6625d65a in ?? () from plugins\crashdetect.DLL
[23:40:53] [debug] #7 652c4629 in ?? () from plugins\streamer.DLL
[23:40:53] [debug] #8 65115a4b in ?? () from plugins\profiler.DLL
[23:40:53] [debug] #9 65110dcb in ?? () from plugins\profiler.DLL
[23:40:53] [debug] #10 6510abba in ?? () from plugins\profiler.DLL
[23:40:53] [debug] #11 0046e8d0 in ?? () from samp-server.exe
[23:40:53] [debug] #12 0048f6ab in ?? () from samp-server.exe
[23:40:53] [debug] #13 6530514d in ?? () from plugins\streamer.DLL
[23:40:53] [debug] #14 77e6b2dc in ?? () from C:\WINDOWS\SYSTEM32\ntdll.dll
[23:40:53] [debug] Registers:
[23:40:53] [debug] EAX: 02877ae8 EBX: 00000001 ECX: 00000000 EDX: 80000000
[23:40:53] [debug] ESI: 02a0a8f8 EDI: 00000025 EBP: 00000000 ESP: 0019fde8
[23:40:53] [debug] EIP: 77e6b2dc EFLAGS: 00010202
[23:40:53] [debug] Stack:
[23:40:53] [debug] ESP+00000000: 77a2eca0 00000000 022d9ee8 77a2eca0
[23:40:53] [debug] ESP+00000020: 00000000 004910b4 02985c58 77a2eca0
[23:40:53] [debug] ESP+00000040: 3bb44228 0048d4db 00000000 000023f0
[23:40:53] [debug] ESP+00000060: 00000032 00001e61 00000224 00009368
[23:40:53] [debug] ESP+00000080: 004c4020 004c401c 00225000 004ab4a0
[23:40:53] [debug] ESP+000000a0: 004ba2f8 ffffffff 0049b4a1 0049b4b1
[23:40:53] [debug] ESP+000000c0: 0049cca6 00000001 022d16a0 022d16e0
[23:40:53] [debug] ESP+000000e0: 00000002 00000000 00000000 00000000
[23:40:53] [debug] ESP+00000100: 00000000 00000000 00000000 00000000
[23:40:53] [debug] ESP+00000120: 00000000 00000000 00000000 00000000
[23:40:53] [debug] ESP+00000140: 00000000 00000000 00000000 00000000
[23:40:53] [debug] ESP+00000160: 0049cb52 0049cb3a 0049cb3a 00225000
[23:40:53] [debug] ESP+00000180: 0019feb8 0019f0a4 0019ffcc 0049d208
[23:40:53] [debug] ESP+000001a0: 00225000 779d8720 e5235c78 0019ffdc
[23:40:53] [debug] ESP+000001c0: 00000000 00225000 00000000 00000000
[23:40:53] [debug] ESP+000001e0: 00000000 0019ffe4 77e89fd0 dc69dfc9
[23:40:53] [debug] ESP+00000200: 77e96397 00000000 00000000 0049cb3a
[23:40:53] [debug] ESP+00000220: 00000001 000032f8 000000dc 00000000
[23:40:53] [debug] ESP+00000240: 00000007 00000034 0000017c 00000001
[23:40:53] [debug] ESP+00000260: 00000000 00000002 1a26ef4e 00000298
[23:40:53] [debug] ESP+00000280: f33271ba 00000534 0000004a 00000580
[23:40:53] [debug] ESP+000002a0: 00000032 000008ec 000002fa 00000000
[23:40:53] [debug] ESP+000002c0: 00000330 00000000 38505fc8 00000f5c
[23:40:53] [debug] ESP+000002e0: b1280544 00001314 00000056 0000136c
[23:40:53] [debug] ESP+00000300: 00000002 00000001 0000017c 000015bc
[23:40:53] [debug] ESP+00000320: 00000001 00000003 00001ed8 00000e8c
[23:40:53] [debug] ESP+00000340: 00000002 00000005 00003078 00000098
[23:40:53] [debug] ESP+00000360: 00000002 00000007 000031dc 000000f0
[23:40:53] [debug] ESP+00000380: 00000002 0000000b 000032f4 00000004
[23:40:53] [debug] ESP+000003a0: 00000001 00000001 00000006 0000008c
[23:40:53] [debug] ESP+000003c0: 0000005e 00000000 00000000 00000000
[23:40:53] [debug] ESP+000003e0: 00000000 00000000 00000002 00000024
[23:40:53] [debug] Loaded modules:
[23:40:53] [debug] 00400000 - 00519000 samp-server.exe
[23:40:53] [debug] 77e10000 - 77f9e000 ntdll.dll
[23:40:53] [debug] 779c0000 - 77a90000 KERNEL32.DLL
[23:40:53] [debug] 75af0000 - 75cb2000 KERNELBASE.dll
[23:40:53] [debug] 763d0000 - 77718000 SHELL32.dll
[23:40:53] [debug] 74d60000 - 74e1d000 msvcrt.dll
[23:40:53] [debug] 75a10000 - 75a49000 cfgmgr32.dll
[23:40:53] [debug] 77720000 - 77838000 ucrtbase.dll
[23:40:53] [debug] 75850000 - 758dc000 shcore.dll
[23:40:53] [debug] 75f00000 - 75fc0000 RPCRT4.dll
[23:40:53] [debug] 748e0000 - 74900000 SspiCli.dll
[23:40:53] [debug] 748d0000 - 748da000 CRYPTBASE.dll
[23:40:53] [debug] 77a90000 - 77ae7000 bcryptPrimitives.dll
[23:40:53] [debug] 75fc0000 - 76001000 sechost.dll
[23:40:53] [debug] 75cc0000 - 75ef8000 combase.dll
[23:40:53] [debug] 752c0000 - 75844000 windows.storage.dll
[23:40:53] [debug] 76100000 - 76177000 advapi32.dll
[23:40:53] [debug] 759c0000 - 75a05000 shlwapi.dll
[23:40:53] [debug] 75290000 - 752b1000 GDI32.dll
[23:40:53] [debug] 76260000 - 763b8000 gdi32full.dll
[23:40:53] [debug] 77c90000 - 77d09000 msvcp_win.dll
[23:40:53] [debug] 74fb0000 - 750ec000 USER32.dll
[23:40:53] [debug] 75a60000 - 75a76000 win32u.dll
[23:40:53] [debug] 74930000 - 7493e000 kernel.appcore.dll
[23:40:53] [debug] 750f0000 - 75135000 powrprof.dll
[23:40:53] [debug] 75a50000 - 75a60000 profapi.dll
[23:40:53] [debug] 718d0000 - 718d8000 WSOCK32.dll
[23:40:53] [debug] 72270000 - 72294000 WINMM.dll
[23:40:53] [debug] 75a80000 - 75ae7000 WS2_32.dll
[23:40:53] [debug] 71d50000 - 71d73000 WINMMBASE.dll
[23:40:53] [debug] 74900000 - 74925000 IMM32.DLL
[23:40:53] [debug] 66240000 - 66290000 crashdetect.DLL
[23:40:53] [debug] 723c0000 - 72429000 MSVCP100.dll
[23:40:53] [debug] 72430000 - 724ef000 MSVCR100.dll
[23:40:53] [debug] 661e0000 - 66232000 mysql.DLL
[23:40:53] [debug] 70d10000 - 70d2c000 log-core.dll
[23:40:53] [debug] 65f60000 - 65fcd000 MSVCP140.dll
[23:40:53] [debug] 661c0000 - 661d5000 VCRUNTIME140.dll
[23:40:53] [debug] 646d0000 - 647b1000 libmariadb.dll
[23:40:53] [debug] 72ad0000 - 72ae1000 napinsp.dll
[23:40:53] [debug] 72ab0000 - 72ac6000 pnrpnsp.dll
[23:40:53] [debug] 6fa10000 - 6fa23000 NLAapi.dll
[23:40:53] [debug] 6d7b0000 - 6d7fe000 mswsock.dll
[23:40:53] [debug] 72190000 - 7220f000 DNSAPI.dll
[23:40:53] [debug] 759b0000 - 759b7000 NSI.dll
[23:40:53] [debug] 72390000 - 723bf000 IPHLPAPI.DLL
[23:40:53] [debug] 72aa0000 - 72aab000 winrnr.dll
[23:40:53] [debug] 6d700000 - 6d708000 rasadhlp.dll
[23:40:53] [debug] 10000000 - 1000f000 sscanf.DLL
[23:40:53] [debug] 65320000 - 65359000 pawncmd.DLL
[23:40:53] [debug] 652c0000 - 6531a000 streamer.DLL
[23:40:53] [debug] 65100000 - 6513d000 profiler.DLL
[23:40:53] [debug] 6d6b0000 - 6d6fa000 fwpuclnt.dll
[23:40:53] [debug] 70cc0000 - 70cd8000 bcrypt.dll
What's the problem? And is there an alternative to fix the code?
Reply
#2

You must use 3 zeros after your number 5.

PHP код:
forward kick(playeridreason[]);
public 
kick(playeridreason[])
{
    new 
kickreason[512];
    
format(kickreasonsizeof(kickreason), ""#COL_WHITE"You've been "#COL_RED"kicked "#COL_WHITE"from the server.\n"#COL_WHITE"Reason: "#COL_YELLOW"%s", reason);
    
ShowPlayerDialog(playeriddKickMessageDIALOG_STYLE_MSGBOX""#COL_RED"Notification", kickreason, "Close", "");
    
kickt SetTimerEx("ki"5000false"d"playerid);
    return 
1;
}
forward ki(playerid);
public 
ki(playerid)
{
    
Kick(playerid);
    return 
1;

Try and say me that it's the good solution.
Reply
#3

Quote:
Originally Posted by BreakStore
Посмотреть сообщение
You must use 3 zeros after your number 5.

PHP код:
forward kick(playeridreason[]);
public 
kick(playeridreason[])
{
    new 
kickreason[512];
    
format(kickreasonsizeof(kickreason), ""#COL_WHITE"You've been "#COL_RED"kicked "#COL_WHITE"from the server.\n"#COL_WHITE"Reason: "#COL_YELLOW"%s", reason);
    
ShowPlayerDialog(playeriddKickMessageDIALOG_STYLE_MSGBOX""#COL_RED"Notification", kickreason, "Close", "");
    
kickt SetTimerEx("ki"5000false"d"playerid);
    return 
1;
}
forward ki(playerid);
public 
ki(playerid)
{
    
Kick(playerid);
    return 
1;

Try and say me that it's the good solution.
No, it doesn't fix it. It just kicks me in 5 seconds and the server crashes.
Reply
#4

Oh, and just for info, this doesn't work, it just doesnt kick me:
Код:
kickt = SetTimerEx("Kick", 50, false, "d", playerid);
Reply
#5

This shit happens only when function Kick is called. When i disconnect normally without kicks, it works fine. But when i disconnect using Kick, it crashes the server.
Reply
#6

Oh, it's because I created a function named kick (not capital k), and there was a function Kick (capital K).
it thought that functions were sensetive to capital letters...
Well, the crashes got fixed when i changed kick to gkick.
Reply
#7

Your problem is solved ?
Reply
#8

Quote:
Originally Posted by BreakStore
Посмотреть сообщение
Your problem is solved ?
Yes, check my previous message
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)