"Creating A Simple Administration FilterScript" - sampwiki
#1

Hello.
I've just received interest on scripting, searched for tutorials, guides, sampwiki and so on. I did understand things except for some.
I tried connecting on the IRC - but failed, and had several problems.
I've been reading the page named "Creating A Simple Administration FilterScript", reaching "Registration".
From the beginning of the page, after "solving" the first compile problems, I kept on receiving a warning that wouldn't go off.

admin.pwn(120) : warning 203: symbol is never used: "ret_memcpy".

Also, at the Register part, I couldn't understand several things:
Quote:

* We create a new variable (integer) called 'password' and assign it to the 'num_hash()' function we can find in our dutils.inc file.
* We set the 'PLAYER_PASS' cell of our 'gPlayerInfo[playerid]' array to 'password'. The 'num_hash()' function simply converts the given string (in this case, our password), to a numerival value, with which we then place in to our array cell.
* We set the 'PLAYER_REGGED' cell of our 'gPlayerInfo[playerid]' array to 1. This is so that if he types '/register [password]' again, he will trigger this line:

The link dutils.inc doesn't work, but I can see that it's a download link.

Quote:

assign it to the 'num_hash()' function we can find in our dutils.inc file.

How can we find it there?
And what exactly is num_hash?

Thanks for your help.
Reply
#2

hash = Hash Encrypter
num= Number

Number_Hash ...
Reply
#3

Quote:
Originally Posted by Jugger
admin.pwn(120) : warning 203: symbol is never used: "ret_memcpy".
put #pragma unused ret_memcpy
By the #define's
Reply
#4

Thanks GforceNL, that helped.
Still waiting for a reply about this,
Quote:

* We create a new variable (integer) called 'password' and assign it to the 'num_hash()' function we can find in our dutils.inc file.
* We set the 'PLAYER_PASS' cell of our 'gPlayerInfo[playerid]' array to 'password'. The 'num_hash()' function simply converts the given string (in this case, our password), to a numerival value, with which we then place in to our array cell.
* We set the 'PLAYER_REGGED' cell of our 'gPlayerInfo[playerid]' array to 1. This is so that if he types '/register [password]' again, he will trigger this line:

Reply
#5

You need the dutils.inc include for that (can be found at the website from dracoblue) and then:
Quote:

We create a new variable (integer) called 'password' and assign it to the 'num_hash()' function we can find in our dutils.inc file.

pawn Код:
new password = num_hash(string); // or whatever the name of that line was that you got from getting the password
Quote:

We set the 'PLAYER_PASS' cell of our 'gPlayerInfo[playerid]' array to 'password'. The 'num_hash()' function simply converts the given string (in this case, our password), to a numerival value, with which we then place in to our array cell.

pawn Код:
gPlayerInfo[playerid][PLAYER_PASS] = password;
Quote:

We set the 'PLAYER_REGGED' cell of our 'gPlayerInfo[playerid]' array to 1. This is so that if he types '/register [password]' again, he will trigger this line:

pawn Код:
gPlayerInfo[playerid][PLAYER_REGGED] = 1;
_________________________________________________S omething like that is what it has to be. I have not read the tutorial so this is, in some kind of global lines, what it has to be. You can match the stuff from the tutorial with this.
Reply
#6

Thanks!

And to explain what I meaned in
Quote:

assign it to the 'num_hash()' function we can find in our dutils.inc file.

How can we find it there?

It says we can find the function inside the dutils.
All that meant is how can we find it inside the file.

I'll try that out.

Note: If you want to read that tutorial, I made a link, in the exact part of the page.
Reply
#7

Quote:
Originally Posted by Jugger
Thanks!

And to explain what I meaned in
Quote:

assign it to the 'num_hash()' function we can find in our dutils.inc file.

How can we find it there?

It says we can find the function inside the dutils.
All that meant is how can we find it inside the file.

I'll try that out.

Note: If you want to read that tutorial, I made a link, in the exact part of the page.
well, it may be funny to look at the function inside the include (open the include with any editor.. and you can view the source) but you can just call the function from your script : >
Reply
#8

Any editor such as? And how do I call it from my script? :3
Reply
#9

any editor is like 'wordpad', 'notepad' or even pawno (though this is only if you want to look at the include)

You call the function in your script like this:

At the top:
pawn Код:
#include <dutils> // the name of the file without the extention
Wherever you want to call your function (like the num_hash) :
pawn Код:
function(/*Maybe some stuff required at some functions*/);
Reply
#10

A strange thing happened, is after I posted those 3 lines in the script, the next.. 6(?) lines appeared, exactly as it says on the tutorial. Thanks for everything!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)