diff --git a/SMJSONAPI/scripting/SMJSONAPI.sp b/SMJSONAPI/scripting/SMJSONAPI.sp index c2f825b0..9727bf90 100644 --- a/SMJSONAPI/scripting/SMJSONAPI.sp +++ b/SMJSONAPI/scripting/SMJSONAPI.sp @@ -195,8 +195,14 @@ static int HandleRequest(int Client, JSONObject jRequest, JSONObject jResponse) Function Fun = GetFunctionByName(INVALID_HANDLE, sAPIFunction); if(Fun == INVALID_FUNCTION) { + /* int Res = Call_StartNative(sFunction); if(!Res) + */ + int Res = 0; + #if defined Call_StartNative + Res = Call_StartNative(sFunction); + #endif { JSONObject jError = new JSONObject(); jError.SetString("error", "Invalid function specified."); @@ -385,7 +391,13 @@ static int HandleRequest(int Client, JSONObject jRequest, JSONObject jResponse) int Result; static char sException[1024]; - int Error = Call_FinishEx(Result, sException, sizeof(sException)); + #if defined Call_FinishEx + int Error = Call_FinishEx(Result, sException, sizeof(sException)); + #else + int Error = Call_Finish(Result); + #endif + + //int Error = Call_FinishEx(Result, sException, sizeof(sException)); if(Error != SP_ERROR_NONE) {