Thread: [Solved] Problerm with autokick
View Single Post
Author Message
Barlap
Senior Member
Join Date: Apr 2016
Location: Romania
Old 07-26-2020 , 10:09   Problerm with autokick
Reply With Quote #1

Hello, i have a plugin that sould autokick a player with a certain ip every 30 seconds, but instead the plugin kicks everybody. can you help me please guys?
Code:
#include <amxmodx>
#include <amxmisc>

#pragma semicolon 1

#define zIP     "178.138.33.138";

new const
PLUGIN_NAME[ ] 		= "Autokick enemy",
PLUGIN_VERSION[ ] 	= "1.0";

public plugin_init( )
{
	
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, "Barlap" );
	
	// Add your code here...
}

public client_putinserver( id ){
	new szIP[40];
	get_user_ip ( id, szIP, charsmax(szIP) , 1 ); // Get player's IP 

	if( !task_exists( id + 1337 ) && !equal(szIP, "zIP")  )
	{
	set_task( 30.0, "task_NextPlayer", id + 1337 );
	}
	else
	return PLUGIN_HANDLED;
}

public task_NextPlayer( id )
{
	id -= 1337;
	if( !is_user_connected( id ) )
		return;
	
	server_cmd( "kick #%d ^"Bye loser^"", get_user_userid( id ) );
	
}

Last edited by Barlap; 08-03-2020 at 14:19.
Barlap is offline
Send a message via ICQ to Barlap Send a message via Skype™ to Barlap