If Text input == Text input do somting

Non-platform specific questions.

If Text input == Text input do somting

Postby Rux » Mon Jul 23, 2007 5:56 pm

How do you make a SIMPLE Login screen, in other words, create actor on an ok button,
Code: Select all
UserCheck = 0;
PassCheck = 0;

ok,mousebutton down,
Code: Select all
if(UserCheck == 0, PassCheck == 0)
{
    PlaySound2("data/Denied.wav", 1.000000, 1, 1.000000);
}

and
Code: Select all
if(UserCheck == 1, PassCheck == 1)
{
    PlaySound2("data/Approved.wav", 1.000000, 1, 0.000000);
    MoveTo("view", 320.000000, -239.000000, 1000.000000, "Game Center", "");
}

And on the user name type in, draw actor,
Code: Select all
if(UserName.text == CurrentUser.text)
{
    UserCheck = 1;
}

Pass type in, draw actor
Code: Select all
if(Password.text == CurrentPassword.text)
{
    PassCheck = 1;
}

After all this it still doesn't work, what am I doing wrong?

P.S, is there anyway to prevent taskpanel, meta, alt+tab, and menu,I'm trying to make a secerity program.
I'm not good at coming up with signatures...
User avatar
Rux
 
Posts: 645
Joined: Sun Apr 29, 2007 9:26 pm
Location: Sitting on your moniter invisable.
Score: 35 Give a positive score

Re: If Text input == Text input do somting

Postby metal_pt » Mon Jul 23, 2007 8:00 pm

Try it like this:

Code: Select all
UserCheck = 0;
PassCheck = 0;

ok,mousebutton down,
Code: Select all
if(UserCheck == 0 && PassCheck == 0)
{
    PlaySound2("data/Denied.wav", 1.000000, 1, 1.000000);
}

and
Code: Select all
if(UserCheck == 1 && PassCheck == 1)
{
    PlaySound2("data/Approved.wav", 1.000000, 1, 0.000000);
    MoveTo("view", 320.000000, -239.000000, 1000.000000, "Game Center", "");
}

And on the user name type in, draw actor,
Code: Select all
if(strcmp(UserName.text,CurrentUser.text)==1)
{
    UserCheck = 1;
}

Pass type in, draw actor
Code: Select all
if(strcmp(Password.text,CurrentPassword.text)==1)
{
    PassCheck = 1;
}
]v[eta[_ - Using GE since June, 15 2007
Currently using v1.3.8 Registered
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score

Postby metal_pt » Mon Jul 23, 2007 8:16 pm

hmmmm
Instead of
strcmp(UserName.text,CurrentUser.text)==1
use
strcmp(UserName.text,CurrentUser.text)==0
]v[eta[_ - Using GE since June, 15 2007
Currently using v1.3.8 Registered
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score

Postby Rux » Mon Jul 23, 2007 8:34 pm

It works, but I have another question, How do you make it so when the user or password, is tiped correctly changes their value from 0 to 1, and then the person typing in the username or password, accedently hits another button, so the value changes from 1 to 0? It doesn't do that.
And how to save a string, then load it.
I'm not good at coming up with signatures...
User avatar
Rux
 
Posts: 645
Joined: Sun Apr 29, 2007 9:26 pm
Location: Sitting on your moniter invisable.
Score: 35 Give a positive score

Postby metal_pt » Tue Jul 24, 2007 7:50 am

Instead of checking it in a draw actor event, check it in the mouse button down event.

Hope it helps.
]v[eta[_ - Using GE since June, 15 2007
Currently using v1.3.8 Registered
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score

Postby Sgt. Sparky » Tue Jul 24, 2007 5:20 pm

for writing string:
Code: Select all
FILE*file;
file = fopen("yourfilename", "w+");
fwrite(&yourstring, sizeof(yourstring), 1, file);
fclose(file);

for loading string:
Code: Select all
FILE*file;
file = fopen("yourfilename", "r+");
fread(&yourstring, sizeof(yourstring), 1, file);
fclose(file);

:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Re: If Text input == Text input do somting

Postby Rux » Wed Jul 25, 2007 7:07 pm

Rux wrote:P.S, is there anyway to prevent taskpanel, meta, alt+tab, and menu,I'm trying to make a secerity program.
I'm not good at coming up with signatures...
User avatar
Rux
 
Posts: 645
Joined: Sun Apr 29, 2007 9:26 pm
Location: Sitting on your moniter invisable.
Score: 35 Give a positive score

Postby Sgt. Sparky » Thu Jul 26, 2007 4:22 pm

what kind of a security program?
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Rux » Thu Jul 26, 2007 9:34 pm

A locking secirity program, how do you prevent the buttons, taskpanel, meta, alt+tab, and menu so whoever tries to break through can't get through.
I'm not good at coming up with signatures...
User avatar
Rux
 
Posts: 645
Joined: Sun Apr 29, 2007 9:26 pm
Location: Sitting on your moniter invisable.
Score: 35 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest