Page 1 of 1

Kick wrong player

Posted: May 29th, 2010, 6:20 pm
by Moustache
This script kicks the wrong player. It kicks someone that connects to the server.
So if someone has 1 = true and his time = 60 or bigger then the player that connects gets kicked. Instead of the player that has time = 60 or bigger.

custom_public.gcs

Code: Select all

onNewConnection()
{
	self endon( "disconnect" );
	for(;;)
	{
		level waittill("connected", player);
		player thread promod_ruleset\player::setkick();
	}
}
player.gcs

Code: Select all

setkick()
{
	for(;;)
	{
		wait 10;

		if( 1 == "true" )
		{
			self.time+=10;

			if(self.time == 40)
			{
				self IPrintLnBold("You are getting ^1kicked ^7in 20 seconds");
			}

			else if(self.time >= 60)
			{
				IPrintLn("^1" + self.name + " ^7is kicked");
				Kick(self.clientid);
			}
		}
		else  if( 1 != "true" )
		{
			self.time = 0;
		}
	}
}

Re: Kick wrong player

Posted: May 29th, 2010, 7:40 pm
by Drofder2004
What are you trying to achieve by doing "1 == true"

0 = False
1 = True

Your if statements are redundant...

Re: Kick wrong player

Posted: June 1st, 2010, 12:55 pm
by Moustache
I forgot to set self.time = 0 before the loop.
Fail @ me :oops: again...

Thanxs for trying to help me :)

Re: Kick wrong player

Posted: June 1st, 2010, 7:09 pm
by Drofder2004
I am still confused by your 1 == "true" statement, but good luck with it...