ابي اغير الكود ذا بدل ما يستعمل الماركر + السيارة الأدمن الى جروب سيستم
الأكواد الي عندي
--[[
* Script :
Admins Cars Marker | v1.0
* Type :
server
============
* Author :
#Pai_[N]
--]]
--------------------------------
if ( getElementData( player , "Group" ) == "KOL" ) then
--------------------------------
players = getElementsByType ( 'player' )
function getAllowed ( )
for _,v in ipairs( acc ) do
return v
end
end
addEventHandler ( 'onResourceStart', resourceRoot, function ( )
for k,v in ipairs( players ) do
local acc = getPlayerAccount ( v )
if isGuestAccount ( CC ) then
return
end
local accName = getAccountName ( acc )
if ( getElementData( player , "Group" ) == "KOL" ) then
end
end
end )
addEventHandler ( 'onPlayerLogin', root, function ( _, acc )
if isGuestAccount ( acc ) then
return
end
local accName = getAccountName ( acc )
if ( getElementData( player , "Group" ) == "KOL" ) then
end
end )
addEventHandler ( 'onPlayerLogout', root, function ( )
if ( getElementData( player , "Group" ) == "KOL" ) then
end )
addEvent ( 'onVehicleCreate', true )
addEventHandler ( 'onVehicleCreate', root, function ( id )
local x, y, z = getElementPosition ( source )
for k,v in ipairs( getElementsByType ( 'vehicle' ) ) do
if getElementData ( v, 'fromMarker' ) then
if getPlayerSerial ( source ) == getElementData ( v, 'owner' ) then
destroyElement ( v )
end
end
end
car = createVehicle ( id, x, y, z )
warpPedIntoVehicle ( source, car )
setVehicleDamageProof ( car, true )
setElementData ( car, 'fromMarker', true )
setElementData ( car, 'owner', getPlayerSerial ( source ) )
end )
addEventHandler ( 'onPlayerQuit', root, function ( )
local veh = getPedOccupiedVehicle ( source )
if veh then
destroyElement ( veh )
end
for k,v in ipairs( getElementsByType ( 'vehicle' ) ) do
if getElementData ( v, 'fromMarker' ) then
if getPlayerSerial ( source ) == getElementData ( v, 'owner' ) then
destroyElement ( v )
end
end
end
end )
addEventHandler ( 'onVehicleStartEnter', root, function ( player, seat )
if getElementData ( source, 'fromMarker' ) then
if seat == 0 then
local acc = getPlayerAccount ( player )
if isGuestAccount ( acc ) then
cancelEvent ( )
return outputChatBox ( 'ممتلكات خاصة بجروب كول', player )
end
local accName = getAccountName ( acc )
if not isObjectInACLGroup ( 'user.'..accName, aclGetGroup ( getAllowed ( ) ) ) then
cancelEvent ( )
return outputChatBox ( 'ممتلكات خاصة بجروب كول', player )
end
end
end
end )
---وهذي الأكواد الأصلية---
--[[
* Script :
Admins Cars Marker | v1.0
* Type :
server
============
* Author :
#Pai_[N]
--]]
--------------------------------
Groups = { 'Admin', 'Console' }
--------------------------------
players = getElementsByType ( 'player' )
function getAllowed ( )
for _,v in ipairs( Groups ) do
return v
end
end
addEventHandler ( 'onResourceStart', resourceRoot, function ( )
for k,v in ipairs( players ) do
local acc = getPlayerAccount ( v )
if isGuestAccount ( acc ) then
return
end
local accName = getAccountName ( acc )
if isObjectInACLGroup ( 'user.'..accName, aclGetGroup ( getAllowed ( ) ) ) then
setElementData ( v, 'Admin', true )
end
end
end )
addEventHandler ( 'onPlayerLogin', root, function ( _, acc )
if isGuestAccount ( acc ) then
return
end
local accName = getAccountName ( acc )
if isObjectInACLGroup ( 'user.'..accName, aclGetGroup ( getAllowed ( ) ) ) then
setElementData ( source, 'Admin', true )
end
end )
addEventHandler ( 'onPlayerLogout', root, function ( )
setElementData ( source, 'Admin', false )
end )
addEvent ( 'onVehicleCreate', true )
addEventHandler ( 'onVehicleCreate', root, function ( id )
local x, y, z = getElementPosition ( source )
for k,v in ipairs( getElementsByType ( 'vehicle' ) ) do
if getElementData ( v, 'fromMarker' ) then
if getPlayerSerial ( source ) == getElementData ( v, 'owner' ) then
destroyElement ( v )
end
end
end
car = createVehicle ( id, x, y, z )
warpPedIntoVehicle ( source, car )
setVehicleDamageProof ( car, true )
setElementData ( car, 'fromMarker', true )
setElementData ( car, 'owner', getPlayerSerial ( source ) )
end )
addEventHandler ( 'onPlayerQuit', root, function ( )
local veh = getPedOccupiedVehicle ( source )
if veh then
destroyElement ( veh )
end
for k,v in ipairs( getElementsByType ( 'vehicle' ) ) do
if getElementData ( v, 'fromMarker' ) then
if getPlayerSerial ( source ) == getElementData ( v, 'owner' ) then
destroyElement ( v )
end
end
end
end )
addEventHandler ( 'onVehicleStartEnter', root, function ( player, seat )
if getElementData ( source, 'fromMarker' ) then
if seat == 0 then
local acc = getPlayerAccount ( player )
if isGuestAccount ( acc ) then
cancelEvent ( )
return outputChatBox ( '! للأدمن فقط', player )
end
local accName = getAccountName ( acc )
if not isObjectInACLGroup ( 'user.'..accName, aclGetGroup ( getAllowed ( ) ) ) then
cancelEvent ( )
return outputChatBox ( '! للأدمن فقط', player )
end
end
end
end )
انا ابي اغيرها للجروب
وهذا كود الأخ برستجي
if ( getElementData( player , "Group" ) == "KOL" ) then
وشكراً لكل الي راح يساهم في مساعدتي