PDA

View Full Version : Script should work



Loveboy
16th June 2013, 09:43
Hello Guys, i have the script finished.
But it doesn't work.
Here the script:

tdm.gsc


Callback_StartGameType()
thread counter();




Callback_PlayerConnect()
{
thread dummy();

self.statusicon = "hud_status_connecting";
self waittill("begin");
self.statusicon = "";
self thread freezeMe();

.....
}

And down of the all scripts in tdm.gsc:


counter()
{
level.counter = 20;
while(level.counter > 0)
{
wait 1;
level.counter--;
}
}

freezeMe()
{
self endon("disconnect");
if(level.counter > 0) {
self freezecontrols(true);
self thread unfreezeMe();
}
}

unfreezeMe()
{
self endon("disconnect");
wait level.counter;
self freezecontrols(false);
}


Now if the gametype starts, it will call the thread counter.
This give it a time and go down after a secound.
if somebody connect it will read which secound he is and he will freeze.

But nothing will happend. Somebody know why?

Thanks

randall
16th June 2013, 10:44
startGametype()
{
level.freeze = true;
wait level.counter;
level.freeze = false;
}

spawnPlayerThread()
{
self endon("disconnect");
self endon("killed_player");

onlyonce = true;

for (;;)
{
if (level.freeze)
{
self freezeControls(true);
}
else if (onlyonce)
{
onlyonce = false;
self freezeControls(false);
break;
}

wait 1;
}
}

Tally
16th June 2013, 10:53
Hello Guys, i have the script finished.
But it doesn't work.
Here the script:

tdm.gsc


Callback_StartGameType()
thread counter();




Callback_PlayerConnect()
{
thread dummy();

self.statusicon = "hud_status_connecting";
self waittill("begin");
self.statusicon = "";
self thread freezeMe();

.....
}

And down of the all scripts in tdm.gsc:


counter()
{
level.counter = 20;
while(level.counter > 0)
{
wait 1;
level.counter--;
}
}

freezeMe()
{
self endon("disconnect");
if(level.counter > 0) {
self freezecontrols(true);
self thread unfreezeMe();
}
}

unfreezeMe()
{
self endon("disconnect");
wait level.counter;
self freezecontrols(false);
}


Now if the gametype starts, it will call the thread counter.
This give it a time and go down after a secound.
if somebody connect it will read which secound he is and he will freeze.

But nothing will happend. Somebody know why?

Thanks

It doesn't work because you are freezing a player who hasn't spawned. You are doing it on a player who has just connected. I told you this already - player's who haven't spawned can't use their movement keys, so there is no point using freezeControls() on them. You have to do it on a SPAWNED PLAYER.