lfnetwork.com mark read register faq members calendar

Thread: HARDCODE help please
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 01-30-2004, 02:50 AM   #1
MasterSidious
Junior Member
 
MasterSidious's Avatar
 
Join Date: Oct 2003
Location: in game getting flamed and banned
Posts: 412
HARDCODE help please

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.


FP>Sephious
67.15.20.187:29070 - FFA SO
67.15.21.115:29070 - CTF SO
67.15.18.232:29070 - Siege/FFA
Laming is tolerated
MasterSidious is offline   you may: quote & reply,
Old 01-30-2004, 02:54 AM   #2
MasterSidious
Junior Member
 
MasterSidious's Avatar
 
Join Date: Oct 2003
Location: in game getting flamed and banned
Posts: 412
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


FP>Sephious
67.15.20.187:29070 - FFA SO
67.15.21.115:29070 - CTF SO
67.15.18.232:29070 - Siege/FFA
Laming is tolerated
MasterSidious is offline   you may: quote & reply,
Old 01-30-2004, 03:30 AM   #3
MasterSidious
Junior Member
 
MasterSidious's Avatar
 
Join Date: Oct 2003
Location: in game getting flamed and banned
Posts: 412
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


FP>Sephious
67.15.20.187:29070 - FFA SO
67.15.21.115:29070 - CTF SO
67.15.18.232:29070 - Siege/FFA
Laming is tolerated
MasterSidious is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > HARDCODE help please

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:30 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.