Jump to content

Do_De<3

Members
  • Posts

    300
  • Joined

  • Last visited

Everything posted by Do_De<3

  1. السسلام عليكمم ورحمةة الله وبركاتهه : ) اخبآركممم شبآب !. وش مشكلةة الكود ذآ بالزبط : ) كلينت local Key = "F5" local Admin = { {"مساعد","msad.Admin","300"}, {"نآئب ","Big-admin","250"}, {"آدآرةة عامة","SAdmin","180"}, {"آدآرةة عآدي","Admin","90"}, {"مرآقــب","SuperModerator","60"}, {"مشرف","Moderator","25"}, {"شــرطي","Police","10"}, {"كبآر الششخصيآت","V.I.P","7"}, {"صصآحب الورشة","sa7b-wrsh","1"}, {"كنق الدآيري","king.aldayra","1"}, {"حـــــرآمـي","7rame","1"}, {"عآمل الورشة","3aml","1"}, {"درباوي","Drb","1"}, {"كنق الرفع","Alraf3","1"}, {"كنق المعززين","M3zz","1"}, } ---------------------- -- Setting ---------------------- GiveAdmin = { Window = {}, gridlist = {}, button = {}, label = {}, } function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false); local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false); end GiveAdmin.Window[1] = guiCreateWindow(445, 132, 310, 339, "==[ساعات الرتب]==", false); centerWindow(GiveAdmin.Window[1]); guiSetVisible(GiveAdmin.Window[1],false); guiWindowSetSizable(GiveAdmin.Window[1], false); guiSetAlpha(GiveAdmin.Window[1], 1.00); guiSetProperty(GiveAdmin.Window[1], "CaptionColour", "FF0383FB"); GiveAdmin.label[1] = guiCreateLabel(8, 19, 411, 33, "مرحبا بك في نظام الرتب :", false, GiveAdmin.Window[1]); guiSetFont(GiveAdmin.label[1], "default-bold-small") guiLabelSetColor(GiveAdmin.label[1], 255, 0, 0) GiveAdmin.gridlist[1] = guiCreateGridList(9, 51, 294, 236, false, GiveAdmin.Window[1]); guiGridListAddColumn(GiveAdmin.gridlist[1], "#", 0.2) guiGridListAddColumn(GiveAdmin.gridlist[1], "الرتبة #", 0.2); guiGridListAddColumn(GiveAdmin.gridlist[1], "القروب #", 0.2); guiGridListAddColumn(GiveAdmin.gridlist[1], "الساعات #", 0.2); GiveAdmin.label[2] = guiCreateLabel(10, 303, 167, 26, "Created By : Mr.Pres[T]ege", false, GiveAdmin.Window[1]); guiSetFont(GiveAdmin.label[2], "default-bold-small"); guiLabelSetColor(GiveAdmin.label[2], 41, 255, 0); GiveAdmin.button[1] = guiCreateButton(186, 302, 115, 26, "اختيار الرتبة #", false, GiveAdmin.Window[1]); guiSetFont(GiveAdmin.button[1], "default-bold-small"); guiSetProperty(GiveAdmin.button[1], "NormalTextColour", "FFF5FF00"); for k,v in ipairs ( Admin ) do row = guiGridListAddRow(GiveAdmin.gridlist[1]); guiGridListSetItemText(GiveAdmin.gridlist[1],row,1,''..k..'-',false,false); guiGridListSetItemText(GiveAdmin.gridlist[1],row,2,v[1],false,false); guiGridListSetItemText(GiveAdmin.gridlist[1],row,3,v[2],false,false); guiGridListSetItemText(GiveAdmin.gridlist[1],row,4,v[3],false,false); guiGridListSetItemColor(GiveAdmin.gridlist[1],row,1,255,255,0); guiGridListSetItemColor(GiveAdmin.gridlist[1],row,2,0,255,0) guiGridListSetItemColor(GiveAdmin.gridlist[1],row,3,255,255,0); guiGridListSetItemColor(GiveAdmin.gridlist[1],row,4,0,255,0); guiSetFont(GiveAdmin.gridlist[1],"default-bold-small"); end xMainFunctions_ = function ( ) local row, col = guiGridListGetSelectedItem ( GiveAdmin.gridlist[1] ) local Group = tostring ( guiGridListGetItemText(GiveAdmin.gridlist[1],row,3 )); local Price = tostring ( guiGridListGetItemText(GiveAdmin.gridlist[1],row,4 )); local Name = tostring ( guiGridListGetItemText(GiveAdmin.gridlist[1],row,2 )); if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent("Accept:the:request",localPlayer,Group,Price,Name); else outputChatBox("* الرجاء اختيار رتبةة !",255,0,0,true); end end addEventHandler("onClientGUIClick",GiveAdmin.button[1],xMainFunctions_,false); xBindFunction_ = function () guiSetVisible(GiveAdmin.Window[1],not guiGetVisible(GiveAdmin.Window[1])); showCursor(guiGetVisible(GiveAdmin.Window[1])); end bindKey(Key,"down",xBindFunction_); كلينت xAddToGroupFunction_ = function ( Group,Price,Name ) local account = getAccountName(getPlayerAccount(source)); if isGuestAccount(getPlayerAccount(source)) then return outputChatBox(" * يجب عليك التسجيل اولاَ",source,255,0,0,true); end if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("** لديك هذهـ الرتبة فعـلا ! ",source,255,0,0,true); end local sValue = getElementData( source,'Time' ) if not sValue then sValue = '0:0:0' end local data = split(sValue,string.byte(':')) local hour = tonumber( data and data[1] or 0 ) if hour == nil then hour = 0 end if ( hour >= tonumber(Price)) then aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); outputChatBox("** تم اضافة الرتبة بنجاح | "..Name,source,0,255,0,true); else outputChatBox("**ليس لديك ساعات كافية",source,255,0,0,true); end end addEvent("Accept:the:request",true) addEventHandler("Accept:the:request",root,xAddToGroupFunction_) يعطي ادمنيةة وساعاتتهم 0 :\
  2. كيف ماعندي صلاحيةة وانا المدير ؟ ؟
  3. السسلام عليكممم ورحمةة الله وبركاتهه آخبآركمم اعلومكم : ) بغيت حل لمشكلةة الخادم كل ماخش واسجل دخول يجيني Forbidden You don't have permission to access /an/ on this server. Apache/2.2.16 (Debian) Server at 5.135.246.251 Port 80 وش الخرآب ><؟
  4. local xRoot = getRootElement() xOld = { } function xGetOldPlayerName ( ) local xName = getPlayerName ( source ) local xSerial = getPlayerSerial(source) if xOld[tostring(xSerial)] then if xOld[tostring(xSerial)] ~= xName then local xOldName = xOld[tostring(xSerial)] outputChatBox("[ "..xName.." ] >>> , نكه السآبق كان [ "..xOldName.." ]", root, 255, 255, 0, true) xOld[xSerial] = xName end else xOld[xSerial] = xName end end addEventHandler ( "onPlayerJoin", xRoot, xGetOldPlayerName ) جرب هذآ يشتغل عندي وزابط : )
  5. نفس الشيء + ما اضن الخطأ بالميتا ابد طيب يا دودي .. اذا كان المود عندك ارفعه لي اوكيشش : ) سم [ http://www.gulfup.com/?KNb6tx ] رد لي خبر اذا زبط : )
  6. خل اسم الملف سذآ xName.lua
  7. غيرت نكي ودخلت بس ما جاني شيء ولا اقصد ما جاني نكه السابق ~" ترآهه سيرفر اوب كلينت اذا مازبطط اطرحح الميتآ : )
  8. local xRoot = getRootElement() xOld = { } function xGetOldPlayerName ( ) local xName = getPlayerName ( source ) local xSerial = getPlayerSerial(source) if xOld[tostring(xSerial)] then if xOld[tostring(xSerial)] ~= xName then local xOldName = xOld[tostring(xSerial)] outputChatBox("[ "..xName.." ] >>> , هذا اللاعب نككه سابقاً [ "..xOldName.." ]", root, 255, 255, 0, true) xOld[xSerial] = xName end else xOld[xSerial] = xName end end addEventHandler ( "onPlayerJoin", xRoot, xGetOldPlayerName ) سم هذآ كودد فتى حآيل لبى هو # اتمنى افدتكك #
  9. هو يبي اول مايشغل المودد لان لو خليته كذآ بيصير كل واحدد يخش السيرفر بيجيه لاق فهمت كيف ؟
  10. function giveAdminRights (playerSource, commandName, accountName) if accountName then aclGroupAddObject (aclGetGroup("Admin"), "user."..accountName) outputChatBox ("تم اضآفة الحسآب'"..accountName.."' لقروب الادمن", playerSource) end end addCommandHandler ("add", giveAdminRights) مآدري وش بتسوي فيهآ : ) بسس الله يهديكك
  11. ("onClientResourceStart",root,function() outputChatBox("~|مود الايقونات من صنع فوكس اكتب ض1- ق1-د1") outputChatBox("~|مود الايقونات من صنع فوكس اكتب ق1 -ق2-ق3 -ق4") outputChatBox("~|مود الايقونات من صنع فوكس اكتب ض1- -ض2-ض3-ض4") outputChatBox("~|مود الايقونات من صنع فوكس اكتب د1-د2-د3-د4") end,false) حط الكودد كذآ في الفيسآت
  12. اقبل سكآيب وارسل لي التاجج اعدلهه لك
  13. -- local screen_maxX, screen_maxY = guiGetScreenSize() -- local icon1_centerX, icon1_topY = 0.84, 0.3 -- local icon_width, icon_height = 24, 24 -- local icon_sideMargin, icon_bottomMargin = 10, 5 -- local label_width, label_height = 200, 20 -- local label_font, label_topMargin = "default-bold", 3 -- local label_shadowColor = tocolor(12,12,12) -- local rows = 7 -- You can Edit This If You want -- local rows_margin = icon_height + icon_bottomMargin local label1_leftX = screen_maxX * icon1_centerX - icon_width/2 - icon_sideMargin - label_width local label1_rightX = label1_leftX + label_width local label2_leftX = label1_rightX + icon_sideMargin*2 + icon_width local label2_rightX = label2_leftX + label_width local icon_leftX = label1_rightX + icon_sideMargin local icon_topY = screen_maxY * icon1_topY -- local root = getRootElement() local resourceRoot = getResourceRootElement() -- local killRow = {} -- local imagePath = { [0] = "icons/weapons/fist.png", [1] = "icons/weapons/brassKnuckles.png", [2] = "icons/weapons/golfClub.png", [3] = "icons/weapons/nightstick.png", [4] = "icons/weapons/knife.png", [5] = "icons/weapons/baseballBat.png", [6] = "icons/weapons/shovel.png", [7] = "icons/weapons/poolCue.png", [8] = "icons/weapons/katana.png", [9] = "icons/weapons/chainsaw.png", [10] = "icons/weapons/dildo.png", [11] = "icons/weapons/dildo.png", [12] = "icons/weapons/dildo.png", [13] = "icons/deathReasons/death.png", [14] = "icons/weapons/flowers.png", [15] = "icons/weapons/cane.png", [16] = "icons/weapons/grenade.png", [17] = "icons/weapons/tearGas.png", [18] = "icons/weapons/molotovCocktail.png", [19] = "icons/weapons/rocketLauncher.png", [20] = "icons/weapons/hsRocketLauncher.png", [21] = "icons/deathReasons/explosion.png", [22] = "icons/weapons/9mm.png", [23] = "icons/weapons/silenced9mm.png", [24] = "icons/weapons/desertEagle.png", [25] = "icons/weapons/shotgun.png", [26] = "icons/weapons/sawnoffShotgun.png", [27] = "icons/weapons/combatShotgun.png", [28] = "icons/weapons/microSmg.png", [29] = "icons/weapons/mp5.png", [30] = "icons/weapons/ak47.png", [31] = "icons/weapons/m4.png", [32] = "icons/weapons/tec9.png", [33] = "icons/weapons/countryRifle.png", [34] = "icons/weapons/sniperRifle.png", [35] = "icons/weapons/rocketLauncher.png", [36] = "icons/weapons/hsRocketLauncher.png", [37] = "icons/weapons/flamethrower.png", [38] = "icons/weapons/minigun.png", [39] = "icons/weapons/satchelCharge.png", [40] = "icons/weapons/detonator.png", [41] = "icons/weapons/spraycan.png", [42] = "icons/weapons/fireExtinguisher.png", [43] = "icons/deathReasons/explosion.png", [44] = "icons/weapons/goggles.png", [45] = "icons/weapons/goggles.png", [46] = "icons/weapons/parachute.png", [49] = "icons/deathReasons/rammed.png", [50] = "icons/deathReasons/helicopterBlades.png", [51] = "icons/deathReasons/explosion.png", [52] = "icons/deathReasons/fire.png", [53] = "icons/deathReasons/death.png", [54] = "icons/deathReasons/fall.png", [255] = "icons/deathReasons/death.png", connected = "icons/connectStates/connected.png", disconnected = "icons/connectStates/disconnected.png" } -- -- -- function renderClientKillPanel () -- for r = 1, rows do -- if killRow[r] then -- dxDrawText( killRow[r]["killerName"], killRow[r]["killerNamePos"]["leftX"] + 1, killRow[r]["killerNamePos"]["topY"] + 1, killRow[r]["killerNamePos"]["rightX"] + 1, killRow[r]["killerNamePos"]["bottomY"] + 1, label_shadowColor, -- (integer) 1, -- (float) label_font, -- (string) "right" ) -- (string) -- dxDrawText( killRow[r]["killerName"], killRow[r]["killerNamePos"]["leftX"], killRow[r]["killerNamePos"]["topY"], killRow[r]["killerNamePos"]["rightX"], killRow[r]["killerNamePos"]["bottomY"], killRow[r]["killerNameColor"], -- (integer) 1, -- (float) label_font, -- (string) "right" ) -- (string) -- dxDrawImage( killRow[r]["reasonIconPos"]["leftX"], killRow[r]["reasonIconPos"]["topY"], icon_width, icon_height, imagePath[ killRow[r]["deathReason"] ] ) -- dxDrawText( killRow[r]["victimName"], killRow[r]["victimNamePos"]["leftX"] + 1, killRow[r]["victimNamePos"]["topY"] + 1, killRow[r]["victimNamePos"]["rightX"] + 1, killRow[r]["victimNamePos"]["bottomY"] + 1, label_shadowColor, -- (integer) 1, -- (float) label_font ) -- (string) -- dxDrawText( killRow[r]["victimName"], killRow[r]["victimNamePos"]["leftX"], killRow[r]["victimNamePos"]["topY"], killRow[r]["victimNamePos"]["rightX"], killRow[r]["victimNamePos"]["bottomY"], killRow[r]["victimNameColor"], -- (integer) 1, -- масштаб (float) label_font ) -- (string) end end end -- addEventHandler ( "onClientRender", root, renderClientKillPanel ) -- -- -- function showClientDeathMessage ( killerName, killerNameColor, deathReason, victimName, victimNameColor ) -- local firstRow = killRow[1] -- for r = 1, rows - 1 do killRow[r] = killRow[r + 1] end -- -- if type(killerNameColor) ~= "table" then killerNameColor = {255,255,255} end if type(victimNameColor) ~= "table" then victimNameColor = {255,255,255} end -- -- if firstRow then killRow[rows] = firstRow killRow[rows]["killerName"] = tostring(killerName) killRow[rows]["killerNameColor"] = tocolor( unpack(killerNameColor) ) killRow[rows]["deathReason"] = deathReason killRow[rows]["victimName"] = tostring(victimName) killRow[rows]["victimNameColor"] = tocolor( unpack(victimNameColor) ) -- -- else killRow[rows] = { ["killerNamePos"] = { leftX = label1_leftX, rightX = label1_rightX, topY = 0, bottomY = 0 }, ["reasonIconPos"] = { leftX = icon_leftX, topY = 0 }, ["victimNamePos"] = { leftX = label2_leftX, rightX = label2_rightX, topY = 0, bottomY = 0 }, ["killerName"] = tostring(killerName), ["killerNameColor"] = tocolor( unpack(killerNameColor) ), ["deathReason"] = deathReason, ["victimName"] = tostring(victimName), ["victimNameColor"] = tocolor( unpack(victimNameColor) ) } end -- -- if imagePath[ killRow[rows]["deathReason"] ] == nil then killRow[rows]["deathReason"] = 255 end -- if killRow[rows]["killerName"] == killRow[rows]["victimName"] then killRow[rows]["killerName"] = "" end -- local y = icon_topY for r = 1, rows do -- if killRow[r] then -- killRow[r]["killerNamePos"]["topY"] = y + label_topMargin killRow[r]["killerNamePos"]["bottomY"] = y + label_height
  14. client function onResourceStart() local sound = playSound3D("رآبطط الاغنيةة", x, y, z, true) setSoundMaxDistance(sound, 30.0) setSoundVolume(sound, 20.0) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) هذآ هو الكودد آتمنىى آفدتكك يآلبىى : )
  15. آخترآقق المُـلحد الذي تطآول على آيآت الله : ) ! لآيك + اشترآكك + ردكك يهمني
  16. وعليكمم السسلآمم سم هذآ الفري روم http://www.mediafire.com/?2jcly33js3kdrlj وهذي الصورة http://im35.gulfup.com/jZSGD.png السيآرآت http://www.mediafire.com/?dyzwd122yui4nvh اتمنى افدتكك بروب
  17. كلينت coptargets = 0 --ADDS BLIPS AND MARKERS FOR POLICE STATIONS addEvent("copdirections", true) function copshops() if coptargets == 0 then coptargets = 1 blip1 = createBlip ( 2246.1008300781, 2453.1953125, 9.8203125, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker1 = createMarker ( 2246.1008300781, 2453.1953125, 9.8203125, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape1 = createColSphere ( 2246.1008300781, 2453.1953125, 9.8203125, 6 ) setElementData ( colshape1, "purpose", "copshop" ) blip2 = createBlip ( -1406.9072265625, 2655.0927734375, 55.6875, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker2 = createMarker ( -1406.9072265625, 2655.0927734375, 55.6875, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape2 = createColSphere ( -1406.9072265625, 2655.0927734375, 55.6875, 6 ) setElementData ( colshape2, "purpose", "copshop" ) blip3 = createBlip ( -209.9542, 977.7558, 18.188976, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker3 = createMarker ( -209.9542, 977.7558, 18.188976, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape3 = createColSphere (-209.9542, 977.7558, 18.188976, 6 ) setElementData ( colshape3, "purpose", "copshop" ) blip4 = createBlip ( -1628.2619628906, 676.62005615234, 6.1901206970215, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker4 = createMarker ( -1628.2619628906, 676.62005615234, 6.1901206970215, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape4 = createColSphere ( -1628.2619628906, 676.62005615234, 6.1901206970215, 6 ) setElementData ( colshape4, "purpose", "copshop" ) blip5 = createBlip ( 624.66278076172, -605.72027587891, 15.923292160034, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker5 = createMarker ( 624.66278076172, -605.72027587891, 15.923292160034, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape5 = createColSphere ( 624.66278076172, -605.72027587891, 15.923292160034, 6 ) setElementData ( colshape5, "purpose", "copshop" ) blip6 = createBlip ( 1565.3386230469, -1628.5202636719, 12.382812, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker6 = createMarker ( 1565.3386230469, -1628.5202636719, 12.382812, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape6 = createColSphere ( 1565.3386230469, -1628.5202636719, 12.382812, 6 ) setElementData ( colshape6, "purpose", "copshop" ) blip7 = createBlip ( -2164.3779296875, -2389.533203125, 29.617206573486, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker7 = createMarker ( -2164.3779296875, -2389.533203125, 29.617206573486, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape7 = createColSphere ( -2164.3779296875, -2389.533203125, 29.617206573486, 6 ) setElementData ( colshape7, "purpose", "copshop" ) end end addEventHandler("copdirections", getRootElement(), copshops) --TRIGGERED WHEN A COP STATION IS REACHED function copshophit (theshape) if isElement(theshape) then if (getElementData(theshape, "purpose") == "copshop" ) then if ( getElementType( source ) == "player" ) then if (getElementData ( source, "currentstatus" ) == "underarrest") then local thecaptor = (getElementData ( source, "captor" )) local mx, my, mz = getElementPosition(theshape) local clientprisonercheck = setTimer ( clientcheckforprisoners, 1500, 1, thecaptor ) triggerServerEvent ("lockemup", getLocalPlayer (), source, mx, my, mz ) end end end end end addEventHandler ( "onClientElementColShapeHit", getRootElement(), copshophit) function clientcheckforprisoners(thecop) if isElement(thecop) then local prisoners = 0 local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do if (getElementData ( thePlayer, "captor" ) == thecop ) then prisoners = prisoners+1 end end if prisoners == 0 then setElementData ( thecop, "currentarrests", "none" ) clearcopshops() elseif prisoners == 1 then setElementData ( thecop, "currentarrests", "single" ) elseif prisoners == 2 then setElementData ( thecop, "currentarrests", "double" ) end end end --REMOVES POLICE STATION BLIPS FROM COPS RADAR AND THE MARKERS addEvent("clearcopdirections", true) function clearcopshops() if coptargets == 1 then coptargets = 0 destroyElement ( blip1 ) destroyElement ( marker1 ) destroyElement ( colshape1 ) destroyElement ( blip2 ) destroyElement ( marker2 ) destroyElement ( colshape2 ) destroyElement ( blip3 ) destroyElement ( marker3 ) destroyElement ( colshape3 ) destroyElement ( blip4 ) destroyElement ( marker4 ) destroyElement ( colshape4 ) destroyElement ( blip5 ) destroyElement ( marker5 ) destroyElement ( colshape5 ) destroyElement ( blip6 ) destroyElement ( marker6 ) destroyElement ( colshape6 ) destroyElement ( blip7 ) destroyElement ( marker7 ) destroyElement ( colshape7 ) end end addEventHandler("clearcopdirections", getRootElement(), clearcopshops) سيرفر kingCOP = createElement( "Pgroup", "cops" ) kingCIV = createElement( "Pgroup", "civs" ) kingNONE = createElement( "Pgroup", "none" ) function legalstartup(startedresource) if startedresource == getThisResource() then WantedWatch = setTimer (wantedlevelmonitor, 1000, 0) local allplayers = getElementsByType ( "player" ) local detectmethod = get("legalsystem.Copmethod") for playerKey,thePlayer in ipairs(allplayers) do if detectmethod == "team" then local copteam = get("legalsystem.Copteam") local thisTeam = getPlayerTeam(thePlayer) if thisTeam ~= false then if thisTeam == getTeamFromName(copteam) then setElementParent ( thePlayer, kingCOP ) else setElementParent ( thePlayer, kingCIV ) end end elseif detectmethod == "skin" then local thisSkin = getPedSkin(thePlayer) setElementData(getRootElement(),"Copskins",get("legalsystem.Copskins")) local copskins = getElementData(getRootElement(),"Copskins") if type(copskins) == "table" and #copskins > 0 then for k,skinID in ipairs(copskins) do copskins[skinID] = true end end local isacop = 0 for ElementKey, ElementValue in ipairs ( copskins ) do if thisSkin == ElementValue then isacop = 1 end end if isacop == 1 then setElementParent ( thePlayer, kingCOP ) else setElementParent ( thePlayer, kingCIV ) end end end end end addEventHandler( "onResourceStart", getRootElement(), legalstartup) function copSpawnCheck() local detectmethod = get("legalsystem.Copmethod") if detectmethod == "team" then local copteam = get("legalsystem.Copteam") local thisTeam = getPlayerTeam(source) if thisTeam ~= false then if thisTeam == getTeamFromName(copteam) then setElementParent ( source, kingCOP ) else setElementParent ( source, kingCIV ) end end elseif detectmethod == "skin" then local thisSkin = getPedSkin(source) setElementData(getRootElement(),"Copskins",get("legalsystem.Copskins")) local copskins = getElementData(getRootElement(),"Copskins") if type(copskins) == "table" and #copskins > 0 then for k,skinID in ipairs(copskins) do copskins[skinID] = true end end local isacop = 0 for ElementKey, ElementValue in ipairs ( copskins ) do if thisSkin == ElementValue then isacop = 1 end end if isacop == 1 then setElementParent ( source, kingCOP ) else setElementParent ( source, kingCIV ) end end end addEventHandler ( "onPlayerSpawn", getRootElement(), copSpawnCheck ) --ARREST PLAYERS BY SMACKING WITH A NIGHTSTICK function rodneykingcheck ( attacker, weapon, bodypart, loss ) if (attacker) and (weapon == 3) then if getElementParent(attacker) == kingCOP then local thecop = attacker local theprisoner = source local wlevel = getPlayerWantedLevel( source ) if (getElementData ( theprisoner, "currentstatus" ) ~= "underarrest") and (wlevel > 0) then if (getElementData ( attacker, "currentarrests" ) ~= "single" ) and (getElementData ( attacker, "currentarrests" ) ~= "double" ) then setElementData ( thecop, "currentarrests", "single" ) triggerClientEvent(thecop,"copdirections",thecop) elseif (getElementData ( attacker, "currentarrests" ) == "single" ) then setElementData ( thecop, "currentarrests", "double" ) end setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) showCursor ( source, true ) toggleAllControls ( source, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) end end end end addEventHandler ( "onPlayerDamage", getRootElement(), rodneykingcheck ) --ARREST PLAYERS BY HOLDING THEM AT GUNPOINT IF THEY HAVE LOW HP function sightscheck ( element ) if isElement(element) then if ( getElementType ( element ) == "player" ) then if ( getControlState ( source, "aim_weapon" ) ) then local currentgun = getPlayerWeapon ( source ) local wlevel = getPlayerWantedLevel( element ) if (currentgun > 19) and (currentgun < 39) and (wlevel > 0) then if getElementParent(source) == kingCOP then local thecop = source local theprisoner = element local cx, cy, cz = getElementPosition ( source ) local px, py, pz = getElementPosition ( element ) if ( getElementHealth ( element ) < 15 ) and ( getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) < 3 ) then if (getElementData ( theprisoner, "currentstatus" ) ~= "underarrest" ) then if (getElementData ( thecop, "currentarrests" ) ~= "single" ) and (getElementData ( thecop, "currentarrests" ) ~= "double" ) then triggerClientEvent(thecop,"copdirections",thecop) setElementData ( thecop, "currentarrests", "single" ) elseif (getElementData ( thecop, "currentarrests" ) == "single" ) then setElementData ( thecop, "currentarrests", "double" ) end setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) -- local arresttoolong = setTimer ( freetheguy, 180000, 1, theprisoner ) end end end end end end end end addEventHandler ( "onPlayerTarget", getRootElement(), sightscheck ) --ARREST PLAYERS BY PULLING THEM OUT OF A VEHICLE function yankhimout(player, seat, jacker) if isElement(jacker) then if getElementParent(jacker) == kingCOP then local wlevel = getPlayerWantedLevel( player ) if wlevel > 0 then if (getElementData ( jacker, "currentarrests" ) ~= "single" ) and (getElementData ( jacker, "currentarrests" ) ~= "double" ) then local thecop = jacker local theprisoner = player setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) setElementData ( thecop, "currentarrests", "single" ) triggerClientEvent(thecop,"copdirections",thecop) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) elseif (getElementData ( jacker, "currentarrests" ) == "single" ) then local thecop = jacker local theprisoner = player setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) setElementData ( thecop, "currentarrests", "double" ) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) end end end end end addEventHandler ( "onVehicleExit", getRootElement(), yankhimout ) --FORCES A PRISONER TO FOLLOW THE COP function walktheprisoner(thecop, theprisoner) if (getElementData ( theprisoner, "currentstatus" ) == "underarrest") and (getPedOccupiedVehicle ( theprisoner ) == false ) then local copx, copy, copz = getElementPosition ( thecop ) local prisonerx, prisonery, prisonerz = getElementPosition ( theprisoner ) copangle = ( 360 - math.deg ( math.atan2 ( ( copx - prisonerx ), ( copy - prisonery ) ) ) ) % 360 setPedRotation ( theprisoner, copangle ) setCameraTarget ( theprisoner, theprisoner ) local dist = getDistanceBetweenPoints2D ( copx, copy, prisonerx, prisonery ) if ( dist > 16 ) then freetheguy ( theprisoner ) --FREES PRISONER IF HE GETS FAR AWAY elseif ( dist > 12 ) then setControlState ( theprisoner, "sprint", true ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 6 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", true ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist < 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) end end end --FREES A PLAYER (RESETS THEIR CONTROLS AND STATUS) function freetheguy (theprisoner) local thecaptor = (getElementData ( theprisoner, "captor" )) setElementData ( theprisoner, "currentstatus", "none" ) setElementData ( theprisoner, "captor", "none" ) showCursor ( theprisoner, false ) setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) toggleAllControls (theprisoner, true) local prisonercheck = setTimer ( checkforprisoners, 1500, 1, thecaptor ) TimoutTimer = (getElementData ( theprisoner, "arrestTimeout" )) if isTimer(TimoutTimer) then killTimer(TimoutTimer) setElementData ( theprisoner, "arrestTimeout", nil) TimeoutTimer = nil end end function checkforprisoners(thecop) if isElement(thecop) then local prisoners = 0 local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do if (getElementData ( thePlayer, "captor" ) == thecop ) then prisoners = prisoners+1 end end if prisoners == 0 then setElementData ( thecop, "currentarrests", "none" ) triggerClientEvent( thecop,"clearcopdirections",thecop) elseif prisoners == 1 then setElementData ( thecop, "currentarrests", "single" ) elseif prisoners == 2 then setElementData ( thecop, "currentarrests", "double" ) end
  18. مآتششوف شر يآلكآسر ترى اليوم خميس + مصبحين على الجمعه ضض2
  19. السسلآم عليكم ورحمة الله وبركاتهه اخبآركمم ؟ بغيت كودد يخلي الشرطي اول مايخشش الماركر ومعاه حرامي يجيهه فلوسس + مثال على الكود وششكرآ مقدمآ
  20. ألسسلآم عليكمم شبآب آخبآركمم .. الخ بغيت كود لو خشيت على ماركر يجيني لوحة اللوحة جآهزهه بسس الماركر مافهمت له شوي وشكرآ مقدمآ
  21. ابيه يفتح لتتيم معين مو لقروب معين لو سحمت
  22. يب عارف ياتابل ============ jafar لبىىى قلبكك يآشيخخخ تسسسلم لي علىى هيك طرح
×
×
  • Create New...