how do you make a passworded game

Talk about making games.

how do you make a passworded game

Postby Kooldudese » Thu Feb 01, 2007 10:51 pm

how do you make a game with a username and password thing, where when you type a conbination of username and password it would work when you press login but if its not a real combination of the two than it would not work?
User avatar
Kooldudese
 
Posts: 128
Joined: Sat Jan 27, 2007 5:20 pm
Location: In a house
Score: 0 Give a positive score

Postby Troodon » Fri Feb 02, 2007 2:52 pm

I don't know how to do this, but you should save a variable to the username and password and then check if it's correct when clicking login. I'm not however good with text variables.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Sat Feb 03, 2007 4:01 pm

make a text actor and allow input, add for the draw actor event of a read actor this script:
Code: Select all
strcpy(text , Reader.text);

or somhing like that and for the draw actor event have
Code: Select all
strcpy(text , Password);
if(password == a953)Level = 2;
that should work but if it does not just change it aroung a bit till you like it :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

Postby Sgt. Sparky » Sat Feb 03, 2007 5:31 pm

I will make a Demo :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

Postby Troodon » Sat Feb 03, 2007 7:34 pm

I think I got the idea, but thanks. :D
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Sat Feb 03, 2007 8:06 pm

okay, But I am making the login thingie for everyone to use as a base for a multiplayer Game :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

Postby Sgt. Sparky » Sun Feb 04, 2007 3:03 am

well here is the code if you want it:
Code: Select all
if (strcmp(LoginName.text, Name) == 0 && strcmp(LoginPass.text, Pass) == 0)
{
 SendActivationEvent("Work");
 Accepted = 1;
}
if (strcmp(LoginName.text, Name) > 0 , strcmp(LoginPass.text, Pass) > 0)
{
 strcpy(Work.text, "Denied,\nwrong username or password");
 Accepted = 0;
}
if (Accepted == 0)PlaySound2("data/buuuuh!.wav", 0.622222, 1, 0.000000);
if (Accepted == 1)PlaySound2("data/explode2.wav", 1.000000, 1, 0.000000);
Work.transp = 0;
allthough you do need to make a var called accepted :D
and here is code for the actors that set the vars(name and password)
Code: Select all
if (Set == 1)
{
 strcpy(Name, text);
 saveVars("Name", "MyNameAndPassword");
 strcpy(Pass, text);
 saveVars("Pass", "MyNameAndPassword");
}
Last edited by Sgt. Sparky on Sun Feb 04, 2007 2:50 pm, edited 1 time in total.
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 makslane » Sun Feb 04, 2007 1:32 pm

If Name is a string, remove the & :

Code: Select all
strcpy(Name, text);
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Sgt. Sparky » Sun Feb 04, 2007 2:50 pm

okay! :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


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest