|
楼主 |
发表于 2010-6-10 13:21:22
|
显示全部楼层
来自 中国–福建–漳州
本帖最后由 Rulzy 于 2010-6-10 13:24 编辑
- procedure C_ClientCommand(Player: Pointer); cdecl;
- var
- Command: string;
- Index, UserID: Integer;
- AuthID: string;
- BanTime: Integer;
- begin
- Command:=LowerCase(gEngFuncs.pfnCmd_Argv(0));
- if Command='dlfile' then
- begin
- Index:=gEngFuncs.pfnIndexOfEdict(Player);
- if (Index>=1) and (Index<=gpGlobals.maxClients) and gPlayers[Index].InGame then
- begin
- UserID:=gEngFuncs.pfnGetPlayerUserId(Player);
- AuthID:=gEngFuncs.pfnGetPlayerAuthId(Player);
- BanTime:=Trunc(gEngFuncs.pfnCVarGetFloat('antidlfile_bantime'));
- if BanTime<0 then
- begin
- LogPrint('Kicked "%s<%d><%s><>" (address "%s") due to using "cmd dlfile" command.',
- [gPlayers[Index].Name, UserID, AuthID, gPlayers[Index].Address]);
- gEngFuncs.pfnClientPrintf(Player, print_console, 'You have been kicked due to using "cmd dlfile" command.'#10);
- gEngFuncs.pfnServerCommand(PChar(Format('kick #%d'#10, [UserID])));
- gEngFuncs.pfnServerExecute;
- end else begin
- LogPrint('Banned "%s<%d><%s><>" (address "%s") due to using "cmd dlfile" command.',
- [gPlayers[Index].Name, UserID, AuthID, gPlayers[Index].Address]);
- gEngFuncs.pfnClientPrintf(Player, print_console, 'You have been banned due to using "cmd dlfile" command.'#10);
- gEngFuncs.pfnServerCommand(PChar(Format('kick #%d'#10, [UserID])));
- gEngFuncs.pfnServerExecute;
- gEngFuncs.pfnServerCommand(PChar(Format('wait; addip %d %s; wait; writeip;'#10, [BanTime, gPlayers[Index].Address])));
- end;
- gpMetaGlobals.mres:=MRES_SUPERCEDE;
- Exit;
- end;
- end;
- gpMetaGlobals.mres:=MRES_IGNORED;
- end;
复制代码 这是判断代码。只有玩家执行了 dlfile 命令,才有可能被踢的啊。如果说有误踢,可能在于判断gPlayers[Index].InGame上,而没有使用 dlfile 命令的,又怎么会被踢呢?实在想不通。 |
|