Raised This Month: $ Target: $400
 0% 

Solved Problerm with autokick


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode