Page 1 of 1

Script possibly causing server conflict

Posted: Wed Jan 10, 2007 12:29 am
by ernst
hi, i found an all weapons script from mods-r-us and the script works great, however for an odd reason my server decides to do a restart when it reaches over half full... at first i went to my server provider, reinstalled the server with no mods, and the problem went away, when i put the script back in, the problem happens again

now, this server in question is a stock server.

only maps dm123467 are playing, no mods in them at all

originally, i had put the weapons script after level waittillspawn

it worked great,

i have now tried execing the script seperately,

what i mean is i made a pk3 with all 6 maps in it, mainly for the scoreboard msg change. in each map i added

exec global/allweapons.scr

and in the pk3 file added the global folder with the script

once again it works great but is still restarting the server

so the question is there something wrong with this script?
or is it a server related problem??

here is the script in ?

Code: Select all

main:

while(your_learning)
{
for(local.i=1;local.i<=$player.size;local.i++)
{
if($player[local.i].done == NIL)
{
if($player[local.i].dmteam == axis)
{
$player[local.i] give models/weapons/kar98.tik
$player[local.i] give models/weapons/kar98sniper.tik
$player[local.i] give models/weapons/mp40.tik
$player[local.i] give models/weapons/mp44.tik
$player[local.i] give models/weapons/shotgun.tik
$player[local.i] give models/weapons/panzerschreck.tik
$player[local.i] thread do_death
}
else if($player[local.i].dmteam == allies)
{
$player[local.i] give models/weapons/springfield.tik
$player[local.i] give models/weapons/bar.tik
$player[local.i] give models/weapons/thompsonsmg.tik
$player[local.i] give models/weapons/m1_garand.tik
$player[local.i] give models/weapons/shotgun.tik
$player[local.i] give models/weapons/bazooka.tik
$player[local.i] thread do_death
}
}
}
wait 1
}
end
do_death:

local.ok = 1
while(local.ok)
{
if(self == NULL)
local.ok = 0
else
{
if!(isalive self || self.dmteam == spectator)
{
self.done = NIL
local.ok = 0
}
}
wait 1
}

end
any help would be greatly appreciated

Posted: Wed Jan 10, 2007 2:47 am
by bdbodger

Code: Select all

while(your_learning)
what is that ? That can't work since it is not a 0 or 1 or a level or local variable or expression that evaluates to 0 or 1 .
originally, i had put the weapons script after level waittillspawn
I think only after level waittill spawn is $player valid but none of these things would be a cause for your problems as far as I know .

Posted: Wed Jan 10, 2007 3:21 am
by ernst
as for this

Code: Select all

while(your_learning)
i have no clue, this isnt my script i found it on mods-r-us

i mean the script works, wether hard coded in the map script or exec from a global folder...

so, if its not proper why is it working?? lol im not sure...too advanced for me.

i also couldnt figure out why this was causing a server restart when it reached half full, makes no sense to me but my server provider seems to think it is...but of course they would never admit a fault on their part.

limits

Posted: Wed Jan 10, 2007 5:09 am
by tltrude
There's probably some limit to the number of weapons in a multiplayer game. Have you tried taking out a few of the weapons to see if the problem changes?

Posted: Wed Jan 10, 2007 8:01 am
by bdbodger
Start by changing while(your_learning) to while(1)

Posted: Thu Jan 11, 2007 7:34 pm
by ernst
ok ty, both will try both suggestions will post back to update

thanks again

Posted: Fri Jan 12, 2007 2:53 pm
by ernst
Thank you both!!!

both suggestions solved my problem....

not sure what changing to while(1) did but it seemed to have a great impact...

as well, i think i figured out why the server was restarting when it reached half full....

i stopped and remembered what weapons were in use by most players during the server restart times and i realized that most players were firing the rockets...so i took them out and the lag issues disipated...


thank you both again

Posted: Mon Jan 15, 2007 8:46 pm
by Green Beret
1 makes it loop forever :wink: