Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!
Moderator: Core Staff
-
Moustache
- CJ Worshipper

- Posts: 476
- Joined: August 18th, 2008, 9:30 am
Post
by Moustache » May 29th, 2010, 6:20 pm
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;
}
}
}
-
Drofder2004
- Core Staff

- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Post
by Drofder2004 » May 29th, 2010, 7:40 pm
What are you trying to achieve by doing "1 == true"
0 = False
1 = True
Your if statements are redundant...
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
Moustache
- CJ Worshipper

- Posts: 476
- Joined: August 18th, 2008, 9:30 am
Post
by Moustache » June 1st, 2010, 12:55 pm
I forgot to set self.time = 0 before the loop.
Fail @ me

again...
Thanxs for trying to help me

-
Drofder2004
- Core Staff

- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Post
by Drofder2004 » June 1st, 2010, 7:09 pm
I am still confused by your 1 == "true" statement, but good luck with it...
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Users browsing this forum: No registered users and 0 guests