Password door problems [split from old topic]

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Password door problems [split from old topic]

Postby Jb_007 » Wed Oct 18, 2017 10:57 am

i am creating a password door but only one input 1 character at a time
create a room, create 3 switches and execute code with 1 switch eg switch 1 script 1 etc
#include "zcommon.acs"
str alpha[26]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
str store;
str getinput;
str chk="c";
int count=-1;
function void showalpha(void)
{
count++;
getinput=alpha[count];
print(s:getinput);
}
function void stor(void)
{
store=getinput;
print(s:store);
}
function void ck(void)
{
if (chk==store) {
print(s:"Welcome!!");
}else{
print(s:"invalid password!!");
}
}
script 1 (void) {
showalpha();
}
script 2 (void)
{
stor();
}
script 3 (void)
{
ck();
}
Jb_007
 
Joined: 18 Oct 2017

Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests