SA-MP Forums Archive
What Does This Mean? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What Does This Mean? (/showthread.php?tid=267024)



What Does This Mean? - HayZatic - 06.07.2011

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?


Re: What Does This Mean? - Backwardsman97 - 06.07.2011

The length.


Re: What Does This Mean? - HayZatic - 06.07.2011

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


Re: What Does This Mean? - Luis- - 06.07.2011

The command.


Re: What Does This Mean? - HayZatic - 06.07.2011

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


Re: What Does This Mean? - Luis- - 06.07.2011

It isn't a problem mate.


Re: What Does This Mean? - Shadoww5 - 06.07.2011

Length of the command.

#EDIT

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


Re: What Does This Mean? - HayZatic - 06.07.2011

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

dini_IntSet(CommandFile, "Akill", 6);


Re: What Does This Mean? - Babul - 06.07.2011

-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...


Re: What Does This Mean? - HayZatic - 07.07.2011

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