GetPlayerACInfo: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Server function}}
{{Server function}}
__NOTOC__
__NOTOC__
{{New feature/item|3.0140|1.3.3|5523|
{{Deprecated|onPlayerACInfo}}
This function returns anti-cheat info for a player. It can be used to script a white/blacklist of custom d3d9.dll files, or a white/blacklist of players with certain anti-cheat codes. The relevant anti-cheat code has to be disabled (or not enabled) in the server [[Mtaserver.conf#disableac|mtaserver.conf]] to be of use here.
 
{{Note|The info returned by this function can change over time, so it should be called every few seconds rather than just when the player joins. See example.}}
This function returns anti-cheat info for a player. The info returned by this function can change over time, so use the server event [[onPlayerACInfo]] instead.
}}
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
table getPlayerACInfo( element thePlayer )
table getPlayerACInfo( element thePlayer )
</syntaxhighlight>
</syntaxhighlight>
 
{{OOP||[[player]]:getACInfo|ACInfo|}}
===Required Arguments===
===Required Arguments===
*'''thePlayer:''' The [[player]] whose anti-cheat info you want to check.
*'''thePlayer:''' The [[player]] whose anti-cheat info you want to check.
Line 18: Line 17:
*'''d3d9Size:''' A number representing the file size of any custom d3d9.dll the player may have installed.
*'''d3d9Size:''' A number representing the file size of any custom d3d9.dll the player may have installed.
*'''d3d9MD5:''' A string containing the MD5 of any custom d3d9.dll the player may have installed.
*'''d3d9MD5:''' A string containing the MD5 of any custom d3d9.dll the player may have installed.
{{New items|4.0142|1.4|
*'''d3d9SHA256:''' A string containing the SHA256 of any custom d3d9.dll the player may have installed.
*'''d3d9SHA256:''' A string containing the SHA256 of any custom d3d9.dll the player may have installed.
}}
 
<!--
==Example==  
==Example==  
This example checks getPlayerACInfo for changes every 3 seconds
This example checks getPlayerACInfo for changes every 3 seconds
Line 63: Line 62:
</syntaxhighlight>
</syntaxhighlight>


==Example==
This example allows player serial exceptions for SD #14 (virtual machines)
<syntaxhighlight lang="lua">
-- List of serials which are allowed to use virtual machines
allowVM = { ["0123456789012345601234567890123456"] = true,
            ["A123637892167367281632896790123456"] = true,
            ["E123456789012347839207878392123456"] = true }
function checkPlayersACInfo()
    for _,plr in ipairs( getElementsByType("player") ) do
        local ACInfo = getPlayerACInfo(plr)
        if string.find( ACInfo.DetectedAC, "14" ) then
            local serial = getPlayerSerial(plr)
            if not allowVM[serial] then
                kickPlayer( plr, "This server does not allow virtual machines." )
            end
        end
    end
end
setTimer( checkPlayersACInfo, 3000, 0 )
</syntaxhighlight>
-->
==Requirements==
==Requirements==
{{Requirements|1.3.3|n/a|}}
{{Requirements|1.3.3|n/a|}}
==Example==


==See Also==
==See Also==
{{Player_functions}}
{{Player functions|server}}

Revision as of 22:40, 6 September 2024


Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions.

Please use onPlayerACInfo instead.


This function returns anti-cheat info for a player. The info returned by this function can change over time, so use the server event onPlayerACInfo instead.

Syntax

table getPlayerACInfo( element thePlayer )

OOP Syntax Help! I don't understand this!

Method: player:getACInfo(...)
Variable: .ACInfo


Required Arguments

  • thePlayer: The player whose anti-cheat info you want to check.

Returns

Returns a table with the following entries:

  • DetectedAC: A string containing a comma separated list of anti-cheat codes the player has triggered.
  • d3d9Size: A number representing the file size of any custom d3d9.dll the player may have installed.
  • d3d9MD5: A string containing the MD5 of any custom d3d9.dll the player may have installed.
  • d3d9SHA256: A string containing the SHA256 of any custom d3d9.dll the player may have installed.

Requirements

This template will be deleted.

See Also