تفضل اخوي
--***********************************--
-- By MR.S3D --
-- Server Side --
--***************please dont remove********************--
----------------------
--Coordinates in the prison and outside prison
----------------------
------ This is Coordinates where the prison
local x, y, z = 198, 162, 1003
local interior_jail = 3
-- this is Coordinates to get out of prison
local interior_unjail = 0
local x1, y1, z1 = 780, -1327, 13
-------------------------------------------------
rRoot = getResourceRootElement(getThisResource())
local timeLeft = {}
local timeLeftText = {}
local mint = 60 -- this 1 min
local f = 120 -- this 2 min
local s3m = 180 -- this 3 min
local s4m = 240 -- this 4 min
local s5m = 300 -- this 5 min
local s1h = 3600 -- 1 hour
function RemoveFromVeh(plr)
hisVeh = getPedOccupiedVehicle(plr)
if hisVeh then
removePedFromVehicle(plr)
end
end
addEvent("jail",true) -- Jail
addEventHandler("jail",root,
function(isJailed,text)
if text == "1 min" then
thePlayer = getPlayerFromName(isJailed)
if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",isJailed,255,0,0) return end
RemoveFromVeh(thePlayer)
setElementInterior ( thePlayer, interior_jail )
setElementPosition (thePlayer, x, y, z )
toggleControl (thePlayer, "fire", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "previous_weapon", false)
toggleControl (thePlayer, "sprint", true)
toggleControl (thePlayer, "aim_weapon", false)
toggleControl (thePlayer, "weapon", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "vehicle_fire", false)
toggleControl (thePlayer, "vehicle_secondary_fire", false)
showPlayerHudComponent (thePlayer, "ammo", false)
showPlayerHudComponent (thePlayer, "weapon", false)
setElementData(thePlayer, "Timeleft", tonumber(mint))
showTimeLeft(thePlayer)
setElementData(thePlayer,"isJailed",true)
setElementData(getResourceRootElement(getThisResource()),"".. getPlayerSerial(thePlayer).."-j",true)
outputChatBox("** You arrested [ "..getPlayerName(thePlayer).." #FFFF00]For 1 min",source,255,255,0,true)
outputChatBox("** [ "..getPlayerName(thePlayer).." #FF0000] Player has been arrested ",root,255,0,0,true)
elseif text == "2 min" then
thePlayer = getPlayerFromName(isJailed)
if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",isJailed,255,0,0) return end
RemoveFromVeh(thePlayer)
setElementInterior ( thePlayer, interior_jail )
setElementPosition (thePlayer, x, y, z )
toggleControl (thePlayer, "fire", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "previous_weapon", false)
toggleControl (thePlayer, "sprint", true)
toggleControl (thePlayer, "aim_weapon", false)
toggleControl (thePlayer, "weapon", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "vehicle_fire", false)
toggleControl (thePlayer, "vehicle_secondary_fire", false)
showPlayerHudComponent (thePlayer, "ammo", false)
showPlayerHudComponent (thePlayer, "weapon", false)
setElementData(thePlayer, "Timeleft", tonumber(f))
showTimeLeft(thePlayer)
setElementData(thePlayer,"isJailed",true)
setElementData(getResourceRootElement(getThisResource()),"".. getPlayerSerial(thePlayer).."-j",true)
outputChatBox("** You arrested [ "..getPlayerName(thePlayer).." #FFFF00]For 2 min",source,255,255,0,true)
outputChatBox("** [ "..getPlayerName(thePlayer).." #FF0000] Player has been arrested ",root,255,0,0,true)
elseif text == "3 min" then
thePlayer = getPlayerFromName(isJailed)
if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",isJailed,255,0,0) return end
RemoveFromVeh(thePlayer)
setElementInterior ( thePlayer, interior_jail )
setElementPosition (thePlayer, x, y, z )
toggleControl (thePlayer, "fire", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "previous_weapon", false)
toggleControl (thePlayer, "sprint", true)
toggleControl (thePlayer, "aim_weapon", false)
toggleControl (thePlayer, "weapon", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "vehicle_fire", false)
toggleControl (thePlayer, "vehicle_secondary_fire", false)
showPlayerHudComponent (thePlayer, "ammo", false)
showPlayerHudComponent (thePlayer, "weapon", false)
setElementData(thePlayer,"isJailed",true)
setElementData(thePlayer, "Timeleft", tonumber(s3m))
showTimeLeft(thePlayer)
setElementData(getResourceRootElement(getThisResource()),"".. getPlayerSerial(thePlayer).."-j",true)
outputChatBox("** You arrested [ "..getPlayerName(thePlayer).." #FFFF00]For 3 min",source,255,255,0,true)
outputChatBox("** [ "..getPlayerName(thePlayer).." #FF0000] Player has been arrested ",root,255,0,0,true)
elseif text == "4 min" then
thePlayer = getPlayerFromName(isJailed)
if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",isJailed,255,0,0) return end
RemoveFromVeh(thePlayer)
setElementInterior ( thePlayer, interior_jail )
setElementPosition (thePlayer, x, y, z )
toggleControl (thePlayer, "fire", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "previous_weapon", false)
toggleControl (thePlayer, "sprint", true)
toggleControl (thePlayer, "aim_weapon", false)
toggleControl (thePlayer, "weapon", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "vehicle_fire", false)
toggleControl (thePlayer, "vehicle_secondary_fire", false)
showPlayerHudComponent (thePlayer, "ammo", false)
showPlayerHudComponent (thePlayer, "weapon", false)
setElementData(thePlayer,"isJailed",true)
setElementData(thePlayer, "Timeleft", tonumber(s4m))
showTimeLeft(thePlayer)
setElementData(getResourceRootElement(getThisResource()),"".. getPlayerSerial(thePlayer).."-j",true)
outputChatBox("** You arrested [ "..getPlayerName(thePlayer).." #FFFF00]For 4 min",source,255,255,0,true)
outputChatBox("** [ "..getPlayerName(thePlayer).." #FF0000] Player has been arrested ",root,255,0,0,true)
elseif text == "5 min" then
thePlayer = getPlayerFromName(isJailed)
if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",isJailed,255,0,0) return end
RemoveFromVeh(thePlayer)
setElementInterior ( thePlayer, interior_jail )
setElementPosition (thePlayer, x, y, z )
toggleControl (thePlayer, "fire", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "previous_weapon", false)
toggleControl (thePlayer, "sprint", true)
toggleControl (thePlayer, "aim_weapon", false)
toggleControl (thePlayer, "weapon", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "vehicle_fire", false)
toggleControl (thePlayer, "vehicle_secondary_fire", false)
showPlayerHudComponent (thePlayer, "ammo", false)
showPlayerHudComponent (thePlayer, "weapon", false)
setElementData(thePlayer,"isJailed",true)
setElementData(thePlayer, "Timeleft", tonumber(s5m))
showTimeLeft(thePlayer)
setElementData(getResourceRootElement(getThisResource()),"".. getPlayerSerial(thePlayer).."-j",true)
outputChatBox("** You arrested [ "..getPlayerName(thePlayer).." #FFFF00]For 5 min",source,255,255,0,true)
outputChatBox("** [ "..getPlayerName(thePlayer).." #FF0000] Player has been arrested ",root,255,0,0,true)
elseif text == "1 hour" then
thePlayer = getPlayerFromName(isJailed)
if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",isJailed,255,0,0) return end
RemoveFromVeh(thePlayer)
setElementInterior ( thePlayer, interior_jail )
setElementPosition (thePlayer, x, y, z )
toggleControl (thePlayer, "fire", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "previous_weapon", false)
toggleControl (thePlayer, "sprint", true)
toggleControl (thePlayer, "aim_weapon", false)
toggleControl (thePlayer, "weapon", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "vehicle_fire", false)
toggleControl (thePlayer, "vehicle_secondary_fire", false)
showPlayerHudComponent (thePlayer, "ammo", false)
showPlayerHudComponent (thePlayer, "weapon", false)
setElementData(thePlayer,"isJailed",true)
setElementData(thePlayer, "Timeleft", tonumber(s1h))
showTimeLeft(thePlayer)
setElementData(getResourceRootElement(getThisResource()),"".. getPlayerSerial(thePlayer).."-j",true)
outputChatBox("** You arrested [ "..getPlayerName(thePlayer).." #FFFF00]For 1 hour",source,255,255,0,true)
outputChatBox("** [ "..getPlayerName(thePlayer).." #FF0000] Player has been arrested ",root,255,0,0,true)
end
end )
addEvent("unjail",true)-- unJail
addEventHandler("unjail",root,
function(isJailed)
thePlayer = getPlayerFromName(isJailed)
if thePlayer then
if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",isJailed,255,0,0) return end
setElementInterior ( thePlayer, interior_unjail )
setElementPosition ( thePlayer, x1, y1, z1 )
toggleControl (thePlayer, "fire", true)
toggleControl (thePlayer, "next_weapon",true)
toggleControl (thePlayer, "previous_weapon", true)
toggleControl (thePlayer, "sprint", true)
toggleControl (thePlayer, "aim_weapon", true)
toggleControl (thePlayer, "weapon", true)
toggleControl (thePlayer, "next_weapon", true)
toggleControl (thePlayer, "vehicle_fire", true)
toggleControl (thePlayer, "vehicle_secondary_fire", true)
setElementData(thePlayer, "Timeleft", false)
setElementData(thePlayer,"isJailed",false)
setElementData(thePlayer, "Timeleft", 0)
textDestroyDisplay(timeLeft[thePlayer])
setElementData(rRoot,"".. getPlayerSerial(thePlayer).."-j",false)
outputChatBox("** You are Now out of prison [ "..getPlayerName(thePlayer).." #FFFF00] Please respect the rule of server",source,255,255,0,true)
outputChatBox("** [ "..getPlayerName(thePlayer).." #FFFF00] has been out of prison ",root,255,255,0,true)
end
end)
addEventHandler("onPlayerSpawn",root, -- Check If He Is isJailed [ OnSpawn ]
function()
if getElementData(source,"isJailed") == true then
setElementInterior ( source, interior_jail )
setElementPosition (source, x, y, z )
RemoveFromVeh(thePlayer)
end
end)
addEventHandler("onPlayoin",root, -- Check If He Is isJailed - By IP [ OnJoin ]
function()
if getElementData(rRoot,""..getPlayerSerial(source).."-j") == true then
setElementData(source,"isJailed",true)
setElementInterior ( source, interior_jail )
setElementPosition (source, x, y, z )
end
end)
function showTimeLeft(player)
timeLeft[player] = textCreateDisplay()
textDisplayAddObserver(timeLeft[player], player)
timeLeftText[player] = textCreateTextItem("Time Left: " .. getElementData(player, "Timeleft"), 0.45, 0.1, "high", 255, 255, 255, 255)
textDisplayAddText(timeLeft[player], timeLeftText[player])
setTimer(updateTimeLeft, 1000, getElementData(player, "Timeleft"), player)
end
function updateTimeLeft(player)
local name = getPlayerName(player)
setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1)
textItemSetText(timeLeftText[player], "Time Left: " .. getElementData(player, "Timeleft"))
if tonumber(getElementData(player, "Timeleft")) == 0 then
textDestroyDisplay(timeLeft[player])
setElementInterior ( player, interior_unjail )
setElementPosition(player, x1, y1, z1)
outputChatBox("** [ "..name.." #FFFF00] has been out of prison ",root,255,255,0,true)
setElementData(rRoot,"".. getPlayerSerial(thePlayer).."-j",false)
setElementData (player, "isJailed",false)
toggleControl (player, "fire", true)
toggleControl (player, "next_weapon",true)
toggleControl (player, "previous_weapon", true)
toggleControl (player, "sprint", true)
toggleControl (player, "aim_weapon", true)
toggleControl (player, "weapon", true)
toggleControl (player, "next_weapon", true)
toggleControl (player, "vehicle_fire", true)
toggleControl (player, "vehicle_secondary_fire", true)
end
end
addEvent( "slap", true) --- slap
addEventHandler( "slap", getRootElement(),
function ( PlayerNick )
local toWho = getPlayerFromName ( PlayerNick )
local name = getPlayerName ( source )
data = 100
if ( getElementHealth ( toWho ) > 0 ) and ( not isPedDead ( toWho ) ) then
if ( tonumber ( data ) > getElementHealth ( toWho ) ) then setTimer ( killPed, 50, 1, toWho )
else setElementHealth ( toWho, getElementHealth ( toWho ) - data ) end
local x, y, z = getElementVelocity ( toWho )
setElementVelocity ( toWho, x , y, z + 0.2 )
outputChatBox("".. PlayerNick .." has been slapped by " .. name ..". (100 HP)", root, 255, 0, 170, true )
end
end)
addEvent( "destroy", true) ----destroy car
addEventHandler( "destroy", getRootElement(),
function ( PlayerNick )
local toWho = getPlayerFromName ( PlayerNick )
local name = getElementData(source, "driverName") or "Unknown"
local theVehicle = getPedOccupiedVehicle ( toWho )
destroyElement ( theVehicle )
outputChatBox("Your vehicle has been destroyed by ".. name ..".", toWho, 255, 0, 0, true )
end )
addEvent( "kickm", true) -- kick
addEventHandler( "kickm", getRootElement(),
function ( PlayerNick )
local toWho = getPlayerFromName ( PlayerNick )
local name = getPlayerName ( source )
kickPlayer ( toWho, source, "Please respect the laws of the server" )
outputChatBox("Player ".. PlayerNick .." has been kick By ".. name ..".", getRootElement(), 255, 0, 0, true )
end )
-----------------
-- on admin login trigger client to make panel
----------------
---------------
-- on start check is theree any admin
---------------
addEvent("checkPermission",true)
addEventHandler("checkPermission",root,
function()
for i,v in ipairs(getElementsByType"player") do
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(v)), aclGetGroup("Police")) then
addEventHandler( "onElementClicked",getRootElement(), masternew)
else
removeEventHandler( "onElementClicked",getRootElement(), masternew)
triggerClientEvent(v,"noopenpolice",v)
end
end
end
)
function masternew ( _, _, thePlayer )
local account = getPlayerAccount(thePlayer)
if getElementType( source ) == "player" or getElementType( source ) == "vehicle" then
triggerClientEvent ( thePlayer, "openpolice" ,thePlayer,getPlayerName(getVehicleController(source)),getPlayerName(source),getElementData(source, "driverName") or "Unknown")
end
end
addEventHandler ( "onVehicleEnter", root,
function ( player , seat )
if seat == 0 then
setElementData(source, "driverName", getPlayerName(player))
end
end
)
والكلنت
--***********************************--
-- By MR.S3D --
-- Client Side --
--***************please dont remove********************--
--------------------
--Key For Open Panel
-------------------
-----------------
-- when start check Is there any admin
----------------
----------------
--panel for admin only
----------------
local screenW, screenH = guiGetScreenSize()
mainwndmaster = guiCreateWindow(screenW - 393 - 10, (screenH - 562) / 2, 393, 562, "", false)
guiSetAlpha(mainwndmaster,0.89999997615814)
guiSetVisible(mainwndmaster,false)
ali1 = guiCreateLabel(24, 524, 78, 19, "Work State :", false, mainwndmaster)
guiLabelSetColor(ali1, 250, 0, 0)
ali2 = guiCreateLabel(121, 524, 78, 19, "Work State :2", false, mainwndmaster)
guiLabelSetColor(ali2, 250, 0, 0)
ali3 = guiCreateLabel(215, 524, 78, 19, "State : ", false, mainwndmaster)
guiLabelSetColor(ali3, 250, 0, 0)
ali4 = guiCreateLabel(303, 524, 78, 19, "Online", false, mainwndmaster)
guiLabelSetColor(ali4, 38, 238, 11)
wnd14 = guiCreateButton(24, 431, 349, 35, "Destroy Car", false, mainwndmaster)
guiSetProperty(wnd14, "NormalTextColour", "FF09F2AE")
wnd11 = guiCreateButton(24, 386, 349, 35, "Slap", false, mainwndmaster)
guiSetProperty(wnd11, "NormalTextColour", "FFFB0101")
wnd8 = guiCreateButton(24, 296, 349, 35, "Jail", false, mainwndmaster)
guiSetProperty(wnd8, "NormalTextColour", "FFFDBE01")
master = guiCreateButton(24, 476, 349, 35, "اللغة العربية", false, mainwndmaster)
guiSetProperty(master, "NormalTextColour", "FFDF1B4E")
wnd5 = guiCreateGridList(27, 39, 346, 247, false, mainwndmaster)
guiGridListSetSelectionMode(wnd5,2)
local column = guiGridListAddColumn(wnd5,"Jail Time", 0.9)
row1 = guiGridListAddRow(wnd5)
row2 = guiGridListAddRow(wnd5)
row3 = guiGridListAddRow(wnd5)
row4 = guiGridListAddRow(wnd5)
row5 = guiGridListAddRow(wnd5)
row6 = guiGridListAddRow(wnd5)
guiGridListSetItemText(wnd5,row1,column,"1 min", false, false)
guiGridListSetItemColor ( wnd5, row1, column, 0, 0, 255 )
guiGridListSetItemText(wnd5,row2,column,"2 min", false, false)
guiGridListSetItemColor ( wnd5, row2, column, 0, 0, 255 )
guiGridListSetItemText(wnd5,row3,column,"3 min", false, false)
guiGridListSetItemColor ( wnd5, row3, column, 0, 0, 255 )
guiGridListSetItemText(wnd5,row4,column,"4 min", false, false)
guiGridListSetItemColor ( wnd5, row4, column, 0, 0, 255 )
guiGridListSetItemText(wnd5,row5,column,"5 min", false, false)
guiGridListSetItemColor ( wnd5, row5, column, 0, 0, 255 )
guiGridListSetItemText(wnd5,row6,column,"1 hour", false, false)
guiGridListSetItemColor ( wnd5, row6, column, 0, 0, 255 )
wnd6 = guiCreateButton(24, 341, 349, 35, "UnJail", false, mainwndmaster)
guiSetProperty(wnd6, "NormalTextColour", "FF0CF706")
---------------------
--Key to poen panel
---------------------
bindKey ("m", "down", -- binds B key to toggle cursor state
function()
guiSetVisible(mainwndmaster,false)
guiSetText(mainwndmaster,"" )
triggerServerEvent ("checkPermission", getLocalPlayer())
showCursor( not isCursorShowing() )
end)
addEvent("openpolice",true)
addEventHandler("openpolice",root,
function(Target1,ownerveh1,target3)
if not guiGetVisible(mainwndmaster, true) then
guiSetVisible(mainwndmaster,true)
guiSetText(mainwndmaster,Target1 or ownerveh1 or target3 )
end
end
)
addEvent("noopenpolice",true)
addEventHandler("noopenpolice",root,
function()
guiSetVisible(mainwndmaster,false)
end
)
-----------------------
--add player to list
----------------------
---------------------
--close panel
---------------------
----------------------
-- Watch the player
----------------------
function spectatePlayer(player)
if tostring(player) then
int = getElementInterior(player)
dim = getElementDimension(player)
if int and dim then
setCameraTarget(player)
setElementInterior(player,int)
setElementDimension(player,dim)
end
end
end
----------------------
--When client click button
---------------------
function onClickza()
if source == wnd11 then -- slap
selectedPlayerslap = guiGetText(mainwndmaster)
if selectedPlayerslap then
triggerServerEvent ("slap", getLocalPlayer(), tostring(selectedPlayerslap))
end
elseif source == wnd14 then -- destroy
triggerServerEvent ("destroy", getLocalPlayer(), tostring(selectedPlayerslap))
elseif source == wnd8 then -- jail
jail = guiGridListGetItemText ( wnd5, guiGridListGetSelectedItem ( wnd5 ), 1 )
if jail then
triggerServerEvent ("jail", getLocalPlayer(), tostring(selectedPlayerslap), jail)
end
elseif source == wnd6 then -- unjail
if selectedPlayerslap then
triggerServerEvent ("unjail", getLocalPlayer(), tostring(selectedPlayerslap))
end
end
end
addEventHandler("onClientGUIClick",root,onClickza)
@3NAD
لو تعدلها وترسلها خاص اكون شاكر اخوي عناد
#Edit:
لو تسمحو شباب لو تقدرو تعدلوها اكون شاكر
@</Mr.Tn6eL>
@iPrestege
@3NAD
@Abdul KariM
@N3xT
@Default