View Full Version : admin login
Fire_optikz001
4th September 2009, 23:55
ok i was trying this
CASE "!auth":
IF( . $argv . == 134562 )
THEN
privMsg( "^2Thank you for logging in");
MoveUserToGroup( "admin",$userName );
ELSE
privMsg( "^1Login Denied");
ENDIF
but it dont seem to work :(
sinanju
5th September 2009, 00:36
The obvious things, which I would assume you've already thought of are;
you've got a BREAK; at the end of your code there?
and it's in between SWITCH / ENDSWITCH
However, should it be username, rather than $username?
Fire_optikz001
5th September 2009, 02:09
well here then
Event OnMSO( $text )
SWITCH( $command )
$userName = GetCurrentPlayerVar("UserName");
CASE "!auth":
IF( . $argv . == 134562 )
THEN
privMsg( "^2Thank you for logging in");
MoveUserToGroup( "admin",$userName );
ELSE
privMsg( "^1Login Denied");
ENDIF
BREAK;
ENDSWITCH
EndEvent
Fire_optikz001
9th September 2009, 05:20
help?
Tim NL
9th September 2009, 14:06
Hi,
!auth is already used in lapper.
CASE "!auth":
privMsg( langEngine( "%{main_level}%", GetCurrentPlayerVar("AuthLevel") ) );
BREAK;
And the group "admin" is filled from a file and you can't add usernames to a file ( i think) :scratchch.
So i used !login and !logout and the group "tempadmin" for example.:D
CASE "!login":
IF( UserInGroup( "tempadmin",$userName ) == 1 )
THEN
privMsg( "^2You are already logged in");
BREAK;
ENDIF
IF( $argv == 1234 )
THEN
privMsg( "^2Thank you for logging in");
MoveUserToGroup( "tempadmin",$userName );
ELSE
privMsg( "^1Login Denied");
ENDIF
BREAK;
CASE "!logout":
IF( UserInGroup( "tempadmin",$userName ) == 1 )
THEN
RemoveUserFromGroup( "tempadmin",$userName );
privMsg( "^2You are logged out now.");
ELSE
privMsg( "^2You where not logged in.");
ENDIF
BREAK;
Ps: If lapper reset the group "tempadmin" is empty.
Fire_optikz001
9th September 2009, 19:21
Tim NL u made a bug :S
lol cause u made bugs :D
yes its still dont work :D same problem i had with !auth
Tim NL
9th September 2009, 20:08
Tim NL u made a bug :S
lol cause u made bugs :D
yes its still dont work :D same problem i had with !auth
My script works here fine. ( its still active on [NLR]NL Racing GTR , you can try it there with !login 1234 and !logout )
But you cant use UserGroupFromFile() in combi with MoveUserToGroup()
( it are two different things).
Fire_optikz001
9th September 2009, 22:37
My script works here fine. ( its still active on [NLR]NL Racing GTR , you can try it there with !login 1234 and !logout )
But you cant use UserGroupFromFile() in combi with MoveUserToGroup()
( it are two different things).
SO Wait would u still use if useringroup?
Tim NL
9th September 2009, 23:44
SO Wait would u still use if useringroup?
Hi,
You can use IF( UserInGroup( "admin",$userName ) == 1 || UserInGroup( "tempadmin",$userName ) == 1) to use 2 admin groups (admin and tempadmin)
CASE "!login":
IF( UserInGroup( "admin",$userName ) == 1 || UserInGroup( "tempadmin",$userName ) == 1)
THEN
privMsg( "^2You are already logged in");
BREAK;
ENDIF
IF( $argv == 1234 )
THEN
privMsg( "^2Thank you for logging in");
MoveUserToGroup( "tempadmin",$userName );
ELSE
privMsg( "^1Login Denied");
ENDIF
BREAK;
CASE "!logout":
IF( UserInGroup( "admin",$userName ) == 1 || UserInGroup( "tempadmin",$userName ) == 1)
THEN
RemoveUserFromGroup( "tempadmin",$userName );
privMsg( "^2You are logged out now.");
ELSE
privMsg( "^2You where not logged in.");
ENDIF
BREAK;
CASE "!rst":
IF( UserInGroup( "admin",$userName ) == 1 || UserInGroup( "tempadmin",$userName ) == 1) THEN
cmdLFS( "/restart " );
ENDIF
BREAK;
Fire_optikz001
9th September 2009, 23:49
CASE "!login":
IF( UserInGroup( "admin",$userName ) == 1 )
THEN
IF( UserInGroup( "tempadmin",$userName ) == 1 )
THEN
privMsg( "^2You are already logged in");
ELSE
IF( $argv== "1234" || $argv == "1234567890" )
THEN
privMsg( "^2Thank you for logging in");
MoveUserToGroup( "tempadmin",$userName );
ELSE
privMsg( "^1Incorrect Password");
ENDIF
ENDIF
ELSE
IF( UserInGroup( "beta",$userName ) == 1)
THEN
IF( UserInGroup( "tempadmin",$userName ) == 1 )
THEN
privMsg( "^2You are already logged in");
ELSE
IF( $argv== "1234567890" )
THEN
privMsg( "^2Thank you for logging in");
MoveUserToGroup( "tempadmin",$userName );
ELSE
privMsg( "^1Incorrect Password");
ENDIF
ENDIF
ENDIF
BREAK;
CASE "!logout":
IF( UserInGroup( "tempadmin",$userName ) == 1 )
THEN
RemoveUserFromGroup( "tempadmin",$userName );
privMsg( "^2You are logged out now.");
ELSE
privMsg( "^2You where not logged in.");
ENDIF
BREAK;
CASE "!ban":
IF( UserInGroup( "tempadmin",$userName ) == 1 )
THEN
IF( UserInGroup( "admin",$argv ) == 1 )
THEN
cmdLFS("/msg " . GetCurrentPlayerVar( "Nickname" ) . " Attempted to ban " . GetPlayerVar( $argv, "Nickname" ) );
cmdLFS( "/msg " . GetPlayerVar( $argv, "Nickname" ) . "^7 Is An Admin ban Voided" );
ELSE
IF( UserInGroup( "beta",$argv ) == 1 )
THEN
cmdLFS("/msg " . GetCurrentPlayerVar( "Nickname" ) . " Attempted to ban " . GetPlayerVar( $argv, "Nickname" ) );
cmdLFS( "/msg " . GetPlayerVar( $argv, "Nickname" ) . "^7 Is A beta Tester ban Voided" );
ELSE
cmdLFS("/msg " . GetCurrentPlayerVar( "Nickname" ) . " banned " . GetPlayerVar( $argv, "Nickname" ) );
cmdLFS( "/ban " . $argv . " 7" );
ENDIF
ENDIF
ENDIF
BREAK;
Bass-Driver
10th September 2009, 17:27
i made a code for add more admins
UserGroupFromFile( "UserAdmin", "./UserAdmin.txt" );
CASE "!readmin":#REMOVE ADMIN
IF( UserInGroup( "UserAdmin",$userName ) == 1 )
THEN
IF( UserInGroup( "UserAdmin",$argv ) == 1 )
THEN
RemoveUserFromGroup( "UserAdmin",$argv );
privMsg( "^7Removed User succesfully!!");
ELSE
privMsg( "^1User not found in UserAdmin file");
ENDIF
ENDIF
BREAK;
CASE "!addadmin":#ADD ADMIN
IF( UserInGroup( "UserAdmin",$userName ) == 1 )
THEN
IF( UserInGroup( "UserAdmin",$argv ) == 1 )
THEN
privMsg( "^7User is already admin!!!");
ELSE
MoveUserToGroup( "UserAdmin",$argv );
privMsg( "^7Added New Admin succesfully!!");
ENDIF
ENDIF
BREAK;
Krayy
11th September 2009, 10:42
I'll throw my 2cents in the hat with this: http://www.lfsforum.net/showthread.php?p=1259430#post1259430
That should sort everyone out.
(Here's hoping Gai-Luron puts it in the next release)
Bass-Driver
11th September 2009, 21:47
i have also made a command to give someone a driveban
CASE "!driveban": #ADD DRIVEBAN
IF( UserInGroup( "UserAdmin",$userName ) == 1 )
THEN
IF( UserInGroup( "UserAdmin",$argv ) == 1 )
THEN
cmdLFS("/msg " . GetPlayerVar( $argv, "Nickname" ) . "^7 Cant be Kicked!!!" );
cmdLFS("/msg " . GetPlayerVar( $argv, "Nickname" ) . "^7 is an Admin/SuperUser" );
BREAK;
ENDIF
IF( UserInGroup( "UserDriveBan",$argv ) == 1 )
THEN
privMsg("^1 Already banned from driving!!" );
ELSE
MoveUserToGroup( "UserDriveBan",$argv );
privMsg("^7>Banned From Driving" );
cmdLfs( "/spec " . $argv . );
ENDIF
ENDIF
BREAK;
CASE "!redriveban": #REMOVE DRIVEBAN
IF( UserInGroup( "UserAdmin",$userName ) == 1 )
THEN
IF( UserInGroup( "UserDriveBan", $argv ) == 1 )
THEN
RemoveUserFromGroup( "UserDriveBan",$argv );
privMsg("^7>DriveBan Removed Succesfull!!" );
ELSE
privMsg("^1 User not found in UserDriveBan file!! " );
ENDIF
ENDIF
BREAK;
only it resets after restarting lapper.
i want also use this code: http://www.lfsforum.net/showthread.p...30#post1259430 (http://www.lfsforum.net/showthread.php?p=1259430#post1259430)
to save the users in the file, but this code a lil bug
LFSCruise
22nd June 2011, 19:49
Thanks. I would like to that to and more these topics.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.