Tip:
Highlight text to annotate it
X
Create a new folder inside scriptfiles
Create a function that will read a specified line from the file
"Players/%s.ini" is the path for the player's setting file (%s is the name of the player)
When the desired line is found return its content (string)
fread - reads a line from the current file opened
Of course, before reading a file, you have to open it XD
This function will write a specified string to file
Delete this, you don't need it
If it's the first time when you write to the file then write the string as it is
Else insert a new line before writing the string
If the file exists, it means that the user has already registered
So you'll display a Login Dialog Box
Else display a Register Dialog Box
This is the first dialog box you've created (in the previous tutorial), change its id to 3
If the player hits "Exit" then kick him
If the password entered by the user (inputtext) doesn't match with the pass from file then display a message
And show him the Login Dialog Box again
Put player on spectating mode when he connects
By doing this you won't let the player to join game unless he types the correct password
Write the password to file
Compile and copy tutorial.amx inside gamemodes
Then start the server and connect to it
Thanks for watching! SUBSCRIBE !