...not sure how this should work.
But from server, I used mp_disable_autokick userid to myself and I called votekick to myself, it works.
But not work other way.
When using rcon (or server set mp_disable_autokick to player), it grant player as "admin", in SRCDS. Not SourceMod.
*edit
Thats odd... now it works without "disable autokick" feature. But I had virtual servers LAN connections before, disturbing my rcon connection to SRCDS.
Maybe if you have same IP as SRCDS it works.
*edit
This problem happen in same LAN ?
*edit
Something odd happened, and I can't re-process that again... now it works fine.
*edit
Try this
PHP Code:
public void OnPluginStart()
{
// When vote start, vote starter and target made vote in same tick.
HookEvent("vote_started", vote_started); // issue #L4D_vote_kick_player
HookEvent("vote_cast_yes", vote_started);
HookEvent("vote_cast_no", vote_started);
HookEvent("vote_failed", vote_started);
HookEvent("vote_passed", vote_started); // details #L4D_vote_passed_kick_player
}
public void vote_started(Event event, const char[] name, bool dontBroadcast)
{
static int tick = 0;
static int target = 0;
if(StrEqual(name, "vote_started", false))
{
char buffer[30];
event.GetString("issue", buffer, sizeof(buffer), " ");
if(StrEqual(buffer, "#L4D_vote_kick_player", false))
{
tick = GetGameTickCount();
}
return;
}
else if(StrEqual(name, "vote_passed", false))
{
char buffer[30];
event.GetString("details", buffer, sizeof(buffer), " ");
if(StrEqual(buffer, "#L4D_vote_passed_kick_player", false))
{
//KickClient(GetClientOfUserId(target), "You have been voted off");
CreateTimer(10.0, delay, target);
}
//return;
}
else if(StrEqual(name, "vote_cast_yes", false))
{
if(GetGameTickCount() == tick)
{
target = GetClientUserId(event.GetInt("entityid")); // If vote starter vote itself
}
return;
}
else if(StrEqual(name, "vote_cast_no", false))
{
if(GetGameTickCount() == tick)
{
target = GetClientUserId(event.GetInt("entityid"));
}
return;
}
target = 0;
}
public Action delay(Handle timer, any userid)
{
int target = GetClientOfUserId(userid);
// Works only if client is still in server
if(target && IsClientConnected(target) && !IsClientInKickQueue(target))
{
KickClient(target, "You have been voted off");
}
return Plugin_Continue;
}
__________________