جرب
-- # Client
addCommandHandler ("flycar",
function aicars()
triggerServerEvent('checkRankPlayer', localPlayer)
end
)
addEvent ( "thenTrue", true )
addEventHandler ( "thenTrue", root,
function ( )
if isWorldSpecialPropertyEnabled("aircars") then
outputChatBox ("aircars disactivated")
setWorldSpecialPropertyEnabled("aircars", false)
else
outputChatBox ("aircars activated")
setWorldSpecialPropertyEnabled("aircars", true)
end
end
)
-- # Server
local Rank = "Console" --- آلرتبة آلي يشتغل عليه آلآمر
addEvent ( "checkRankPlayer", true )
addEventHandler ( "checkRankPlayer", root,
function ( p )
local acc = getPlayerAccount ( p )
if acc and not isGuestAccount ( acc ) then
if isObjectInACLGroup ( "user."..getAccountName ( acc ), aclGetGroup ( Rank ) ) then
triggerClientEvent ( p, "thenTrue", resourceRoot )
end
end
end
)