The online racing simulator
#1 - sun
Opening a Bank when a command is said
Hello,

While i was coding my Police system, I came across an unexplainable point. well you might think so. Well here is my point. When my command is said, i want it to delete a barrier, so the police can get into the bank. But /clear only deletes all of the layout and then loads it again with the barrier there. I want it so, it deletes the barrier without taking the whole layout off, then loading it again with the Object missing.

Any ideas ?

Thanks,

Owen
i know of a server that uses an insim command i think to change the layout, maybe oyu could have it so when the command is said it changes the layout, the only problem there is the layout disapears for a second or 2, dont ask me how to do it cos i dont know , all i know is that it has been done
#3 - sun
yes, not going for 1 - 2 secs
No, it's not possible to delete a certain object via code you have to do it manualy, good idea though.
#5 - sun
but how do other servers do it then, when a command it said ?
Off the top of my head, there could be 2 layouts which are identical apart from a single barrier. It's then just a case of a quick /axload.
Yeh shouldn't be too hard
Quote from the_angry_angel :Off the top of my head, there could be 2 layouts which are identical apart from a single barrier. It's then just a case of a quick /axload.

So there's potential for autox layouts in the style of old Super Sprint tracks, with opening and closing gates?
Maybe I might do one!
What, you mean going to my local bank and going "Open Sesame" won't work, and I can't just waltz into the vault.

I'm gonna need to fix that.
Why dont you program it in your insim that you only can do something in the bank when it's opened?
like when you open it: you can rob it or whatever, and when it's closed, it says: closed or whatever...
should be much easier
#12 - sun
Well maybe you try coding it.



ok, is /axload even a command in LFS ? because al what i know is /track fe4 or /track ky1 for example, never heard of /axload.
Never question TAA

All commands can be found in...docs/commands.txt funnily enough
just cos you have only heard of the /track command dont mean thats all there is, i know loads more of them, and /axload is one of them
Create two layouts, indentical all bar the "bank coverer" lol.

Call one TRACK_bankclosed.lyt, and one TRACK_bankopen.lyt

on !bankopen

send the mst - "/axload bankopen"

on !bankclose

send the mst - "/axload bankclose"


- although this would work - I would not suggest it, for the fact that barriers are penatratable with the current system. Which means that someone could ram their way into the bank to steal the money, when there are no officers on duty.

Instead of that, in your MCI function(s) where the bank robbery scripts are, just do a simple IF command, to ensure the bank is open by using the "bankstatus" variable...

Then on !bankopen set a variable "bankstatus" to open, and on !bankclose, set the variable "bankstatus" to closed.
The bank thing.... I gona help you
Thats a example to get the bank on you position what u like. (the same as Lottery)

if ((MCI.Info[p].X / 196608 >= -95) && (MCI.Info[p].Y / 196608 >= 146) && ((MCI.Info[p].X / 196608 <= -92) && (MCI.Info[p].Y / 196608 <= 217)))
{
InSim.Send_BTN_CreateButton("^2You are in the Bank", Flags.ButtonStyles.ISB_DARK, 5, 26, 5, 114, 32, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[p].PLID)].UniqueID)].UniqueID, 2, false);
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[p].PLID)].UniqueID)].Bank = 1;

And here is the command to check if its open or closed

case "!bank":
if (Connections[GetConnIdx(MSO.UCID)].Bank = 1)
{
InSim.Send_MTC_MessageToConnection("^8 Bank is Open");
}
else
{
InSim.Send_MTC_MessageToConnection("^8 Bank is Closed", MSO.UCID, 0);

}
break;

PS: You cant copy and paste it u must change some things on it.
1. Coordinates
2. Button Id / Position
3. The "Bank" thing. u must add it in you Client.cs
Thanks Marco for the bank code will look into it
No Problem
Quote from Heiko1 :Thats a example to get the bank on you position what u like. (the same as Lottery)

if ((MCI.Info[p].X / 196608 >= -95) && (MCI.Info[p].Y / 196608 >= 146) && ((MCI.Info[p].X / 196608 <= -92) && (MCI.Info[p].Y / 196608 <= 217)))
{
InSim.Send_BTN_CreateButton("^2You are in the Bank", Flags.ButtonStyles.ISB_DARK, 5, 26, 5, 114, 32, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[p].PLID)].UniqueID)].UniqueID, 2, false);
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[p].PLID)].UniqueID)].Bank = 1;

And here is the command to check if its open or closed

case "!bank":
if (Connections[GetConnIdx(MSO.UCID)].Bank = 1)
{
InSim.Send_MTC_MessageToConnection("^8 Bank is Open");
}
else
{
InSim.Send_MTC_MessageToConnection("^8 Bank is Closed", MSO.UCID, 0);

}
break;

PS: You cant copy and paste it u must change some things on it.
1. Coordinates
2. Button Id / Position
3. The "Bank" thing. u must add it in you Client.cs

i see you're using my code
Dont True!
Dont talk false things

That is my OWN code who i needet 5mins...

And not u code.... U send me a code a few weeks ago but i must formate my computer = u code is deleted...
right..
The layout switching thing could cause a huge problem unless its a real small layout.

Unless your server can load layouts instantly, anyone driving around will probably see the layout, then it will disapear, then appear again and half of the people on track, who pulled onto the middle, get catapulted into the air and lose their cars.

For a sprint start system it could be okay if it does it instantly, but again there's a delay. If you want a sprint start system then just create the starting boxes side by side, then place a red/white barrier over the end of them manually. Then an admin can just delete the barrier when they go.
if (Connections[GetConnIdx(MSO.UCID)].Bank = 1)

That won't do what you think it will. This, however, will:

if (Connections[GetConnIdx(MSO.UCID)].Bank == 1)

Why is bank added to everyone's connection? It would do to have one variable (bool or byte) called "BankStatus" or something, and assign the bank status to that...

[OT] Why is everyone using the old LFS_External anyway? I converted my apps into the new one in an evening, and it is much quicker...the old version seems to crash a lot with .5 MCI intervals, but the new one doesn't...It also has a much neater layout inside, and it's far easier to find what you want...plus an entire solution can be converted in less than 30 minutes [/OT]
1

FGED GREDG RDFGDR GSFDG