Author Topic: %brick.isPlanted not robust  (Read 1895 times)

In my CRP mod I have this problem. Whenever a player places a brick in the air or on somebody else's brick that they don't have trust with, it still charges them for the brick making their funds decrease but the brick does not place. I have the code check if the brick is planted but %brick.isPlanted isn't enough. How would I check the ghost brick if it was floating or if the ghost brick is on somebody's brick you don't trust?

Also, on a second note: $Server::PlayerCount doesn't update when a player disconnects.

Instead of $Server::PlayerCount, use ClientGroup.getCount()

Doesn't a brick planted without trust first plants, then kills?

Schedule an object check, if it's still there then deduct the whatever

@mold yes

Schedule an object check, if it's still there then deduct the whatever
At the most 50ms schedule, idk if a 0 schedule would work

At the most 50ms schedule, idk if a 0 schedule would work
I've done some previous testing and it should, in theory. He might want to raise it just to cope with unforseen complications such as lag

Doing "0" will schedule it for the next tick, which means after the current tick.

Doing "0" will schedule it for the next tick, which means after the current tick.
I assume this means a 0 schedule will work.

No, it means it does work and it's useful.

>engine takes care of current tick
>takes care of schedules
>new schedule added to schedule queue

>next tick
>takes care of schedules

etc...

isPlanted() gives me the same results.

Doing "0" will schedule it for the next tick, which means after the current tick.

More specifically, it schedules it for the next frame (so a [mspf] millisecond delay).

More specifically, it schedules it for the next frame (so a [mspf] millisecond delay).
Servers don't render any frames.

Servers don't render any frames.

The main loop still counts in “frames“.

The main loop still counts in “frames“.
When it's only a server, it's better referred to as "ticks".

I would suggest deducting the money or whatever from them, and then packaging the function that kills the brick to refund them.