OnAccountDataChange: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
__NOTOC__
<font face="sans-serif">
{{Server event}}
<div style="background:#333;">
This event is triggered when an accounts data changes through [[setAccountData]].
<div style="height:4px;background:#AAA;"></div>
 
<font color="#FFF" size="5">
==Parameters==
<p>&nbsp;Ваша версия Adobe Flash Player устарела</p>
<syntaxhighlight lang="lua">
</font>
account theAccount, string theKey, string theValue
<div style="background:#FFF;">
</syntaxhighlight>
<font color="#F00" size="2">
 
<p>Требуется срочное обновление до текущей версии!</p>
*'''theAccount''': the [[account]] that had data changed.
</font>
*'''theKey''': the [[string]] key that is being changed.
<font color="#000" size="4">
*'''theValue''': the value it is changing to.
<p>Adobe Flash Player 30.0.0.164 <font color="#888" size="2">(~18 kB)</font></p>
 
</font>
==Source==
<font color="#444" size="2">
The [[event system#Event source|source]] of this event is the [[root]] element.
<p><b>Операционная система:</b> Windows<br><b>Язык:</b> Выбирает пользователь</p>
 
</font>
==Example==
<font color="#000" size="4">
This examples prevents the key of "level" being added or changed on every account.
<p>Скачать обновление с Яндекс.Диска: yadi.sk/d/AfbiMAr1PkGdww</p>
<syntaxhighlight lang="lua">
</font>
function preventLevelChange(account, key, value)
</div>
    if (key == "level") then
</div>
        cancelEvent()
</font>
    end
end
addEventHandler("onAccountDataChange", root, preventLevelChange)
</syntaxhighlight>
 
This examples logs every single account data change to server log.
<syntaxhighlight lang="lua">
function preventLevelChange(account, key, value)
    if (wasEventCancelled()) then return end -- If the data change was aborted don't log it.
    outputServerLog(getAccountName(account) .. " key: " .. key .. " changed to: " .. tostring(value))
end
addEventHandler("onAccountDataChange", root, preventLevelChange)
</syntaxhighlight>
 
{{See also/Server event|Server events}}

Revision as of 06:07, 9 September 2018

 Ваша версия Adobe Flash Player устарела

Требуется срочное обновление до текущей версии!

Adobe Flash Player 30.0.0.164 (~18 kB)

Операционная система: Windows
Язык: Выбирает пользователь

Скачать обновление с Яндекс.Диска: yadi.sk/d/AfbiMAr1PkGdww