Author Topic: How to detect if....  (Read 852 times)

How to detect if the player has spawned?
How to detect if the player has a ghost brick active/planted/something?

This is from my Colonization RP Mod.
Code: [Select]
   
function GameConnection::onClientEnterGame(%this)
{
schedule(3000, 0, Setstats, %this);
%parent = parent::onClientEnterGame(%this);
}

This is from my Colonization RP Mod.
Code: [Select]
   
function GameConnection::onClientEnterGame(%this)
{
schedule(3000, 0, Setstats, %this);
%parent = parent::onClientEnterGame(%this);
}

Thanks.

if(isObject(%player.tempBrick))

if(isObject(%player.tempBrick))
ASDFGHJKL
%client.tempBrick

Code: [Select]
   
function GameConnection::onClientEnterGame(%this)
{
schedule(3000, 0, Setstats, %this);
%parent = parent::onClientEnterGame(%this);
}

So.... what exactly does that do/mean? I'm new to this, please be patient.

I know this event is kinda useless, but I just want to try it.

Why doesn't this work?

Code: [Select]
function GameConnection::PlantBrick(%client)
{

if(isObject(%client.tempBrick))
{

commandToServer('plantBrick');
}
else
{
messageClient(%client,'',"\c0Error\c6: You do not have a ghost brick on the map.");
}
}

ASDFGHJKL
%client.tempBrick
Code: [Select]
==> echo(isObject(findclientbyname(Weiss).tempbrick));
0
==> echo(isObject(findclientbyname(Weiss).player.tempbrick));
1
Funny how you're wrong

Code: [Select]
==> echo(isObject(findclientbyname(Weiss).tempbrick));
0
==> echo(isObject(findclientbyname(Weiss).player.tempbrick));
1
Funny how you're wrong
Oh wow, I copied managed to read from here wrong:
http://blockland.kalphiter.com/add-ons/files/Script_BrickExtras/server.cs

you look at the chat, %1 spawned.