View Single Post
Rothgar
Veteran Member
Join Date: Nov 2007
Old 01-19-2018 , 21:32   Re: [ANY] AFK Manager (Version 4.2.0 / Updated January 19th 2018)
Reply With Quote #1900

Quote:
Originally Posted by yatchi View Post
I need some help with the AFKM_SetClientImmunity native, when my plugin tries to call it, it throws an error:

L 01/19/2018 - 11:51:57: [SM] Exception reported: Invalid Immunity Type (10)

(yes, why the f*** it says 10 when AFKImmunity_Kick stands for 2)

On the plugin:
PHP Code:
AFKM_SetClientImmunity(clientAFKImmunity_Kick); 
And I have compiled the plugin myself without any changes, because downloading the .smx auto-compiled throws this error:

[SM] failed to load: Native "AFKM_SetClientImmunity" was not found.
I checked the downloaded compiled version was working but I have found the issue you faced and it has been fixed. It was picking up the immunity parameter as the client id.

Below is a test plugin I was using for testing if anyone cares:

Code:
#include <sourcemod>
#include <afk_manager>

#pragma semicolon 1

#pragma newdecls required

#define AFKM_TEST_VERSION				"1.0"

// Plugin Information
public Plugin myinfo =
{
    name = "AFK Manager - Test Plugin",
    author = "Rothgar",
    description = "Testing AFK Manager Include File",
    version = AFKM_TEST_VERSION,
    url = "http://www.dawgclan.net"
};

void RegisterCvars() // Cvar Registrations
{
}

void RegisterCmds() // Command Hook & Registrations
{
	RegAdminCmd("sm_afktest", Command_Test, ADMFLAG_ROOT);
}

public Action Command_Test(int client, int args)
{
	if (args < 1)
	{
		PrintToConsole(client, "Usage: sm_afktest <Immunity Int>");
		return Plugin_Handled;
	}

	char arg[5];
	GetCmdArg(1, arg, sizeof(arg));
	int iImmunity = StringToInt(arg);
	AFKM_SetClientImmunity(client, view_as<AFKImmunity>(iImmunity));
	return Plugin_Handled;
}

public void OnPluginStart()
{
	RegisterCvars(); // Register Cvars
	RegisterCmds(); // Register Commands
}

public void OnMapStart()
{
	AutoExecConfig(true, "afk_manager.csgo_teamchange"); // Execute Config
}
Rothgar is offline
Send a message via ICQ to Rothgar Send a message via AIM to Rothgar Send a message via MSN to Rothgar