السلام عليكم اخواني اليوم بغيت حل لمشكله قابلتني
وهي اني سويت لوحة شرطي تفتح بضغطة الماوس على اللاعب
وانا ابيها تفتح اذا كان الاعب مستخدم سياره
يعني زي طاره بالظبط
وشي ثاني وهو ان لما اضغط على لاعب يكون هو المقصود انه اسويله سلاب وكذا اسف طولت بالمقدمه
الحين بعرض عليكم
ملاحظه:::::::انا شايل بعض اكواد الكلنت عشان محد يسرق الاكواد ويسويها مود ويكون كل جهدي ضاع مع احترامي لكم
------------------------------------------------------------------------------------------------------------------------------------------------
####Server
addEvent("check",true)
addEventHandler("check",root,
function()
local acc=getPlayerAccount(client)
if(isObjectInACLGroup("user."..getAccountName(acc),aclGetGroup("Police"))) then -- أسم القروب
triggerClientEvent(client,"openGui",client)
end
end
)
addEvent("onElementClicked",true)
addEventHandler( "onElementClicked",root,
function ( Target )
local account = getAccountName(getPlayerAccount(source))
local name = getPlayerName(source)
local thePlayer = getElementType( source ) == "player" or getElementType( source ) == "getPedOccupiedVehicle(source)"
assasasa = getElementType ( thePlayer )
if isObjectInACLGroup("user." .. account, aclGetGroup("Police")) then
if thePlayer then
triggerClientEvent ( source, "openGui12" ,source)
end
end
end
)
function Warp ( Target )
local theTarget = getPlayerFromName ( Target )
local thePlayer = ( source )
local vehicle = getPedOccupiedVehicle( theTarget )
local myVehicle = getPedOccupiedVehicle( thePlayer )
local mySeat = getPedOccupiedVehicleSeat ( thePlayer )
local theElement = ( myVehicle and myVehicle )
if theTarget == thePlayer then
outputChatBox(" *لا يمكنك الانتقال لنفسك!", thePlayer , 255 , 0 , 0)
return
end
if not vehicle and myVehicle and ( mySeat == 0 ) then
local x, y, z = getElementPosition(theTarget)
setElementPosition ( theElement, x+2, y+2, z )
end
if myVehicle and not ( mySeat == 0 ) then
outputChatBox('فقط السائق يمكنه تحديد الموقع.', thePlayer , 255 , 0 , 0)
return
end
if not vehicle and not myVehicle and not ( mySeat == 0 ) then
local x, y, z = getElementPosition(theTarget)
setElementPosition ( thePlayer, x+2, y+2, z )
else
if myVehicle and vehicle and ( mySeat == 0 ) then
outputChatBox('انزل من المركبه اولا.', thePlayer , 255 , 0 , 0)
return
end
local numseats = getVehicleMaxPassengers(vehicle)
for i=0,numseats do
if not getVehicleOccupant(vehicle, i) then
warpPedIntoVehicle(thePlayer, vehicle, i)
return
end
end
outputChatBox('لا يوجد مكان كافي بها' .. getPlayerName(theTarget):gsub( "#%x%x%x%x%x%x", "" ) .. ':مركبة اللاعب.', thePlayer, 255, 0, 0 )
end
local interior = getElementInterior(theTarget)
setElementInterior(thePlayer, interior)
setCameraInterior(thePlayer, interior)
end
addEvent("WarpP",true)
addEventHandler( "WarpP", getRootElement(), Warp )
function Destroy ( Target )
local theTarget = getPlayerFromName ( Target )
local thePlayer = ( source )
local vehicle = getPedOccupiedVehicle( theTarget )
local account = getPlayerAccount(theTarget)
local accname = getAccountName(account)
local isConsole = isObjectInACLGroup("user."..accname,aclGetGroup("Console"))
if vehicle then
destroyElement ( vehicle )
outputChatBox (" * Your vehicle has been destroyed by [ " .. getPlayerName(thePlayer) .. " ]" , theTarget , 255, 0, 0, true)
outputChatBox (" * [ " .. getPlayerName(theTarget) .. "'s #FF0000] vehicle has been destroyed" , thePlayer , 255, 0, 0, true)
else
outputChatBox (" * [ " .. getPlayerName(theTarget) .. " #FF0000] not in vehicle" , thePlayer , 255, 0, 0, true)
end
end
addEvent("DestroyP",true)
addEventHandler( "DestroyP", getRootElement(), Destroy )
function Slap ( Target,masterali123 )
local theTarget = getPlayerFromName ( Target )
local thePlayer = ( source )
local account = getPlayerAccount(theTarget)
local accname = getAccountName(account)
local isConsole = isObjectInACLGroup("user."..accname,aclGetGroup("Console"))
if isElement ( theTarget ) and isElement ( thePlayer ) then
setElementHealth ( theTarget, 0 )
outputChatBox (" #B611CF* " .. getPlayerName(theTarget) .. " #B611CF has been slapped by #B611CF " .. getPlayerName(thePlayer) .. "#B611CF (".. masterali123 ..")" , getRootElement() ,189,13,215, true)
else
outputChatBox (" * [ Error ] Bad arguments" , thePlayer , 255, 0, 0)
end
end
addEvent("SlapP",true)
addEventHandler( "SlapP", getRootElement(), Slap )
function FreezeStatus ( Target )
local theTarget = getPlayerFromName ( Target )
local thePlayer = ( source )
if isElementFrozen ( theTarget ) == true then
triggerClientEvent(thePlayer,"FreezeStatusT",thePlayer)
else
triggerClientEvent(thePlayer,"FreezeStatusF",thePlayer)
end
end
addEvent("FreezeStatus",true)
addEventHandler( "FreezeStatus", getRootElement(), FreezeStatus )
function Freeze ( Target )
local theTarget = getPlayerFromName ( Target )
local thePlayer = ( source )
local Vehicle = getPedOccupiedVehicle( theTarget )
local theElement = ( Vehicle and Vehicle or theTarget )
local account = getPlayerAccount(theTarget)
local accname = getAccountName(account)
local isConsole = isObjectInACLGroup("user."..accname,aclGetGroup("Console"))
if theTarget == thePlayer then
outputChatBox(" * You can't freeze yourself!", thePlayer , 255 , 0 , 0)
return
end
if isConsole then
outputChatBox(" * [ Warning ] You are not allowed to freeze Admins", thePlayer , 255 , 0 , 0)
return
end
if not isElementFrozen ( theTarget ) == true then
setElementFrozen ( theElement, true )
outputChatBox (" * You have been frozen by [ " .. getPlayerName(thePlayer) .. " ]" , theTarget , 255, 0, 0, true)
outputChatBox (" * [ " .. getPlayerName(theTarget) .. " #FF0000] has been frozen" , thePlayer , 255, 0, 0, true)
triggerClientEvent(thePlayer,"FreezeStatusT",thePlayer)
else
setElementFrozen ( theElement, false )
outputChatBox (" * You have been unfrozen by [ " .. getPlayerName(thePlayer) .. " ]" , theTarget , 0, 255, 0, true)
outputChatBox (" * [ " .. getPlayerName(theTarget) .. " #00FF00] has been unfrozen" , thePlayer , 0, 255, 0, true)
triggerClientEvent(thePlayer,"FreezeStatusF",thePlayer)
end
end
addEvent("FreezeP",true)
addEventHandler( "FreezeP", getRootElement(), Freeze )
function Spectate ( Target )
local theTarget = getPlayerFromName ( Target )
local thePlayer = ( source )
local account = getPlayerAccount(theTarget)
local accname = getAccountName(account)
local isConsole = isObjectInACLGroup("user."..accname,aclGetGroup("Console"))
local cTarget = getCameraTarget ( thePlayer )
if theTarget == thePlayer then
outputChatBox(" * لا يمكنك مراقبة نفسك!", thePlayer , 255 , 0 , 0)
return
end
if isConsole then
outputChatBox(" * تحذير غير مسموح لك بمراقبة الادمن", thePlayer , 255 , 0 , 0)
return
end
if ( cTarget == thePlayer ) then
setCameraTarget ( thePlayer , theTarget)
triggerClientEvent(thePlayer,"SpectateStatusT",thePlayer)
else
setCameraTarget ( thePlayer )
triggerClientEvent(thePlayer,"SpectateStatusF",thePlayer)
end
end
addEvent("SpectateP",true)
addEventHandler( "SpectateP", getRootElement(), Spectate )
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
####Cliente
addEventHandler( "onClientGUIClick", destroy ,
function ()
if isPedInVehicle ( localPlayer ) then
destroyElement ( getPedOccupiedVehicle(localPlayer) )
end
end
)