Jump to content

Jail Help


marty000123

Recommended Posts

Hi there

I'm using a jail system, which places the selected person in the jail.

But the problem is, when the player relogs, he spawns in the jail. But the spawn panel is still open for him.

When he spawns by the spawn panel he's out of jail and he can do what he want, even though the jail time is still going.

So I came on the idea to repeat his TP to the jail every 5 sec. Like if he's jailed for 1 minute, every 5 seconds he'll TP to jail, even if he's in. So if he relogs, he'll spawn at the place where he wants to spawn by spawn panel, but because the TP is repeating, he'll get back to jail after that 5 seconds anyway.

But I don't know how to repeat that. Can anybody help me with this?

Greetings,

Marty

Link to comment

You need to set a timer for repeated intervals.

A better approach would be to disable spawning while in jail.

The simplest use is to setElementData(player,'jailed',true)

Then in the map script just post

if getElementData(localPlayer,'jailed') then return end --close map somehow, if its a freeroam resource then closeWindow(wndSpawnMap) 

Also reset element data after jail term is finished.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...