Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

HARDCODE help please

Page: 1 of 1
 MasterSidious
01-30-2004, 2:50 AM
#1
How do I create a boolean command that returns true if they are an admin( they enter the correct password) or false (they don't enter the correct password)?
The cmd will be in the format of /amlogin <password>

A nice example of this would be good casue I'm kind of a noobie :)

Thanks in advance.
 MasterSidious
01-30-2004, 2:54 AM
#2
Someone please give me of an example of a declared array with the password as the second parameter. The command is always the "0" parameter, so the pass would be "1". The password is stored in the array and when the command is entered by the user it looks for the other parameter "the password".

Thanks :)
 MasterSidious
01-30-2004, 3:30 AM
#3
I'm so newbie, this is what I came up with so far:
void Cmd_amlogin_f (gentity_t *ent) // amlogin cmd
{
char *msg;
qboolean AdminPass( gentity_t *ent ) {
if ( !ad_adminpass.integer ) { // ad_adminpassword is the set password variable
msg = "^3Wrong ^1Password!\n";
am_pass = qfalse; // not an admin
}
else
{
msg = "^1You are now ^3logged in.\n";
am_pass = qtrue; // it was the right password so you're an admin
}



// Tell them they are logged in.
if(am_pass)
trap_SendServerCommand( ent-g_entities, va("print \"%s\"", msg)); // tell them
}
}

How would I even go about making something like this work? Any help would be GREATLY appreciated here guys :D
Page: 1 of 1