What Does This Mean?
#1

What Does this Mean?

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(register, 8, cmdtext);
    dcmd(login, 5, cmdtext);
    dcmd(logout, 6, cmdtext);
    dcmd(password, 8, cmdtext);
    return 0;
I know it means dcmd is telling command register, , and that its a command. What does the number mean?
Reply
#2

The length.
Reply
#3

Quote:
Originally Posted by Backwardsman97
Посмотреть сообщение
The length.
Length Of?
Reply
#4

The command.
Reply
#5

Quote:
Originally Posted by -Luis
Посмотреть сообщение
The command.
Thanks
Reply
#6

It isn't a problem mate.
Reply
#7

Length of the command.

#EDIT

Sorry for double post ... I didn't see his one.
Reply
#8

Okay So Then What does this mean? Sorry new to some of this stuff

dini_IntSet(CommandFile, "Akill", 6);
Reply
#9

-the dini_IntSet writes an integer (a full number w/o a dot f.ex 13337) into a file,
-first parameter "CommandFile" is (contains) the string where the file is located, (watch below)
-second param, "Akill", is a string which gets written into the file as a single line so it can be seeked for and get read,
-third param, 6, also writes it (the 6, which is an Integer) to the same line as the "Akill" directly behind it.
presuming that a filename is given, maybe
Код:
new CommandFile[64];
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
format(CommandFile,sizeof(CommandFile),"UserData/%s.txt",PlayerName);
...now you got a PlayerName and the CommandFile string. the PlayerName gets added into the CommandFile string with format(), now it can be used to open a file: (to store something in the file here)
Код:
dini_IntSet(CommandFile, "Akill", 6); // remember: the CommandName is only a string containing "UserData/HayZatic.txt" if you are the player :)
result:
Код:
Akill 6
inside your file...
Reply
#10

Quote:
Originally Posted by Babul
Посмотреть сообщение
-the dini_IntSet writes an integer (a full number w/o a dot f.ex 13337) into a file,
-first parameter "CommandFile" is (contains) the string where the file is located, (watch below)
-second param, "Akill", is a string which gets written into the file as a single line so it can be seeked for and get read,
-third param, 6, also writes it (the 6, which is an Integer) to the same line as the "Akill" directly behind it.
presuming that a filename is given, maybe
Код:
new CommandFile[64];
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
format(CommandFile,sizeof(CommandFile),"UserData/%s.txt",PlayerName);
...now you got a PlayerName and the CommandFile string. the PlayerName gets added into the CommandFile string with format(), now it can be used to open a file: (to store something in the file here)
Код:
dini_IntSet(CommandFile, "Akill", 6); // remember: the CommandName is only a string containing "UserData/HayZatic.txt" if you are the player :)
result:
Код:
Akill 6
inside your file...
Great thanks And one More thing, gCommands[LOGIN] = dini_Int(CommandFile, "Login"); Im Trying To Beat This Problem i have and i go learn all of this, i can probally fix it
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)