Forum

> > CS2D > Scripts > how do the commands and the ranks folder separate?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch how do the commands and the ranks folder separate?

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt how do the commands and the ranks folder separate?

phalenkO
User Off Offline

Zitieren
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
1× editiert, zuletzt 16.06.18 18:46:38

alt Re: how do the commands and the ranks folder separate?

Rainoth
Moderator Off Offline

Zitieren
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)
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht