Üdv! Ezeket wikipédián találtam, de nem nagyon értem esetleg valaki letudná fordítani magyarra nekem?!
addEventHandler(\"onElementDataChange\", root,
function(dataName, oldValue)
-- Check data is coming from a client
if client then
-- Validate \'special_thing\'
if dataName == \"special_thing\" then
-- \'special_thing\' can only be set by a client on its own player
if client ~= source then
-- Illegal activity here, so log and revert the change
reportAndRevertDataChange( dataName, oldValue, source, client )
end
end
-- Validate \'flag_waving\'
if dataName == \"flag_waving\" then
-- \'flag_waving\' can only be set by a client on its own vehicle
local vehicle = getPedOccupiedVehicle(client)
if vehicle ~= source then
-- Illegal activity here, so log and revert the change
reportAndRevertDataChange( dataName, oldValue, source, client )
end
end
end
end
)
-- Helper function to log and revert changes
function reportAndRevertDataChange( dataName, oldValue, source, client )
-- Report
outputConsole( \"Possible rouge client!\"
.. \" client:\" .. tostring(getPlayerName(client))
.. \" dataName:\" .. tostring(dataName)
.. \" oldValue:\" .. tostring(oldValue)
.. \" newValue:\" .. tostring(getElementData(source,dataName))
.. \" source:\" .. tostring(source)
)
-- Revert (Note this will cause an onElementDataChange event, but \'client\' will be nil)
setElementData( source, dataName, oldValue )
end
https://wiki.multitheftauto.com/wiki/Script_security#How_to_never_trust_data_coming_from_a_client