Jump to content

Master_MTA

Members
  • Posts

    3,389
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by Master_MTA

  1. textهو هو نفسه jail بس بعد ما ارسلته للسيرفر غيرت اسمه اتمنى تكون وصلت المعلومه تراني قاعد افيدك واستفيد منك مو اتهاوش هدي اعصابك مهي مستاهله
  2. يا غالي شف الكود كامل وبتفهم ولا ما تعرف ترسل تراقر؟
  3. الا حبيبي شف باول رد لي jail = guiGridListGetItemText ( wnd5, guiGridListGetSelectedItem ( wnd5 ), 1 ) ذا تراقر للسيرفر انا اللي ابغى اعرفه هل يبي سيرفر سايد او كلنت سايد
  4. مو فاهم يعني لو اختار شي من الجريد لست زي ما قلت انا بس بيصيير كذا؟ addEvent("jail",true) -- Jail addEventHandler("jail",root, function(text) if text == "1 min" then addCommandHandler("hgsdfjl",functionhfs) elseif text == "2 min" then end end كذا مثلا ولا يبيه كلنت سايد
  5. ? هو يبي كوماند يعني يكتب باف 8 كلمه تسوي له فنكشن مو لما يظغط مرتين على الاتيم
  6. اخوي تفضل 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) row7 = guiGridListAddRow(wnd5) row8 = guiGridListAddRow(wnd5) row9 = guiGridListAddRow(wnd5) row10 = 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,"10 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 ) guiGridListSetItemText(wnd5,row7,column,"2 hour", false, false) guiGridListSetItemColor ( wnd5, row7, column, 0, 0, 255 ) guiGridListSetItemText(wnd5,row8,column,"5 hour", false, false) guiGridListSetItemColor ( wnd5, row8, column, 0, 0, 255 ) guiGridListSetItemText(wnd5,row9,column,"1 day", false, false) guiGridListSetItemColor ( wnd5, row9, column, 0, 0, 255 ) guiGridListSetItemText(wnd5,row10,column,"2 days", false, false) guiGridListSetItemColor ( wnd5, row10, column, 0, 0, 255 ) function onClickza() if source == wnd8 then -- jail jail = guiGridListGetItemText ( wnd5, guiGridListGetSelectedItem ( wnd5 ), 1 ) if jail then triggerServerEvent ("jail", getLocalPlayer(), jail) end addEventHandler("onClientGUIClick",root,onClickza) هذا كان كلنت سايد اما الحين نشوف السيرفر سايد addEvent("jail",true) -- Jail addEventHandler("jail",root, function(text) if text == "1 min" then elseif text == "2 min" then end end ) هذا بالنسبه لكيف تحدد شي من جريد ليست وترسله لسيرفر اما الكومند الصراحه ما اعرف وما ابي افتي ليك ويطلع غلط
  7. اخوي انا غيرت الطريقه خليت لمايضغط على الالمنت يحط عليه داتا بشرط انه اذا كان سياره ارسلتلك الاكواد في الخاص الحين المشكله عندي في كود سحب السياره لو تقدر تفيد امون شاكر @iPrestege #Edit: تم حل المشكله ويعطيه الف الف عافيه الاخ برستيج والله ما قصر جاني السيرفر حقي وجلس يساعدني والله ما يقصر ما ادري وش اقوله مشكور والله function getPlayerFromSerial ( serial ) assert ( type ( serial ) == "string" and #serial == 32, "getPlayerFromSerial - invalid serial" ) for index, player in ipairs ( getElementsByType ( "player" ) ) do if ( getPlayerSerial ( player ) == serial ) then return player end end return false end addEvent ( 'destroy', true) addEventHandler ( 'destroy',root, function ( ) local theVehicle = getElementData ( source,'aToDestroyVehicle' ) if theVehicle and getElementType( theVehicle ) == "vehicle" then driver = getPlayerFromSerial ( getElementData ( theVehicle,'aPlayerSaved' ) ) outputChatBox("Your vehicle has been destroyed by ".. getPlayerName ( source ) ..".",driver, 255, 0, 0, true ) destroyElement (theVehicle) end end ) function aSavePlayer( aPlayer,aSeat ) if aSeat == 0 then setElementData ( source,'aPlayerSaved',getPlayerSerial ( aPlayer ) ) end end addEventHandler ( 'onVehicleExit',root,aSavePlayer ) addEventHandler ( 'onVehicleStartExit',root,aSavePlayer ) addEventHandler ( 'onVehicleEnter',root,aSavePlayer ) addEventHandler ( 'onVehicleStartEnter',root,aSavePlayer ) function masternew ( _, _, thePlayer ) local account = getPlayerAccount ( thePlayer ) if not isGuestAccount ( account ) then if not getElementData ( thePlayer, 'police_m' ) then return end if isObjectInACLGroup( 'user.'..getAccountName(account), aclGetGroup('Police')) then if getElementType( source ) == 'player' then triggerClientEvent ( thePlayer,'openpolice',resourceRoot,getPlayerName(source) ) removeElementData(thePlayer,'police_m' ) elseif getElementType( source ) == 'vehicle' then local contorl = getVehicleController( source ) setElementData ( thePlayer,'aToDestroyVehicle',source ) triggerClientEvent ( thePlayer,"openpolice",resourceRoot,contorl and getPlayerName( contorl ) or 'Unkown' ) removeElementData(thePlayer,"police_m") end end end end addEventHandler( "onElementClicked",root, masternew)
  8. function master (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- تجيب اسم الحساب if isObjectInACLGroup ("user."..accName, aclGetGroup ( "GiveMoney" ) ) then ---------------- تتحقق من وجود اسم الحساب في الجروب givePlayerMoney(root,1500) ---بدل 1500 بالمبلغ اللي تبيه end end addCommandHandler ( "هنا تحط الامر اللي تبي تكتبه باف 8 عشان توزع فلوس", master ) طبعا كله سيرفر سايدددددددد
  9. يب زي ما قالك الاخ نصور
  10. ولا فهمت شي هههههههههههه معرف للجداول ابد وشفت مليون شرح وما فهمت
  11. رائع رائع رائع ما اقدر اقولك واصل لاني احس انك وصلت اعلى شي +_+ ما شاء الله تبارك الله
  12. يعطيكم العافيه بجرب واقولكم ان شاء الله @iPrestege @3NAD يا طيب انا سويت داتا على الالمنت لما يضغط عليها في حال اذا كانت السورس سياره طيب لو تراجع الكود حق elementclick بتفهم علي وفي كود سحب السياره بغيت اسحب الالمنت اللي سويت عليها داتا لما ضغط عليها اللاعب وحطيت veh على اساس انها السياره طيب اما بالنسبه للاخ عناد ف يب كلامك صحيح اسف ما انتبهت لها @iPrestege @3NAD
  13. ابشر تفضل اولا هذي مزبوطه الحدث حق الضغط مافيه اي مشكله function masternew ( _, _, thePlayer ,veh) local account = getPlayerAccount(thePlayer) if not isGuestAccount ( account ) then if not getElementData ( thePlayer, "police_m" ) then return end if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Police")) then if getElementType( source ) == "player" then triggerClientEvent ( thePlayer, "openpolice" ,resourceRoot,getPlayerName(source)) removeElementData(thePlayer,"police_m") elseif getElementType( source ) == "vehicle" then setElementData(source, "driverName123") local controller = getVehicleController(source) triggerClientEvent ( thePlayer, "openpolice" ,resourceRoot,(controller and getPlayerName(controller)) or getElementData(source, "driverName") or "Unknown") removeElementData(thePlayer,"police_m") end end end end addEventHandler( "onElementClicked",root, masternew) ثانيا الحدث حق لما يضغط على زررر طيب كلنت سايد طبعا elseif source == wnd14 then -- destroy triggerServerEvent ("destroy", getLocalPlayer(), guiGetText(mainwndmaster)) ------------ذا حق الزر ------------- وهذا عشان تفهمني بشكل افضل 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( "destroy", true) ----destroy car addEventHandler( "destroy", getRootElement(), function ( PlayerNick,veh ) local name = getPlayerName(source) local theVehicle = getVehicleFromeName(getElementData(veh, "driverName12")) destroyElement (getVehicleName(getElementData(veh, "driverName123"))) outputChatBox("Your vehicle has been destroyed by ".. name ..".", PlayerNick, 255, 0, 0, true ) end ) وبس ابيه يسحب السياره لما يضغط الزر
  14. اي باقي يا غالي
  15. هههههههه يعطيكك العافيه حليتها بس النقطه الثانيه ما عرفت طبعا الحل زي ما قال الاخ عناد بس انا كنت مسوي شي غلط وعدلت على كود m شوي تعديل بسيط bindKey ("m", "down", function() local cursorValue = not isCursorShowing() if not guiGetVisible(mainwndmaster, true) then setElementData ( localPlayer, "police_m", cursorValue ) showCursor( cursorValue ) else guiSetVisible(mainwndmaster,false) guiSetText(mainwndmaster,"") showCursor( false ) end end ) @N3xT وفي تعديل على السيرفر ايضا function masternew ( _, _, thePlayer ) local account = getPlayerAccount(thePlayer) if not isGuestAccount ( account ) then if not getElementData ( thePlayer, "police_m" ) then return end if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Police")) then if getElementType( source ) == "player" then triggerClientEvent ( thePlayer, "openpolice" ,resourceRoot,getPlayerName(source)) removeElementData(thePlayer,"police_m") elseif getElementType( source ) == "vehicle" then local controller = getVehicleController(source) triggerClientEvent ( thePlayer, "openpolice" ,resourceRoot,(controller and getPlayerName(controller)) or getElementData(source, "driverName") or "Unknown") removeElementData(thePlayer,"police_m") end end end end addEventHandler( "onElementClicked",root, masternew) @</Mr.Tn6eL> #Edit يعني المشكله عندي هنا سيرفر سايد addEvent( "destroy", true) ----destroy car addEventHandler( "destroy", getRootElement(), function ( PlayerNick,veh ) local name = getPlayerName(source) local theVehicle = getElementData(PlayerNick, "driverName") or "Unknown" destroyElement ( getElementData("driverName12"),veh ) outputChatBox("Your vehicle has been destroyed by ".. name ..".", PlayerNick, 255, 0, 0, true ) end ) والكلنت سايد 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)
  16. يمكن اخوي منك نستفيد مشكور على المعلومه بس هل تقدر تساعدني في موضوعي اذا تاقدر
  17. الافضل اخوي بحيث ان لو في ملف سيرفر ثاني وفيه نفس الاسم ما يصصير مشاكل
  18. اخوي هل سويت لوكال للماركر يعني كذا local master = createmarker ------------ التكمله طبعا local cartMarker = createMarker(-30.39682, -57.36082, 1002.2, "cylinder", 1, 255, 255, 0, 200) setElementInterior(cartMarker, 6)
  19. اخوي ولو سويت برنامج شات بالفيجوال بيسيك؟
  20. https://www.gta-arabs.com/gt/41637-حصرٍيًا-مودِ-تِوب-30-top-30-script-s3d-amp;al3grab.html
  21. اخوي خذ حقت الاخ سعد جاهزه
  22. يعني يا اخوي قصده هذا في سيرفر function NoName () local Serial = getPlayerSerial ( v ) triggerClientEvent(root,"NoThing",root,Serial) end وهذا في كلنت addEvent("NoThing",true) addEventHandler("NoThing",root,function ( Serial ) for k,v in ipairs(getElementsByType("player")) do local Row = guiGridListAddRow ( gridlist ) if Serial == "هنا حط سريالك " then guiGridListSetItemText ( gridlist, Row, 1,"MR.ÑÄÏF-MTa " , false, false ) else guiGridListSetItemText ( gridlist, Row, 1, getPlayerName ( v ):gsub("#%x%x%x%x%x%x", ""), false, false ) end end end )
  23. يب اخوي ضفت كولم عليه وسويت اسمه تايم انا ابي يجيب اوقات اللاعبين مع التوب اتمنى تكون فهمتو علي @Default @MR.Mosa
  24. @3NAD مو زابط اخي شف اخوي ذي الاكواد كامله سيرفر --***********************************-- -- 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,veh ) local name = getPlayerName(source) local theVehicle = getElementData(PlayerNick, "driverName") or "Unknown" destroyElement ( getElementData("driverName12"),veh ) outputChatBox("Your vehicle has been destroyed by ".. name ..".", PlayerNick, 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 ) addEventHandler ( "onVehicleExit", root, function ( veh , seat ) if seat == 0 then setElementData(source, "driverName12", veh) 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) طيب وش المشاكل اللي عندي المشاكل اللي عندي هي 1- ان اللوحه تفتح وسليمه وكل شي بس اذا كنت لوحدي في السيرفر اذا دخل شخص اخر ما تفتح 2- ان لو دست على سياره فاضيه يجيب اخر مستخدم ليها ويحطه باللوحه من فوق مزبوط بس لما اجي اسوي ديستروي للالمنت ما اعرف وش اسوي فيحتاج حق الدستروي بجانب السيرفر تعديل ديستروي = سحب سياره المهم اخوي التحقق من الصلاحيات لازم ولازم اضيف فيه الايفينت لان لو ما سويت كذا بيصير لما يضغط اف 1 ويدوس على لاعب او سياره تطلع لوحه معه اتمنى تكون فهمت مشكلتي @3NAD
×
×
  • Create New...