Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Access Code for switches

Author
Message
andy lamppost
17
Years of Service
User Offline
Joined: 31st Dec 2006
Location: England
Posted: 31st Dec 2006 16:28
i was on www.fpsfree.com and found a lovely bit of code for using an access code for switches. only problem is, it doesnt want to open doors. they make the noise then close again, which is really annoying, then the switch doesnt work any more. if anyone could help i'd really like it. here's the code i have so far



like my mother always said. if at first you dont succeed, try a bigger thermonuclear reaction
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 31st Dec 2006 18:15 Edited at: 31st Dec 2006 18:17
Quote: ":state=14,plrdistwithin=50,scancodekeypressed=28:state=15,sound=audiobankswitchedpress.wav"


28 is the keycode for [ENTER] which is the key that closes the door once you have opened it using the code. The script is doing exactly what you have told it to do.

For some reason you have altered my original script and added the :state=14 line to make the door close again. Remove your code and the script will work.

NOTE: Always read the instructions included in the code and Welcome to the Forums.

Best.

I'm sorry, my answers are limited. You must ask the right question.

andy lamppost
17
Years of Service
User Offline
Joined: 31st Dec 2006
Location: England
Posted: 31st Dec 2006 18:19
yeh, that was because i wanted the person to have to press enter to confirm the code, didnt realise it would affect it in that way. do you know if there's any way so that if they enter the wrong number they have to start again?

like my mother always said. if at first you dont succeed, try a bigger thermonuclear reaction
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 2nd Jan 2007 15:54
the only way I could think of to make that happen is to script all possible entries the player could make. This could be rather time consuming but the idea is simple.

if the correct access code was 1 4 6 9

then you would check each entry.

entry #1:
user enters 0 or 2-9 goto state w
user enters 1 goto state r

"state r" being the correct entry for the first entry
"state w" being the wrong entry for the first entry

so the script would look something like this:


Now there may be other ways of doing this, but this is the way I found to do it. Haven't take the time to completely script this yet. But theoretically this should work

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Thraxas
Retired Moderator
18
Years of Service
User Offline
Joined: 8th Feb 2006
Location: The Avenging Axe, Turai
Posted: 5th Jan 2007 03:11
Quote: "do you know if there's any way so that if they enter the wrong number they have to start again?"


a quick use of the search function and you would have found this!


Login to post a reply

Server time is: 2024-11-23 09:16:44
Your offset time is: 2024-11-23 09:16:44