AlliedModders Donor
|
04-27-2017
, 13:39
Re: [RELEASE] SourceBans++ (v1.6.0) [Updated: 2017-04-23]
|
#1024
|
Quote:
Originally Posted by cravenge
In sbpp_main.sp, instead of SP_ERROR_NATIVE, they use 1 and 2 (which is SP_ERROR_FILE_FORMAT and SP_ERROR_DECOMPRESSOR respectively in functions.inc) when a native returns an error, hence why it was producing those errors.
And in sbpp_comms.sp, (Don't mind the new syntax) I think it should be:
PHP Code:
public Native_SetClientMute(Handle hPlugin, int numParams) { int target = GetNativeCell(1); if (target < 1 || target > MaxClients) { ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", target); return false; }
if (!IsClientInGame(target)) { ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", target); return false; } bool muteState = bool:GetNativeCell(2); int muteLength = GetNativeCell(3); if (muteState && muteLength == 0) { ThrowNativeError(SP_ERROR_NATIVE, "Permanent mute is not allowed!"); return false; }
bool bSaveToDB = bool:GetNativeCell(4); if (!muteState && bSaveToDB) { ThrowNativeError(SP_ERROR_NATIVE, "Removing punishments from DB is not allowed!"); return false; }
char sReason[256]; GetNativeString(5, sReason, sizeof(sReason));
if (muteState) { if (g_MuteType[target] > bNot) { return false; }
PerformMute(target, _, muteLength, _, _, _, sReason); if (bSaveToDB) SavePunishment(_, target, TYPE_MUTE, muteLength, sReason); } else { if (g_MuteType[target] == bNot) { return false; }
PerformUnMute(target); }
return true; }
instead of:
PHP Code:
public Native_SetClientMute(Handle:hPlugin, numParams) { new target = GetNativeCell(1); if (target < 1 || target > MaxClients) { return ThrowNativeError(SP_ERROR_NATIVE, "Invalid client index %d", target); }
if (!IsClientInGame(target)) { return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not in game", target); }
new bool:muteState = GetNativeCell(2); new muteLength = GetNativeCell(3); if (muteState && muteLength == 0) { return ThrowNativeError(SP_ERROR_NATIVE, "Permanent mute is not allowed!"); }
new bool:bSaveToDB = GetNativeCell(4); if (!muteState && bSaveToDB) { return ThrowNativeError(SP_ERROR_NATIVE, "Removing punishments from DB is not allowed!"); }
new String:sReason[256]; GetNativeString(5, sReason, sizeof(sReason));
if (muteState) { if (g_MuteType[target] > bNot) { return false; }
PerformMute(target, _, muteLength, _, _, _, sReason);
if (bSaveToDB) SavePunishment(_, target, TYPE_MUTE, muteLength, sReason); } else { if (g_MuteType[target] == bNot) { return false; }
PerformUnMute(target); }
return true; }
|
https://github.com/sbpp/sourcebans-pp/pull/270
https://github.com/sbpp/sourcebans-pp/pull/271
This has been fixed now. Next time just make an Pull Request in the SourceBans++ repo on Github.
Last edited by Groruk; 04-27-2017 at 13:48.
Reason: Added Quote
|
|