<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Oldmr3b</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Oldmr3b"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Oldmr3b"/>
	<updated>2026-06-23T20:28:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileWrite&amp;diff=69567</id>
		<title>FileWrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileWrite&amp;diff=69567"/>
		<updated>2021-03-04T09:51:43Z</updated>

		<summary type="html">&lt;p&gt;Oldmr3b: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Writes one or more strings to a given file, starting at the current read/write position. Advances the position over the number of bytes that were written.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int fileWrite ( file theFile, string string1 [, string string2, string string3 ...])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:write}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' A handle to the file you wish to write to. The file must have been opened with write access, i.e. the file handle must be a result of [[fileCreate]] or [[fileOpen]] with the readonly parameter set to ''false''.&lt;br /&gt;
*'''string1:''' The string to write.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*You can provide any number of additional strings to write after '''string1'''. These will be written in the order in which they are specified.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the number of bytes successfully written to the file, returns ''false'' if invalid arguments were specified.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a text file and writes a string to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local fileHandle = fileCreate(&amp;quot;test.txt&amp;quot;)             -- attempt to create a new file&lt;br /&gt;
if fileHandle then                                    -- check if the creation succeeded&lt;br /&gt;
    fileWrite(fileHandle, &amp;quot;This is a test file!&amp;quot;)     -- write a text line&lt;br /&gt;
    fileClose(fileHandle)                             -- close the file once you're done with it&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice that you can't simply do fileWrite(&amp;quot;test.txt&amp;quot;, &amp;quot;File content&amp;quot;). Instead, file functions operate on a '''file handle''', which is a special object representing an open file.&lt;br /&gt;
&lt;br /&gt;
It is also important to remember to close a file after you've finished all your operations on it, especially if you've been writing to the file. If you don't close a file and your resource crashes, all changes to the file may be lost.&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>Oldmr3b</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileWrite&amp;diff=69566</id>
		<title>FileWrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileWrite&amp;diff=69566"/>
		<updated>2021-03-04T09:51:33Z</updated>

		<summary type="html">&lt;p&gt;Oldmr3b: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Writes one or more strings to a given file, starting at the current read/write position. Advances the position over the number of bytes that were written.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int fileWrite ( file theFile, string string1 [, string string2, string string3 ...])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:write}}ي&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' A handle to the file you wish to write to. The file must have been opened with write access, i.e. the file handle must be a result of [[fileCreate]] or [[fileOpen]] with the readonly parameter set to ''false''.&lt;br /&gt;
*'''string1:''' The string to write.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*You can provide any number of additional strings to write after '''string1'''. These will be written in the order in which they are specified.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the number of bytes successfully written to the file, returns ''false'' if invalid arguments were specified.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a text file and writes a string to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local fileHandle = fileCreate(&amp;quot;test.txt&amp;quot;)             -- attempt to create a new file&lt;br /&gt;
if fileHandle then                                    -- check if the creation succeeded&lt;br /&gt;
    fileWrite(fileHandle, &amp;quot;This is a test file!&amp;quot;)     -- write a text line&lt;br /&gt;
    fileClose(fileHandle)                             -- close the file once you're done with it&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice that you can't simply do fileWrite(&amp;quot;test.txt&amp;quot;, &amp;quot;File content&amp;quot;). Instead, file functions operate on a '''file handle''', which is a special object representing an open file.&lt;br /&gt;
&lt;br /&gt;
It is also important to remember to close a file after you've finished all your operations on it, especially if you've been writing to the file. If you don't close a file and your resource crashes, all changes to the file may be lost.&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>Oldmr3b</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:Exports.global:giveMoney&amp;diff=69505</id>
		<title>Multi Theft Auto: Wiki:Exports.global:giveMoney</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:Exports.global:giveMoney&amp;diff=69505"/>
		<updated>2021-02-28T04:44:20Z</updated>

		<summary type="html">&lt;p&gt;Oldmr3b: Oldmr3b moved page Oldmr3b to Multi Theft Auto: Wiki:Exports.global:giveMoney&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== exports.global:giveMoney ==&lt;br /&gt;
The function gives the player money in RolePlay&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.global:giveMoney ( theElement, amount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||player:giveMoney|.money}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:'''  the player you are giving the money to..&lt;br /&gt;
*'''amount:''' a positive integer number specifying the amount of money to give to the player.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the money was added, or false if invalid parameters were passed.&lt;br /&gt;
==Example==  &lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot; name=&amp;quot;Example 1 - Server&amp;quot; class=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
This example gives a player money when using &amp;quot;givemoney&amp;quot; command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function givePlayerMoney ( thePlayer, command, amount ) --when the givecash command is called&lt;br /&gt;
	exports.global:giveMoney ( thePlayer, amount ) --give the player money according to the amount&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;givemoney&amp;quot;, givePlayerMoney) --add a handler function for the command &amp;quot;givecash&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot; name=&amp;quot;Example 2 - Client&amp;quot; class=&amp;quot;client&amp;quot;&amp;gt;&lt;br /&gt;
This example gives a player money when using &amp;quot;givemoney&amp;quot; command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function givePlayerMoney ( command, amount ) --when the givecash command is called&lt;br /&gt;
	exports.global:giveMoney ( localPlayer, amount ) --give the player money according to the amount&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;givemoney&amp;quot;, givePlayerMoney) --add a handler function for the command &amp;quot;givecash&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Oldmr3b</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:Exports.global:giveMoney&amp;diff=69504</id>
		<title>Multi Theft Auto: Wiki:Exports.global:giveMoney</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:Exports.global:giveMoney&amp;diff=69504"/>
		<updated>2021-02-28T04:42:51Z</updated>

		<summary type="html">&lt;p&gt;Oldmr3b: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== exports.global:giveMoney ==&lt;br /&gt;
The function gives the player money in RolePlay&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.global:giveMoney ( theElement, amount )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||player:giveMoney|.money}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:'''  the player you are giving the money to..&lt;br /&gt;
*'''amount:''' a positive integer number specifying the amount of money to give to the player.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the money was added, or false if invalid parameters were passed.&lt;br /&gt;
==Example==  &lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot; name=&amp;quot;Example 1 - Server&amp;quot; class=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
This example gives a player money when using &amp;quot;givemoney&amp;quot; command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function givePlayerMoney ( thePlayer, command, amount ) --when the givecash command is called&lt;br /&gt;
	exports.global:giveMoney ( thePlayer, amount ) --give the player money according to the amount&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;givemoney&amp;quot;, givePlayerMoney) --add a handler function for the command &amp;quot;givecash&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot; name=&amp;quot;Example 2 - Client&amp;quot; class=&amp;quot;client&amp;quot;&amp;gt;&lt;br /&gt;
This example gives a player money when using &amp;quot;givemoney&amp;quot; command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function givePlayerMoney ( command, amount ) --when the givecash command is called&lt;br /&gt;
	exports.global:giveMoney ( localPlayer, amount ) --give the player money according to the amount&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;givemoney&amp;quot;, givePlayerMoney) --add a handler function for the command &amp;quot;givecash&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Oldmr3b</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:Exports.global:giveMoney&amp;diff=69503</id>
		<title>Multi Theft Auto: Wiki:Exports.global:giveMoney</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:Exports.global:giveMoney&amp;diff=69503"/>
		<updated>2021-02-28T04:31:25Z</updated>

		<summary type="html">&lt;p&gt;Oldmr3b: Created page with &amp;quot;role play&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;role play&lt;/div&gt;</summary>
		<author><name>Oldmr3b</name></author>
	</entry>
</feed>