Author Topic: Not sure why this script isn't working.  (Read 656 times)

Code: [Select]
package print
{
function test(%client) {

commandToClient(%client,'centerPrint',"Is the message still up? ",-1);
}

function gameConnection::onClientEnterGame(%client) {

test(%client);
Parent::onClientEnterGame(%client);
}
};
activatePackage(print);

I really don't know how you display the message for -1 seconds

lol it holds it on the screen

lol it holds it on the screen
I'm guessing it schedules it, but -1 seconds ago wouldn't be reached.

I'm guessing it schedules it, but -1 seconds ago wouldn't be reached.

what? It's not scheduling it? Just say that it will disappear in -1 milisecs. Right?

what? It's not scheduling it? Just say that it will disappear in -1 milisecs. Right?
It schedules for something to happen in the past, so that something will never happen.
It won't disappear.

It schedules for something to happen in the past, so that something will never happen.
It won't disappear.

Code: [Select]
package print
{

function loop(%client) {

commandToClient(%client,'centerPrint',"Is the message still up? ",1000);
}

function gameConnection::onClientEnterGame(%client) {

loop(%client);
Parent::onClientEnterGame(%client);
}
};
activatePackage(print);

Still :/ nothing is showing up

try some echo() statements.
and mabye trace ?


also - centerPrint and bottomprint with a -1 means to leave the text up forever.

is oncliententergame called when the player spawns or when the player first joins the server? bottomprint and centerprint do not work until a player is spawned.

is oncliententergame called when the player spawns or when the player first joins the server? bottomprint and centerprint do not work until a player is spawned.
Spawns.

Code: [Select]
function test(%client) {

commandToClient(%client,'centerPrint',"Is the message still up? ", -1);
}

package print {

function gameConnection::onClientEnterGame(%client) {

parent::onClientEnterGame(%client);
test(%client);
}
};
activatePackage(print);

The parent needs to be called first so the player spawns first, and the min/max duration of a centerPrint is from -1 to 999, I believe.

You still need to wait for the player to spawn before you can send centerPrint.

Otherwise, nothing will work right.