https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=CoolDark&feedformat=atomMulti Theft Auto: Wiki - User contributions [en]2024-03-28T13:16:14ZUser contributionsMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=GetPedMoveState&diff=75315GetPedMoveState2022-07-23T13:14:43Z<p>CoolDark: </p>
<hr />
<div>{{Client function}}<br />
__NOTOC__<br />
This function returns the current move state for the specified [[ped]].<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
string getPedMoveState ( ped thePed )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''thePed:''' The [[ped]] whose move state you want to know<br />
<br />
===Returns===<br />
Returns a [[string]] indicating the ped's move state, or ''false'' if the ped is not streamed in, the movement type is unknown, the ped is in a vehicle or the ped is invalid.<br />
<br />
{{Ped move states}}<br />
<br />
==Example==<br />
<section show="true"><br />
'''Example 1:''' This example shows how you can output a players current movestate.<br />
<syntaxhighlight lang="lua"><br />
function getMoveState( command, playerName )<br />
-- If the player name exists we will have our 'player'<br />
local player = getPlayerFromName( playerName )<br />
-- If the player does not exist, the script will stop.<br />
if not player then <br />
outputChatBox( "No player named " .. playerName .. " was found.", 250, 0, 0, true )<br />
return false<br />
end<br />
-- If we found the player from the name, we can get his movestate.<br />
local moveState = getPedMoveState( player )<br />
-- If a player and a movestate is found, the script will output it to the chatbox.<br />
outputChatBox( playerName .. "'s current moveState is: " .. moveState, 0, 150, 0, true )<br />
end<br />
addCommandHandler( "getMoveState", getMoveState ) -- To execute this command, simply write: /getMoveState playerName<br />
</syntaxhighlight></section><br />
<br />
==See Also==<br />
{{Ped functions}}<br />
<br />
[[hu:getPedMoveState]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=Lua_compilation_API&diff=71074Lua compilation API2021-05-16T14:02:16Z<p>CoolDark: Created</p>
<hr />
<div>This page is a guide for Lua compilation API<br />
<br />
==Syntax== <br />
<syntaxhighlight><br />
POST "http://luac.mtasa.com/index.php"<br />
</syntaxhighlight><br />
<br />
==Parameters==<br />
*'''luasource:''' type '''file''' the file content<br />
*'''compile:''' type '''value''' set to 1 to enable compilation<br />
*'''debug:''' type '''value''' set to 1 to enable debug information<br />
*'''luasource:''' type '''value'''<br />
**Set to 1 to enable some obfuscation<br />
**Set to 2 to enable more obfuscation (From 1.5.2-9.07903)<br />
**Set to 3 to enable even more obfuscation (From 1.5.6-9.18728)<br />
<br />
==Examples==<br />
===Linux example using curl===<br />
<syntaxhighlight lang="bash"><br />
FROM="example.lua"<br />
TO="compiled.lua"<br />
curl -s -X POST -F compile=1 -F debug=0 -F obfuscate=3 -F luasource=@$FROM http://luac.mtasa.com/ > $TO<br />
</syntaxhighlight><br />
===Linux example using luac replacement===<br />
<syntaxhighlight lang="bash"><br />
luac_mta -e3 -o compiled.lua example.lua<br />
if [ $? -ne 0 ]; then<br />
echo "Error"<br />
fi<br />
</syntaxhighlight><br />
Need luac_mta (R13 2019-07-12) for [//luac.mtasa.com/files/linux/x86/luac_mta Linux 32 bit] or [//luac.mtasa.com/files/linux/x64/luac_mta Linux 64 bit]<br />
<br />
===Windows batch file example using curl===<br />
<syntaxhighlight lang="batch"><br />
set FROM="example.lua"<br />
set TO="compiled.lua"<br />
curl.exe -s -X POST -F compile=1 -F debug=0 -F obfuscate=3 -F luasource=@%FROM% http://luac.mtasa.com/ > %TO%<br />
</syntaxhighlight><br />
Get [//luac.mtasa.com/files/windows/x86/curl.exe curl.exe]</br><br />
(Original from http://curl.haxx.se/download.html)<br />
<br />
===Windows example using luac.exe replacement===<br />
<syntaxhighlight lang="batch"><br />
luac_mta.exe -e3 -o compiled.lua example.lua<br />
IF NOT ERRORLEVEL 1 goto lp1<br />
echo "Error"<br />
:lp1<br />
</syntaxhighlight><br />
Get [//luac.mtasa.com/files/windows/x86/luac_mta.exe luac_mta.exe] (R12 2019-07-12) '''only x86'''<br />
===Lua example===<br />
<syntaxhighlight lang="lua"><br />
--TODO<br />
</syntaxhighlight><br />
<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|2014-08-10|''encrypt'' has been renamed ''obfuscate''.<br>''blockdecompile'' has been removed.}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/Modules/MTA-MySQL&diff=46877RU/Modules/MTA-MySQL2016-03-19T19:21:35Z<p>CoolDark: </p>
<hr />
<div><pageclass class="#AA7592" subcaption="MTA-MySQL Module"></pageclass><br />
{{Warning|Этот модуль слишком стар, используй [[dbConnect]].}}<br />
{{Module_Info|<br />
name = MTA MySQL |<br />
version = 0.5 |<br />
author = [[User:ryden|Alberto Alonso (ryden)]] |<br />
module_website = [http://code.google.com/p/multitheftauto-modules здесь] |<br />
download_link = [http://code.google.com/p/multitheftauto-modules/downloads/list здесь] |<br />
license = [http://www.opensource.org/licenses/bsd-license.php BSD] |<br />
written_in = C++ |<br />
operating_system = Кроссплатформенный |<br />
compatible_with = DP2.x & 1.X |<br />
}}<br />
MTA MySQL - альтернатива стандартному модулю [[RU/Modules/MySQL|ml_mysql]], предоставляемому командой MTA.<br />
Он доступен и для Windows, и для GNU/Linux, к тому же, исходный код открыт.<br />
<br />
''Заметка: Начиная с версии 0.4, введена поддержка серверов обеих версий DP2.3 и 1.0.''<br />
<br />
==Установка==<br />
===Windows===<br />
Разархивируйте файл mta_mysql.dll в папку ''C:\Program files\MTA San Andreas 1.3\server\mods\deathmatch\modules\'' вашего сервера, а файл libmysql.dll - в папку ''C:\Program files\MTA San Andreas 1.3\server\''.<br />
<br />
Затем, добавьте в mtaserver.conf следующую строку:<br />
<syntaxhighlight lang="xml"><br />
<module src="mta_mysql.dll" /><br />
</syntaxhighlight><br />
<br />
===GNU/Linux===<br />
Разархивируйте файл mta_mysql.so в папку ''mods/deathmatch/modules/''.<br />
<br />
Затем, добавьте в mtaserver.conf следующую строку:<br />
<syntaxhighlight lang="xml"><br />
<module src="mta_mysql.so" /><br />
</syntaxhighlight><br />
<br />
<br />
Чтобы исправить ошибку '''MODULE: Unable to find modules/mta_mysql.so (libmysqlclient.so.15: cannot open shared object file: No such file or directory)!''', вам потребуется установить libmysqlclient15.<br />
Скачать можно здесь: http://automation.binarysage.net/?p=1311<br />
<br />
'''При получении ошибок на Unix-системах:'''<br />
Попробуйте добавить параметры порта и сокета в mysql_connect.<br />
<br />
==Функции-обработчики==<br />
{{Modules/MTA-MySQL/Handler_functions}}<br />
<br />
==Функции управления результатом==<br />
{{Modules/MTA-MySQL/Result_functions}}<br />
<br />
==Метод вызова на версии 0.5==<br />
Начиная с версии 0.5, вы можете вызывать все функции модуля, за исключением mysql_connect и mysql_null, так как они являются методами объекта.<br />
<br />
Например, при наличии действительного обработчика MySQL, вы можете выполнить handler:query ( "SELECT * FROM table" ) вместо mysql_query ( handler, "SELECT * FROM table" ).<br />
<br />
===Алиасы функций===<br />
Алиас функции - ее второе имя, что значит, что вызов ее и по оригинальному имени, и по алиасу дадут идентичный результат. Новые алиасы версии 0.5:<br />
* result:num_rows() идентична result:numrows()<br />
* result:num_fields() идентична result:numfields()<br />
* result:free_result() идентична result:free()<br />
<br />
[[Category:Модули]]<br />
<br />
[[en:Modules/MTA-MySQL]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=Modules/MTA-MySQL&diff=46416Modules/MTA-MySQL2016-01-15T12:56:42Z<p>CoolDark: </p>
<hr />
<div><pageclass class="#AA7592" subcaption="MTA-MySQL Module"></pageclass><br />
{{Warning|This module too old, please use [[dbConnect]].}}<br />
{{Module_Info|<br />
name = MTA MySQL |<br />
version = 0.5 |<br />
author = [[User:ryden|Alberto Alonso (ryden)]] |<br />
module_website = [http://code.google.com/p/multitheftauto-modules Here] |<br />
download_link = [http://code.google.com/p/multitheftauto-modules/downloads/list Here] |<br />
license = [http://www.opensource.org/licenses/bsd-license.php BSD] |<br />
written_in = C++ |<br />
operating_system = Cross-platform |<br />
compatible_with = DP2.x & 1.X |<br />
}}<br />
MTA MySQL is an alternative to the default [[Modules/MySQL|ml_mysql]] module provided by the MTA team.<br />
It is available for Windows and GNU/Linux and provides the source code.<br />
<br />
''Note: From version 0.4 it supports both DP2.3 and 1.0 servers.''<br />
<br />
==Installation==<br />
===Windows===<br />
Uncompress the file mta_mysql.dll into your ''C:\Program files\MTA San Andreas\server\mods\deathmatch\modules\'' directory and the file libmysql.dll into your ''C:\Program files\MTA San Andreas\server\'' directory.<br />
<br />
Then, add the following line in mtaserver.conf:<br />
<syntaxhighlight lang="xml"><br />
<module src="mta_mysql.dll" /><br />
</syntaxhighlight><br />
<br />
===GNU/Linux===<br />
Uncompress the file mta_mysql.so in the ''mods/deathmatch/modules/'' directory.<br />
<br />
Then, add the following line in mtaserver.conf:<br />
<syntaxhighlight lang="xml"><br />
<module src="mta_mysql.so" /><br />
</syntaxhighlight><br />
<br />
<br />
To fix '''MODULE: Unable to find modules/mta_mysql.so (libmysqlclient.so.15: cannot open shared object file: No such file or directory)!''' you have to install libmysqlclient15.<br />
You can get it here: http://automation.binarysage.net/?p=1311<br />
<br />
'''If you experience an error on Unix systems:'''<br />
Try to add port and socket parameters to your mysql_connect.<br />
<br />
==Handler functions==<br />
{{Modules/MTA-MySQL/Handler_functions}}<br />
<br />
==Result managing functions==<br />
{{Modules/MTA-MySQL/Result_functions}}<br />
<br />
==Version 0.5 calling method==<br />
From version 0.5 onwards you can call all this module functions, except mysql_connect and mysql_null, as if they are methods of an object.<br />
<br />
For example, having a valid MySQL handler, you can do handler:query ( "SELECT * FROM table" ) instead of mysql_query ( handler, "SELECT * FROM table" ).<br />
<br />
===Function aliases===<br />
A function alias is a second name for a function, which makes calling any of the original name or the alias have the same result. The new aliases introduced in version 0.5 are:<br />
* result:num_rows() is the same as result:numrows()<br />
* result:num_fields() is the same as result:numfields()<br />
* result:free_result() is the same as result:free()<br />
<br />
[[Category:Modules]]<br />
<br />
[[ru:Modules/MTA-MySQL]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/Meta.xml&diff=46110RU/Meta.xml2015-11-19T20:48:04Z<p>CoolDark: </p>
<hr />
<div>Файл ''meta.xml'' представляет MTA набор метаданных, таких как название ресурса, включенные в него скрипты и какие файлы предварительно кэшировать для отправки клиенту, это лишь часть. В нем также объявляются "элементы" для дальнейшей работы с ними. Он написан в XML, который базируется на HTML, и является родителем XHTML.<br />
<br />
=Тэги=<br />
XML - текстовый формат данных, широко используемый для представления данных. MTA использует базирующийся на XML язык для описания метаданных ресурсов с использованием тегов ниже:<br />
<br />
*'''<info />''' Информация об этом ресурсе, возможные для включения параметры (любые произвольные параметры могут быть использованы и прочитаны с помощью [[getResourceInfo]]):<br />
** '''author:''' Автор данного ресурса<br />
** '''version:''' Версия ресурса<br />
** '''name:''' Название ресурса<br />
** '''description:''' Краткое описание ресурса<br />
** '''type:''' Тип ресурса, может быть "gamemode" (игровой режим, мод), "script" (сценарий, скрипт), "map" (карта) или "misc" (разное).<br />
*'''<script />''' Исходный код ресурса, возможные параметры:<br />
** '''src:''' Название файла с исходным кодом (скрипта)<br />
** '''type:''' Тип исходного кода: "client", "server" или "shared"<br />
** '''validate:''' Если установлено значение "false", то актуальность скрипта проверяться не будет.<br />
** '''cache:''' Кеширование для клиентского скрипта, если установлено "false", то скрипт не будет сохраняться на диске клиента.<br />
<!--<br />
** '''protected:''' Для клиентских скриптов, должен ли данный скрипт сохраняться на жестком диске клиента или нет: "true" (да) или "false" (нет). Заметка: [http://bugs.mtasa.com/view.php?id=6831 это может работать нестабильно].<br />
--><br />
*'''<map />''' Карта для мода, возможные параметры:<br />
**'''src:''' название .map-файла (может быть в т.ч. и путь, напр. "maps/filename.map")<br />
**'''dimension:''' Измерение, в котором карта будет загружена (опционально)<br />
*'''<file />''' Клиентский файл. В основном, это картинки, .txd, .col, .dff или .xml файлы. Они будут скачаны клиентами при старте ресурса (или при заходе)<br />
**'''src:''' название клиентского файла (может быть в т.ч. и путь, напр. "images/image.png")<br />
**'''download:''' Должен ли файл быть послан клиенту автоматически или нет (опционально). По умолчанию "true", использование "no" или "false" будет значить, что файл не будет послан при старте ресурса, но сможет быть задействован позже через [[downloadFile]] (с версии 1.4)<br />
*'''<include />''' Включение других ресурсов, которые будет использовать данный ресурс<br />
**'''resource:''' Название ресурса, который вы хотите чтоб стартовал с данным ресурсом<br />
**'''minversion:''' Минимальная версия, которая должна быть у '''ресурса''' (опционально)<br />
**'''maxversion:''' Максимальная версия, которая должна быть у '''ресурса''' (опционально)<br />
*'''<config />''' Конфигурационный файл (.xml), к которому будет иметь доступ ресурс, допустимые параметры:<br />
**'''src:''' Название конфигурационного файла<br />
**'''type:''' Тип конфигурационного файла: "client" или "server"<br />
*'''<export />''' Это экспортирует функции из данного ресурса, чтобы другие ресурсы могли ими пользоваться через [[call]]<br />
**'''function:''' Название функции<br />
**'''type''' Является ли экспортированная функция серверной или клиентской (допустимые значения: "client", "server" и "shared")<br />
**'''http:''' Может ли функция быть вызвана через HTTP (true/false)<br />
*'''<html />'''<br />
**'''src:''' Название HTTP-файла (может быть и путем)<br />
**'''default:''' Является ли html-файл тем, который будет показан по умолчанию при заходе в /имяРесурса/ на сервере. Только один html может быть по умолчанию, все остальные игнорируются. (true/false)<br />
**'''raw:''' Html-файл не анализируется Lua-интерпретатором и рассматривается как двоичные данные. Обязательно должно использоваться для двоичных файлов (в основном картинок) (true/false)<br />
*'''<settings> <setting name="" value=""/> </settings>:''' Большинство модов использует [[settings system]], чтобы позволить администраторам серверов настраивать его по их желанию. Например, вы можете установить время раунда, а затем воспользоваться [[get]] и [[set]] для получения или изменения значений соответственно.<br />
*'''<min_mta_version />''' Минимальная требуемая версия для правильной работы данного ресурса. При авторинге ресурсов, обычно минимальная версия должна быть установлена на в данный момент зарелиженную версию MTA:SA (на данный момент это "{{Current Version|full}}").<br />
**'''client:''' Минимальная версия клиента<br />
**'''server:''' Минимальная версия сервера<br />
*'''<aclrequest />''' Лист [[Access_Control_List|ACL]]-прав, которые понадобятся ресурсу.<br />
{{New items|3.0139|1.3.1 r4141|<br />
*'''<sync_map_element_data />''' Контролирует, пересылаются ли [[Element_data|данные элементов]] карты, такие как "PosX" и "DoubleSided" клиенту. Эти данные зачастую не требуются большинству модов или ресурсов. (Но следует отметить значимое исключения - map editor). При установке параметра в meta.xml мода, настройка применится ко всем картам, загруженным данным ресурсом.<br />
**'''false:''' Отключить пересылку данных элементов карты. Это может значительно уменьшить время закачки карты.<br />
**'''true:''' Включить пересылку данных элементов карты (по умолчанию).<br />
}}<br />
<br />
== Пример ==<br />
Вот и пример meta-файла, использующего некоторые из упомянутых тегов:<br />
{{#tag:code |<br />
<meta><br />
<info author="Slothman" type="gamemode" name="Stealth" /><br />
<config src="help.xml" type="client"/><br />
<min_mta_version client="{{Current Version|full}}" server="{{Current Version|full}}" /><br />
<br />
<script src="stealthmain_server.lua" /><br />
<script src="noiseblip.lua" /><br />
<script src="mission_timer.lua" /><br />
<script src="gadgets_server.lua" /><br />
<script src="gadgets_client.lua" type="client"/><br />
<script src="stealthmain_client.lua" type="client"/><br />
<script src="noisebar.lua" type="client"/><br />
<script src="spycam.lua" type="client"/><br />
<script src="riemann_z_demonstration.lua" type="client" cache="false"/><br />
<br />
<file src="riot_shield.txd" /><br />
<file src="riot_shield.dff" /><br />
<file src="riot_shield.col" /><br />
<file src="armor.png" download="true"/><br />
<file src="camera.png" download="false"/><br />
<file src="cloak.png" /><br />
<file src="goggles.png" /><br />
<file src="mine.png" /><br />
<file src="radar.png" /><br />
<file src="shield.png" /><br />
<br />
<include resource="scoreboard" /><br />
<include resource="killmessages" /><br />
<include resource="maplimits" /><br />
<br />
<settings><br />
<setting name="roundlimit" value="[6]" /> <!-- длина раунда в минутах --><br />
<setting name="teamdamage" value="[1]" /> <!-- 0 для выключения командной защиты, 1 для включения --><br />
<setting name="teambalance" value="[1]" /> <!-- максимум разницы игроков между командами --><br />
<setting name="spazammo" value="[25]" /> <!-- количество патронов --><br />
<setting name="m4ammo" value="[100]" /><br />
<setting name="shotgunammo" value="[25]" /><br />
<setting name="sniperammo" value="[20]" /><br />
<setting name="ak47ammo" value="[120]" /><br />
<setting name="rifleammo" value="[40]" /><br />
<setting name="deserteagleammo" value="[45]" /><br />
<setting name="pistolammo" value="[132]" /><br />
<setting name="uziammo" value="[150]" /><br />
<setting name="tec9ammo" value="[150]" /><br />
<setting name="silencedammo" value="[65]" /><br />
<setting name="grenadeammo" value="[4]" /><br />
<setting name="satchelammo" value="[4]" /><br />
<setting name="teargasammo" value="[4]" /><br />
<setting name="molatovammo" value="[4]" /><br />
</settings><br />
<br />
<aclrequest><br />
<right name="function.startResource" access="true" /><br />
<right name="function.stopResource" access="true" /><br />
<right name="function.setPlayerMuted" access="true" /><br />
</aclrequest><br />
<br />
</meta><br />
|lang="xml"}}<br />
[[Category:Понятия скриптинга]]<br />
[[cs:Meta.xml]]<br />
[[de:Meta.xml]]<br />
[[en:Meta.xml]]<br />
[[es:Sobre el archivo "meta.xml"]]<br />
[[it:Meta.xml]]<br />
[[pl:Meta.xml]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=AddAccount&diff=41655AddAccount2014-08-27T18:50:50Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function adds an [[account]] to the list of registered accounts of the current server.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
==OOP==<br />
{{OOP|This function is also a static function underneath the Account class.|[[Account]].add ||}}<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
Returns an [[account]] or ''false'' if the account already exists or an error occured.<br />
<br />
===Limits===<br />
*'''name:'''<br />
** Minimal account name length is 1 character.<br />
** Account names are case-sensitive.<br />
** Account name can not be equal to "*****"<br />
*'''pass:'''<br />
** Minimal account password length is 1 character.<br />
** Maximum account password length is 30 characters.<br />
** Account password can not be equal to "*****"<br />
<br />
==Example== <br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}<br />
<br />
[[ar:addAcount]]<br />
[[es:addAcount]]<br />
[[ru:addAccount]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=Meta.xml&diff=36720Meta.xml2013-07-20T15:28:00Z<p>CoolDark: </p>
<hr />
<div>The ''meta.xml'' file presents MTA with a set of metadata, such as the resource's name, the scripts to include, and which files to precache for sending to clients among other things. It is also the scope of "elements". It is written in XML, which is based on HTML and is the parent of XHTML.<br />
<br />
=Tags=<br />
XML is a textual data format which is widely used for the representation of data. MTA uses an XML-based language to describe the metadata for resources by using the tags below:<br />
<br />
*'''<info />''' Information about this resource, possible parameters include (any arbitrary parameters can be used and read using [[getResourceInfo]]):<br />
** '''author:''' The author of this resource<br />
** '''version:''' The version of this resource<br />
** '''name:''' The name of this resource<br />
** '''description:''' A brief description of this resource<br />
** '''type:''' The type of this resource, that can be "gamemode", "script", "map" or "misc".<br />
*'''<script />''' Source code for this resource, possible parameters are:<br />
** '''src:''' The file name of the source code<br />
** '''type:''' The type of source code: "client", "server" or "shared".<br />
<!--<br />
** '''protected:''' For client-side scripts, whether this script should or not be saved in the clients hard disk: "true" or "false". NOTE: [http://bugs.mtasa.com/view.php?id=6831 there might be a bug with this].<br />
--><br />
**'''cache:''' When the script file type is "client", this setting controls whether the file is saved on the players hard drive. Default is "true". Using "false" will mean the file is not saved.<br />
**'''validate:''' If set to "false", compatibility checks are skipped.<br />
*'''<map />''' The map for a gamemode, possible parameters are:<br />
**'''src:''' .map file name (can be path too eg. "maps/filename.map")<br />
**'''dimension:''' Dimension in which the map will be loaded (optional)<br />
*'''<file />''' A client-side file. Generally these are images, .txd, .col, .dff or .xml files. They'll be downloaded by clients when the resources is started (or on join)<br />
**'''src:''' client-side file name (can be path too eg. "images/image.png")<br />
**'''download:''' Whether or not to be sent to the client automatically (optional). Default is "true". Using "false" will mean they are not sent on resource start but could later be used by [[downloadFile]] (from version 1.4)<br />
*'''<include />''' Include resources that this resource will use<br />
**'''resource:''' Resource name that you want to start with this resource<br />
**'''minversion:''' Minimum version that '''resource''' needs to be (optional)<br />
**'''maxversion:''' Maximum version that '''resource''' needs to be (optional)<br />
*'''<config />''' Config file (.xml) can be accessed by resource, possible parameters are:<br />
**'''src:''' The file name of the config file<br />
**'''type:''' The type of the config file: "client" or "server"<br />
*'''<export />''' This exports functions from this resource, so other resources can use them with [[call]]<br />
**'''function:''' The function name<br />
**'''type''' Whether function is exported server-side or client-side (valid values are: "server" and "client")<br />
**'''http:''' Can the function be called via HTTP (true/false)<br />
*'''<html />'''<br />
**'''src:''' The filename for the HTTP file (can be a path)<br />
**'''default:''' The html file is one that is shown by default when visiting /resourceName/ on the server. Only one html can be default, the rest are ignored. (true/false)<br />
**'''raw:''' The html file is not parsed by the Lua interpreter and is treated as binary data. Must be used for binary files (images mainly) (true/false)<br />
*'''<settings> <setting name="" value=""/> </settings>:''' Most gamemodes use [[settings system]] to let server admins to configure it how they like. For instance you could set round time and then use [[get]] and [[set]] to get the value or change it, respectively.<br />
*'''<min_mta_version />''' Minimum version requirements for this resource to run correctly. When authoring resources, the minimum version should usually be set to the current released version of MTA:SA (which at the moment is "{{Current Version|full}}"). See example for example.<br />
**'''client:''' The minimum client version<br />
**'''server:''' The minimum server version<br />
*'''<aclrequest />''' A list of [[Access_Control_List|ACL]] rights this resource will need.<br />
{{New items|3.0132|1.3.1 r4141|<br />
*'''<sync_map_element_data />''' Controls whether map [[Element_data|element data]] such as "PosX" and "DoubleSided" are transferred to the client. This data is usually not required by most gamemodes or resources. (Map Editor and Interiors require this to be not set to false to work). When set in a gamemode meta.xml, the setting will apply to all maps loaded by that resource.<br />
**'''false:''' Disable transfer of map element data. This can reduce map download times considerably.<br />
**'''true:''' Enable transfer of map element data (default).<br />
}}<br />
{{New items|3.0140|1.4.0 r5313|<br />
*'''<oop/>''' todo.<br />
**'''false:''' todo.<br />
**'''true:''' todo.<br />
}}<br />
<br />
== Example ==<br />
Heres an example of a meta file using some of the tags mentioned:<br />
{{#tag:code |<br />
<meta><br />
<info author="Slothman" type="gamemode" name="Stealth" /><br />
<config src="help.xml" type="client"/><br />
<br />
<min_mta_version client="{{Current Version|full}}" server="{{Current Version|full}}" /><br />
<br />
<sync_map_element_data>false</sync_map_element_data><br />
<br />
<script src="stealthmain_server.lua" /><br />
<script src="noiseblip.lua" /><br />
<script src="mission_timer.lua" /><br />
<script src="gadgets_server.lua" /><br />
<script src="gadgets_client.lua" type="client"/><br />
<script src="stealthmain_client.lua" type="client"/><br />
<script src="noisebar.lua" type="client"/><br />
<script src="spycam.lua" type="client"/><br />
<script src="riemann_z_demonstration.lua" type="client" cache="false"/><br />
<br />
<file src="riot_shield.txd" /><br />
<file src="riot_shield.dff" /><br />
<file src="riot_shield.col" /><br />
<file src="armor.png" download="true"/><br />
<file src="camera.png" download="false"/><br />
<file src="cloak.png" /><br />
<file src="goggles.png" /><br />
<file src="mine.png" /><br />
<file src="radar.png" /><br />
<file src="shield.png" /><br />
<br />
<include resource="scoreboard" /><br />
<include resource="killmessages" /><br />
<include resource="maplimits" /><br />
<br />
<settings><br />
<setting name="roundlimit" value="[6]" /> <!-- round length in minutes --><br />
<setting name="teamdamage" value="[1]" /> <!-- 0 for team protection off, 1 for team protection on --><br />
<setting name="teambalance" value="[1]" /> <!-- difference limit of amount of players between teams --><br />
<setting name="spazammo" value="[25]" /> <!-- ammo amounts --><br />
<setting name="m4ammo" value="[100]" /><br />
<setting name="shotgunammo" value="[25]" /><br />
<setting name="sniperammo" value="[20]" /><br />
<setting name="ak47ammo" value="[120]" /><br />
<setting name="rifleammo" value="[40]" /><br />
<setting name="deserteagleammo" value="[45]" /><br />
<setting name="pistolammo" value="[132]" /><br />
<setting name="uziammo" value="[150]" /><br />
<setting name="tec9ammo" value="[150]" /><br />
<setting name="silencedammo" value="[65]" /><br />
<setting name="grenadeammo" value="[4]" /><br />
<setting name="satchelammo" value="[4]" /><br />
<setting name="teargasammo" value="[4]" /><br />
<setting name="molatovammo" value="[4]" /><br />
<setting name="isAllowedToShoot" value="true" /><br />
</settings><br />
<br />
<aclrequest><br />
<right name="function.startResource" access="true" /><br />
<right name="function.stopResource" access="true" /><br />
<right name="function.setPlayerMuted" access="true" /><br />
</aclrequest><br />
<br />
</meta><br />
|lang="xml"}}<br />
[[Category:Scripting Concepts]]<br />
[[cs:Meta.xml]]<br />
[[de:Meta.xml]]<br />
[[es:Sobre el archivo "meta.xml"]]<br />
[[it:Meta.xml]]<br />
[[pl:Meta.xml]]<br />
[[ru:Meta.xml]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=User:CoolDark&diff=33821User:CoolDark2012-10-25T18:42:59Z<p>CoolDark: Created page with "CoolDark aka Disinterpreter"</p>
<hr />
<div>CoolDark aka Disinterpreter</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/createWeapon&diff=32915RU/createWeapon2012-08-28T11:34:34Z<p>CoolDark: Created page with "__NOTOC__ {{Client function}} Создает кастомное оружие которое может стрелять без участия игрока. ==Синтаксис=..."</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
Создает кастомное оружие которое может стрелять без участия игрока.<br />
<br />
==Синтаксис==<br />
<syntaxhighlight lang="lua">weapon createWeapon ( string theType, float x, float y, float z )</syntaxhighlight><br />
<br />
===Обязательные аргументы===<br />
* '''theType:''' Тип оружия например M4.<br />
* '''x:''' x позиция для создания оружия.<br />
* '''y:''' y позиция для создания оружия.<br />
* '''z:''' z позиция для создания оружия.<br />
<br />
===Функция возвращает===<br />
Возвращает кастомный тип элемента оружия и создает модель оружия в этой позиции.<br />
<br />
==Требование==<br />
{{Requirements|1.3.0-4555|1.3.0-4555|}}<br />
<br />
==Смотрите также==<br />
{{Client weapon creation functions}}<br />
[[ru:createWeapon]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=CreateWeapon&diff=32914CreateWeapon2012-08-28T11:19:06Z<p>CoolDark: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
Creates a custom weapon that can fire bullets not related to player held weapons.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">weapon createWeapon ( string theType, float x, float y, float z )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''theType:''' The weapon type such as M4.<br />
* '''x:''' The x position to create the weapon.<br />
* '''y:''' The y position to create the weapon.<br />
* '''z:''' The z position to create the weapon.<br />
<br />
===Returns===<br />
Returns a custom weapon element type and creates a simulated weapon at that position.<br />
<br />
==Requirements==<br />
{{Requirements|1.3.0-4555|1.3.0-4555|}}<br />
<br />
==See Also==<br />
{{Client weapon creation functions}}<br />
[[ru:createWeapon]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/copyAccountData&diff=32088RU/copyAccountData2012-08-02T11:25:27Z<p>CoolDark: </p>
<hr />
<div>__NOTOC__ <br />
{{Server function}}<br />
Эта функция копирует данные с одного аккаунта на другой.<br />
<br />
==Использование== <br />
<syntaxhighlight lang="lua"><br />
bool copyAccountData ( account theAccount, account fromAccount )<br />
</syntaxhighlight> <br />
<br />
===Обязательные параметры=== <br />
*'''theAccount:''' Целевой аккаунт.<br />
*'''fromAccount:''' Исходный аккаунт.<br />
<br />
===Что возвращается===<br />
Возвращает ''true'' если аккаунты были корректными, в противном случае ''false'' .<br />
<br />
==Пример==<br />
Этот пример копирует данные с гостевого аккаунта на аккаунт игрока, при его входе.<br />
<syntaxhighlight lang="lua"><br />
function copyDataOnLogin ( previousAccount, currentAccount, autoLogin)<br />
copyAccountData ( currentAccount, previousAccount )<br />
end<br />
addEventHandler ( "onPlayerLogin", getRootElement(), copyDataOnLogin )<br />
<br />
</syntaxhighlight><br />
<br />
==Смотри также==<br />
{{Account_functions}}<br />
[[en:copyAccountData]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/copyAccountData&diff=32087RU/copyAccountData2012-08-02T11:21:55Z<p>CoolDark: Created page with "__NOTOC__ {{Server function}} Эта функция копирует данные с одного аккаунта на другой. ==Использование== <syntaxhighlight lang="lua">[lua..."</p>
<hr />
<div>__NOTOC__ <br />
{{Server function}}<br />
Эта функция копирует данные с одного аккаунта на другой.<br />
<br />
==Использование== <br />
<syntaxhighlight lang="lua"><br />
bool copyAccountData ( account theAccount, account fromAccount )<br />
</syntaxhighlight> <br />
<br />
===Обязательные параметры=== <br />
*'''theAccount:''' Аккаунт на который копируют.<br />
*'''fromAccount:''' Аккаунт с которого копируеют.<br />
<br />
===Что возвращается===<br />
Возвращает ''true'' если аккаунты были корректными, в противном случае ''false'' .<br />
<br />
==Пример==<br />
Этот пример копирует данные с 'гостей' на аккаунт игрока когда он войдет.<br />
<syntaxhighlight lang="lua"><br />
function copyDataOnLogin ( previousAccount, currentAccount, autoLogin)<br />
copyAccountData ( currentAccount, previousAccount )<br />
end<br />
addEventHandler ( "onPlayerLogin", getRootElement(), copyDataOnLogin )<br />
<br />
</syntaxhighlight><br />
<br />
==Смотри также==<br />
{{Account_functions}}<br />
[[en:copyAccountData]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=CopyAccountData&diff=32086CopyAccountData2012-08-02T11:11:21Z<p>CoolDark: </p>
<hr />
<div>__NOTOC__ <br />
{{Server function}}<br />
This function copies all of the data from one account to another.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool copyAccountData ( account theAccount, account fromAccount )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''theAccount:''' The account you wish to copy the data ''to''.<br />
*'''fromAccount:''' The account you wish to copy the data ''from''.<br />
<br />
===Returns===<br />
Returns a ''true'' if the accounts were valid, ''false'' otherwise.<br />
<br />
==Example==<br />
This example copies the account data from the 'guest' to a registered account when they login<br />
<syntaxhighlight lang="lua"><br />
function copyDataOnLogin ( previousAccount, currentAccount, autoLogin)<br />
copyAccountData ( currentAccount, previousAccount )<br />
end<br />
addEventHandler ( "onPlayerLogin", getRootElement(), copyDataOnLogin )<br />
<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Account_functions}}<br />
[[ru:copyAccountData]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32085RU/addAccount2012-08-02T10:50:35Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
Данная фукнция добавляет аккаунт на сервер.<br />
<br />
==Использование== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Необходимые параметры=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' Имя аккаунта.<br />
*'''pass:''' Пароль от аккаунта.<br />
<br />
===Что возвращает===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Возвращает елемент ''account'' если он создался, ''false'' если произошла ошибка при создании.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Пример== <br />
<section name="Сервер" class="server" show="true"><br />
'''Пример 1:''' Этот пример показывает регистрацию на сервере командой /register <password>.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Проверим не пустой ли пароль<br />
if ( password ~= "" and password ~= nil ) then<br />
-- Попытаемся добавить учетную запись<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Сообщим пользователю<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- Сообщим пользователю то, что он ошибся при вводе<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- Покажем пользователю как нужно вводить<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- создадим команду /register<br />
</syntaxhighlight><br />
'''Пример 2:''' Этот пример показывает регистрацию на сервере командой /register <password>.<br />
'''Этот пример отличается от первого тем, что в нем пользователь может задать себе имя.'''<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- создадим команду /register<br />
</syntaxhighlight><br />
<br />
'''Пример 3:''' Этот пример показывает регистрацию на сервере командой /register <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- создадим команду /register<br />
</syntaxhighlight><br />
</section><br />
<br />
==Смотри также==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32084RU/addAccount2012-08-02T10:38:46Z<p>CoolDark: /* Пример */</p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
Данная фукнция добавляет аккаунт на сервер.<br />
<br />
==Использование== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Необходимые параметры=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' Имя аккаунта.<br />
*'''pass:''' Пароль от аккаунта.<br />
<br />
===Что возвращает===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Возвращает елемент ''account'' если он создался, ''false'' если произошла ошибка при создании.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Пример== <br />
<section name="Сервер" class="server" show="true"><br />
'''Пример 1:''' Этот пример показывает регистрацию на сервере командой /register <password>.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Проверим не пустой ли пароль<br />
if ( password ~= "" and password ~= nil ) then<br />
-- Попытаемся добавить учетную запись<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Сообщим пользователю<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- Сообщим пользователю то, что он ошибся при вводе<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- Покажем пользователю как нужно вводить<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- создадим команду /register<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32083RU/addAccount2012-08-02T10:36:04Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
Данная фукнция добавляет аккаунт на сервер.<br />
<br />
==Использование== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Необходимые параметры=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' Имя аккаунта.<br />
*'''pass:''' Пароль от аккаунта.<br />
<br />
===Что возвращает===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Возвращает елемент ''account'' если он создался, ''false'' если произошла ошибка при создании.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Пример== <br />
<section name="Сервер" class="server" show="true"><br />
'''Пример 1:''' Этот пример показывает регистрацию на сервере командой /register <password>.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32082RU/addAccount2012-08-02T10:34:52Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
Данная фукнция добавляет аккаунт на сервер.<br />
<br />
==Использование== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Необходимые параметры=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' Имя аккаунта.<br />
*'''pass:''' Пароль от аккаунта.<br />
<br />
===Что возвращает===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Возвращает елемент ''account'' если он создался, ''false'' если произошла ошибка при создании.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Пример== <br />
<section name="Сервер" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32081RU/addAccount2012-08-02T10:32:36Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
Данная фукнция добавляет аккаунт на сервер.<br />
<br />
==Использование== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Необходимые параметры=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' Имя аккаунта.<br />
*'''pass:''' Пароль от аккаунта.<br />
<br />
===Что возвращает===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Возвращает елемент ''account'' если он создался, ''false'' если произошла ошибка при создании.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32080RU/addAccount2012-08-02T10:30:54Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
Данная фукнция добавляет аккаунт на сервер.<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' Имя аккаунта.<br />
*'''pass:''' Пароль от аккаунта.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Возвращает елемент ''account'' если он создался, ''false'' если произошла ошибка при создании.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32079RU/addAccount2012-08-02T10:28:16Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
Данная фукнция добавляет аккаунт на сервер.<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Returns the ''account'' element if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=AddAccount&diff=32078AddAccount2012-08-02T10:27:43Z<p>CoolDark: /* Syntax */</p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function adds an account to the list of registered accounts of the current server.<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Returns the ''account'' element if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}<br />
<br />
[[es:addAcount]]<br />
[[ru:addAccount]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=AddAccount&diff=32077AddAccount2012-08-02T10:27:32Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function adds an account to the list of registered accounts of the current server.<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Returns the ''account'' element if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
[[ru:addAccount]]<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}<br />
<br />
[[es:addAcount]]<br />
[[ru:addAccount]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32076RU/addAccount2012-08-02T10:27:19Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function adds an account to the list of registered accounts of the current server.<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Returns the ''account'' element if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32075RU/addAccount2012-08-02T10:27:02Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function adds an account to the list of registered accounts of the current server.<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Returns the ''account'' element if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}<br />
[[ru:addAccount]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32074RU/addAccount2012-08-02T10:26:52Z<p>CoolDark: /* Syntax */</p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function adds an account to the list of registered accounts of the current server.<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Returns the ''account'' element if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32073RU/addAccount2012-08-02T10:26:40Z<p>CoolDark: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function adds an account to the list of registered accounts of the current server.<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Returns the ''account'' element if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
[[ru:addAccount]]<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32072RU/addAccount2012-08-02T10:26:20Z<p>CoolDark: </p>
<hr />
<div>Эта функция добавляет аккаунт на сервер.<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Returns the ''account'' element if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/addAccount&diff=32071RU/addAccount2012-08-02T10:25:54Z<p>CoolDark: Created page with "==Syntax== <!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'pla..."</p>
<hr />
<div>==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Returns the ''account'' element if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=AddAccount&diff=32070AddAccount2012-08-02T10:25:16Z<p>CoolDark: /* Syntax */</p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function adds an account to the list of registered accounts of the current server.<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
{{New feature/item|3|1.0|848|<br />
<syntaxhighlight lang="lua"><br />
account addAccount ( string name, string pass )<br />
</syntaxhighlight><br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
<syntaxhighlight lang="lua"><br />
bool addAccount ( string name, string pass )<br />
</syntaxhighlight> <br />
}}<br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''name:''' The name of the account you wish to make, this normally is the player's name.<br />
*'''pass:''' The password to set for this account for future logins.<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
{{New feature|3|1.0 r848|<br />
Returns the ''account'' element if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
{{Deprecated_feature|3|1.0|<br />
Returns ''true'' if the account was created, ''false'' if the account already exists or an error occured.<br />
}}<br />
[[ru:addAccount]]<br />
<br />
==Example== <br />
<section name="Server" class="server" show="true"><br />
'''Example 1:''' This enables players to register on your server by using /register <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, password )<br />
-- Check if the password field is blank or not (only blank if they didnt enter one)<br />
if ( password ~= "" and password ~= nil ) then<br />
--Attempt to add the account, and save its value in a var<br />
local accountAdded = addAccount( getPlayerName(source), password )<br />
if ( accountAdded ) then<br />
-- Tell the user all is done<br />
outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source )<br />
else<br />
-- There was an error making the account, tell the user<br />
outputChatBox ( "Error creating account, contact the server admin", source )<br />
end<br />
else<br />
-- There was an error in the syntax, tell the user the correct syntax.<br />
outputChatBox ( "Error creating account, correct syntax: /register <password>", source )<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''This code differs by allowing the user to change their username that they wish to use.'''<br />
<br />
'''Example 2:''' This enables players to register on your server by using /register <username> <password> in the chat window.<br />
<syntaxhighlight lang="lua"><br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' This code differs again so the user can only register once /register <username> <password>.<br />
<syntaxhighlight lang="lua"><br />
local bRegisteredOnce = false<br />
<br />
function registerPlayer ( source, commandName, username, password )<br />
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil and bRegisteredOnce == false) then<br />
local accountAdded = addAccount(username,password)<br />
if(accountAdded) then<br />
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)<br />
bRegisteredOnce = true<br />
else<br />
outputChatBox("Error creating account, contact the server admin.",source)<br />
end<br />
else<br />
if bRegisteredOnce == true then<br />
outputChatBox("You already registered on this server!",source)<br />
else<br />
outputChatBox("Error creating account, correct syntax: /register <nick> <pass>",source)<br />
end<br />
end<br />
end<br />
addCommandHandler ( "register", registerPlayer ) -- add the command handler<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Account_functions}}<br />
<br />
[[es:addAcount]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/fadeCamera&diff=32069RU/fadeCamera2012-08-02T10:24:11Z<p>CoolDark: </p>
<hr />
<div>TODO<br />
[[ru:FadeCamera]]</div>CoolDarkhttps://wiki.multitheftauto.com/index.php?title=RU/fadeCamera&diff=32068RU/fadeCamera2012-08-02T09:21:20Z<p>CoolDark: Created page with "TODO"</p>
<hr />
<div>TODO</div>CoolDark