Server crashes.Ban system -
Dziugsas - 19.06.2014
Hello guys i wanted to ask you whats bad with my simple ban system.Cause when i ban player and he reconnects server crashes.
Код:
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
if(PlayerInfo[playerid][Banned] == 1)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
SendClientMessageToAll(COL_RED,"Server blocked the connection for %s.Reason: Banned.");
SendClientMessage(playerid,COL_RED,"You are banned in this server!");
Kick(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{ff0000}Login","{00ff66} Type your password below to login.","Login","Quit");
}
}
Код:
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,COL_ADMINGREEN,"This command is only for 3 level admins or higher!");
new reason[60],pName[MAX_PLAYER_NAME],aName[MAX_PLAYER_NAME],targetid,string[200],string0[150],str[100];
if(sscanf(params, "us[64]", targetid, reason)) return SendClientMessage(playerid, COL_ADMINGREEN, ""TCRED"USAGE:"TCADMINGREEN" /ban [PlayerID or Name] [Reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,COL_ADMINGREEN,"Player is not connected!");
SavePlayerData(targetid);
GetPlayerName(playerid,aName,sizeof(aName));
GetPlayerName(targetid,pName,sizeof(pName));
format(string,sizeof(string),""TCWHITE"["TCRED"%s"TCWHITE"]"TCYELLOW"%s "TCADMINGREEN"banned "TCRED"%s "TCADMINGREEN"from the server.[Reason : "TCRED"%s"TCADMINGREEN"]",AdminRank(playerid),aName,pName,reason);
SendClientMessageToAll(COL_LIGHTBLUE,string);
format(string0,sizeof(string0),"You have been banned from the server!By: %s. Reason: %s",aName,reason);
SendClientMessage(targetid,COL_LIGHTBLUE,string0);
format(str,sizeof(str),"[%s]%s banned %s from the server.[Reason : %s]",AdminRank(playerid),aName,pName,reason);
print(str);
Kick(targetid);
PlayerInfo[targetid][Banned] = 1;
return 1;
}
Re: Server crashes.Ban system -
Konstantinos - 19.06.2014
Load
crashdetect plugin and after a server crash, post your server log.
Re: Server crashes.Ban system -
Dziugsas - 19.06.2014
Server log
Код:
SA-MP Dedicated Server
----------------------
v0.3z-R2, ©2005-2014 SA-MP Team
[16:47:10]
[16:47:10] Server Plugins
[16:47:10] --------------
[16:47:10] Loading plugin: sscanf
[16:47:10]
[16:47:10] ===============================
[16:47:10] sscanf plugin loaded.
[16:47:10] Version: 2.8.1
[16:47:10] © 2012 Alex "******" Cole
[16:47:10] ===============================
[16:47:10] Loaded.
[16:47:10] Loading plugin: streamer
[16:47:10]
*** Streamer Plugin v2.6.1 by Incognito loaded ***
[16:47:10] Loaded.
[16:47:10] Loading plugin: whirlpool
[16:47:10]
[16:47:10] ==================
[16:47:10]
[16:47:10] Whirlpool loaded
[16:47:10]
[16:47:10] ==================
[16:47:10]
[16:47:10] Loaded.
[16:47:10] Loading plugin: crashdetect
[16:47:10] CrashDetect v4.13.1-lse is OK.
[16:47:10] Loaded.
[16:47:10] Loaded 4 plugins.
[16:47:10]
[16:47:10] Filterscripts
[16:47:10] ---------------
[16:47:10] Loading filterscript 'weapons.amx'...
[16:47:10]
--------------------------------------
[16:47:10] Weapon Spawner by FusiouS loaded
[16:47:10] Version: 1.0, Release 1
[16:47:10] --------------------------------------
[16:47:10] Loading filterscript 'cs.amx'...
[16:47:10] Loaded 2 filterscripts.
[16:47:10]
[16:47:10]
[16:47:10]
[16:47:10] =======================================
[16:47:10] | |
[16:47:10] | YSI version 3.09.0684 |
[16:47:10] | By Alex "******" Cole |
[16:47:10] | |
[16:47:10] =======================================
[16:47:10]
[16:47:10]
[16:47:10]
[16:47:10] \
-----------------------\
[16:47:10] \Basic Role-Play Mod!-\
[16:47:10] \-------------------------\
[16:47:10] Number of vehicle models: 0
[16:47:11]
[16:47:11] ==========================================
[16:47:11] | |
[16:47:11] | A new version (v<html>
) of YSI is |
[16:47:11] | available from: |
[16:47:11] | |
[16:47:11] | www.y-less.com/YSI/YSI_1.0.zip |
[16:47:11] | |
[16:47:11] ==========================================
[16:47:11]
[16:47:41] Incoming connection: 127.0.0.1:59558
[16:47:41] [join] Interneto_Tiekeja has joined the server (0:127.0.0.1)
Crashinfo
Код:
--------------------------
SA-MP Server: 0.3z-R2
Exception At Address: 0x00401696 Module: (samp-server.exe)
Registers:
EAX: 0x0241A668 EBX: 0x0241A668 ECX: 0x00000000 EDX: 0x0018E7FC
ESI: 0x0241A668 EDI: 0x00000000 EBP: 0x767958E9 ESP: 0x0018FDC4
EFLAGS: 0x00010202
Stack:
+0000: 0x00401726 0x0241A668 0x0018FDE0 0x00000000
+0010: 0x0241A668 0x767958E9 0x0241A668 0x00000000
+0020: 0x00000000 0x00000000 0x00000000 0x00000000
+0030: 0xFFFF3CB0 0xFFFFFFFF 0x00000000 0x0018FDC0
+0040: 0x0046CCB5 0x0241A668 0x004AE87C 0x0018FE1C
+0050: 0x01FD8FA0 0x0241A668 0x0241A668 0x00489B91
+0060: 0x7678090E 0x01FD8FA0 0x00000000 0x00487EBE
+0070: 0x00000000 0x000023F0 0x0018FF84 0x7FFDE000
+0080: 0x0000E000 0x00010101 0x0000000A 0x00001E61
+0090: 0x00000120 0x00000EE8 0x01FD8FA0 0x656D6167
+00A0: 0x65646F6D 0x00003531 0x004BC014 0x004BC010
+00B0: 0x7FFDE000 0x004A6860 0x0018FE6C 0x0018FF74
+00C0: 0x0018FF74 0x00498708 0x004B3048 0xFFFFFFFF
+00D0: 0x004969A1 0x004969B1 0x004A6860 0x0018FF74
+00E0: 0x004A64D1 0xFFFFFFFF 0x004981A6 0x00000001
+00F0: 0x01FD12C0 0x01FD1308 0x00000094 0x00000006
+0100: 0x00000002 0x000023F0 0x00000002 0x00000000
+0110: 0x00000000 0x00000000 0x00000000 0x00000000
+0120: 0x00000000 0x00000000 0x00000000 0x00000000
+0130: 0x00000000 0x00000000 0x00000000 0x00000000
--------------------------
Loaded Modules:
samp-server.exe A: 0x00400000 - 0x004F5000 (C:\Users\burni_000\Desktop\Mokymasis\samp-server.exe)
ntdll.dll A: 0x77C90000 - 0x77DE7000 (C:\Windows\SYSTEM32\ntdll.dll)
KERNEL32.DLL A: 0x76770000 - 0x768A0000 (C:\Windows\SYSTEM32\KERNEL32.DLL)
KERNELBASE.dll A: 0x753D0000 - 0x75476000 (C:\Windows\SYSTEM32\KERNELBASE.dll)
SHELL32.dll A: 0x75480000 - 0x76546000 (C:\Windows\SYSTEM32\SHELL32.dll)
USER32.dll A: 0x76F50000 - 0x77066000 (C:\Windows\SYSTEM32\USER32.dll)
WSOCK32.dll A: 0x74F80000 - 0x74F88000 (C:\Windows\SYSTEM32\WSOCK32.dll)
WINMM.dll A: 0x72F40000 - 0x72F61000 (C:\Windows\SYSTEM32\WINMM.dll)
msvcrt.dll A: 0x76650000 - 0x76701000 (C:\Windows\SYSTEM32\msvcrt.dll)
combase.dll A: 0x776D0000 - 0x77806000 (C:\Windows\SYSTEM32\combase.dll)
SHLWAPI.dll A: 0x765B0000 - 0x765F0000 (C:\Windows\SYSTEM32\SHLWAPI.dll)
GDI32.dll A: 0x77070000 - 0x7716D000 (C:\Windows\SYSTEM32\GDI32.dll)
WS2_32.dll A: 0x77B80000 - 0x77BD0000 (C:\Windows\SYSTEM32\WS2_32.dll)
WINMMBASE.dll A: 0x72F10000 - 0x72F3B000 (C:\Windows\SYSTEM32\WINMMBASE.dll)
RPCRT4.dll A: 0x773E0000 - 0x7748C000 (C:\Windows\SYSTEM32\RPCRT4.dll)
NSI.dll A: 0x76B50000 - 0x76B58000 (C:\Windows\SYSTEM32\NSI.dll)
cfgmgr32.dll A: 0x76720000 - 0x76766000 (C:\Windows\SYSTEM32\cfgmgr32.dll)
DEVOBJ.dll A: 0x776B0000 - 0x776CE000 (C:\Windows\SYSTEM32\DEVOBJ.dll)
SspiCli.dll A: 0x75280000 - 0x7529C000 (C:\Windows\SYSTEM32\SspiCli.dll)
CRYPTBASE.dll A: 0x75270000 - 0x75279000 (C:\Windows\SYSTEM32\CRYPTBASE.dll)
sechost.dll A: 0x76610000 - 0x76644000 (C:\Windows\SYSTEM32\sechost.dll)
bcryptPrimitives.dll A: 0x75210000 - 0x75261000 (C:\Windows\SYSTEM32\bcryptPrimitives.dll)
IMM32.DLL A: 0x765F0000 - 0x76610000 (C:\Windows\system32\IMM32.DLL)
MSCTF.dll A: 0x76E70000 - 0x76F4E000 (C:\Windows\SYSTEM32\MSCTF.dll)
sscanf.DLL A: 0x10000000 - 0x1000D000 (C:\Users\burni_000\Desktop\Mokymasis\plugins\sscanf.DLL)
MSVCR100.dll A: 0x71D50000 - 0x71E0F000 (C:\Windows\SYSTEM32\MSVCR100.dll)
streamer.DLL A: 0x71D10000 - 0x71D4E000 (C:\Users\burni_000\Desktop\Mokymasis\plugins\streamer.DLL)
MSVCP100.dll A: 0x637C0000 - 0x63829000 (C:\Windows\SYSTEM32\MSVCP100.dll)
nativechecker.DLL A: 0x71EF0000 - 0x71EF5000 (C:\Users\burni_000\Desktop\Mokymasis\plugins\nativechecker.DLL)
whirlpool.DLL A: 0x002B0000 - 0x002BC000 (C:\Users\burni_000\Desktop\Mokymasis\plugins\whirlpool.DLL)
MSVCR80.dll A: 0x71F00000 - 0x71F9B000 (C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6910_none_d089c358442de345\MSVCR80.dll)
mswsock.dll A: 0x738F0000 - 0x7393A000 (C:\Windows\system32\mswsock.dll)
napinsp.dll A: 0x738D0000 - 0x738E0000 (C:\Windows\system32\napinsp.dll)
pnrpnsp.dll A: 0x738B0000 - 0x738C4000 (C:\Windows\system32\pnrpnsp.dll)
NLAapi.dll A: 0x73A10000 - 0x73A20000 (C:\Windows\system32\NLAapi.dll)
DNSAPI.dll A: 0x73830000 - 0x738A5000 (C:\Windows\SYSTEM32\DNSAPI.dll)
winrnr.dll A: 0x73820000 - 0x73829000 (C:\Windows\System32\winrnr.dll)
IPHLPAPI.DLL A: 0x74E30000 - 0x74E50000 (C:\Windows\SYSTEM32\IPHLPAPI.DLL)
WINNSI.DLL A: 0x74D90000 - 0x74D98000 (C:\Windows\SYSTEM32\WINNSI.DLL)
rasadhlp.dll A: 0x73810000 - 0x73817000 (C:\Windows\System32\rasadhlp.dll)
Re: Server crashes.Ban system -
Konstantinos - 19.06.2014
I cannot understand the crashinfo (unfortunately) and I can only fix server crashes from the information crashdetect gives but in your case, it did not print anything to the server log.
Re: Server crashes.Ban system -
Dziugsas - 19.06.2014
So how can i make another ban system?
Re: Server crashes.Ban system -
Dziugsas - 19.06.2014
got it fixed.i havent formated string and used it wrong.