English how do the commands and the ranks folder separate?

2 replies
Goto Page
To the start Previous 1 Next To the start
Up
phalenkO
User
Offline Off
Hello, in some cases, start with "Admin = {142925}", I want to import the administrator from another folder. For example, I want to set up a folder called "ranks.lua" and access "admin, mod, and vip" files. How can I do that? I apologize for the title
edited 1×, last 16.06.18 06:46:38 pm
16.06.18 08:07:54 pm
Up
KingShadow
User
Offline Off
use 2 say function to make ranks and commands separated but i recommend you to use 1 say function if you wanna commands script i can make you one
17.06.18 03:40:26 am
Up
Rainoth
Moderator
Offline Off
You'll have to use "join" and "leave" (doesn't necessarily have to be these two but most people go for these two) hooks and in their functions use the io library to save and load the information of users in files.
So to put it simply (this is a pseudocode)
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
add hook join with function A
function A(id)
  io open a file called lets say "user"..player(id,"usgn") (or can be steam id if you prefer it over usgn id)
  read the contents
  use the contents how you wish
end

add hook leave with function B
function B(id)
  io open a file "user"..player(id,"usgn") (or again, steam)
  write the contents you have in your variables
  save
end


Refer to http://lua-users.org/wiki/IoLibraryTutorial for this.
To the start Previous 1 Next To the start