📡Integration example
-- Block an action while the player is mid-game.
RegisterCommand('tp', function(source)
if exports['var_chess']:IsPlayerInGame(source) then
TriggerClientEvent('chat:addMessage', source, {
args = { 'Chess', 'You cannot teleport during a chess match.' },
})
return
end
-- ... your teleport logic here
end)
-- React when any match ends (stats, logging, payouts, ...).
AddEventHandler('var_chess:server:matchEnded', function(data)
print(('[chess] table %s ended, winner=%s pot=%s'):format(
data.id, tostring(data.winner), data.pot))
end)Last updated