#1Topro Posted June 22, 2016 Share Posted June 22, 2016 (edited) السلام عليكم Client GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(283, 158, 198, 327, "Solder Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(14, 27, 170, 219, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Name", 0.9) guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "-", false, false) GUIEditor.button[1] = guiCreateButton(14, 270, 76, 35, "Slap", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(108, 270, 76, 35, "Destory", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") grid = GUIEditor.gridlist[1] end end) ) bindKey("m","down", function ( ) guiSetVisible(GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end ) end) addEventHandler("onClientGUIClick",root, function () if ( source == GUIEditor.button[1] ) then local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local text = guiGridListGetItemText(grid,sel,1) local plr = getPlayerFromName(text) if isElement(plr) then triggerServerEvent("killPlayer",localPlayer,plr) end addEventHandler("onClientGUIClick",root, function () if ( source == GUIEditor.button[2] ) then local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local text = guiGridListGetItemText(grid,sel,1) local plr = getPlayerFromName(text) if isElement(plr) then triggerServerEvent("Destroy",localPlayer,plr) end end end function update () guiGridListClear(GUIEditor.gridlist[1]) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v):gsub("#%x%x%x%x%x%x", ""),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) Server addEvent("killPlayer",true) addEventHandler("killPlayer",root, function (plr) killPed(plr) end ) addEvent("Destroy",true) addEventHandler("Destroy",root, function (plr) local veh = getPedOccupiedVehicle(plr) if veh then destroyElement(veh) end end ) Edited July 9, 2016 by Guest Link to comment
#1Topro Posted June 22, 2016 Author Share Posted June 22, 2016 هو مود لوحة شرطه بس ما يصكك سلاب ولا سحب سيارة Link to comment
MR.S3D Posted June 22, 2016 Share Posted June 22, 2016 هو مود لوحة شرطهبس ما يصكك سلاب ولا سحب سيارة بسبب انك شايل اكواد الوان اللاعب وليس اسمه الأصلي يرجى تعديل هذا الكود guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v),false,false) Link to comment
Abdul KariM Posted June 22, 2016 Share Posted June 22, 2016 استبدل الكلينت بهذا function getPlayerFromPartName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(283, 158, 198, 327, "Solder Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(14, 27, 170, 219, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Name", 0.9) guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "-", false, false) GUIEditor.button[1] = guiCreateButton(14, 270, 76, 35, "Slap", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(108, 270, 76, 35, "Destory", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") grid = GUIEditor.gridlist[1] end ) bindKey("m","down", function ( ) guiSetVisible(GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end ) addEventHandler("onClientGUIClick",root, function () if ( source == GUIEditor.button[1] ) then local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local text = guiGridListGetItemText(grid,sel,1) local plr = getPlayerFromPartName(text) if isElement(plr) then triggerServerEvent("killPlayer",localPlayer,plr) end end end end ) addEventHandler("onClientGUIClick",root, function () if ( source == GUIEditor.button[2] ) then local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local text = guiGridListGetItemText(grid,sel,1) local plr = getPlayerFromPartName(text) if isElement(plr) then triggerServerEvent("Destroy",localPlayer,plr) end end end end ) function update () guiGridListClear(GUIEditor.gridlist[1]) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v):gsub("#%x%x%x%x%x%x", ""),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) Link to comment
SaedAmer Posted June 22, 2016 Share Posted June 22, 2016 if ( source == GUIEditor_Button[2] ) then destroy = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) if destroy then triggerServerEvent ("destroy", getLocalPlayer(), tostring(destroy)) end guiSetInputEnabled(false) elseif ( source == GUIEditor_Button[1] ) then slap = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) if slap then triggerServerEvent ("slap", getLocalPlayer(), tostring(slap)) guiSetInputEnabled(false) end سيرفر addEvent( "destroy", true) ----destroy car addEventHandler( "destroy", getRootElement(), function ( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) local theVehicle = getPedOccupiedVehicle ( toWho ) if ( isElement(theVehicle) ) then destroyElement ( theVehicle ) outputChatBox("* Your vehicle has been destroyed by ".. name .."", toWho, 255, 0, 0, true ) else outputChatBox("* he don't have a car !!", source, 255, 0, 0, true ) end end ) --------------- addEvent("slap", true) function slap( 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("* [ #ffff00".. PlayerNick .."#ff0000 ] #999999 has been slapped by#ff0000 [ #ffff00" .. name .."#ff0000 ]", root, 255, 0, 0, true ) end end addEventHandler("slap", getRootElement(),slap) Link to comment
Abdul KariM Posted June 22, 2016 Share Posted June 22, 2016 if ( source == GUIEditor_Button[2] ) then destroy = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) if destroy then triggerServerEvent ("destroy", getLocalPlayer(), tostring(destroy)) end guiSetInputEnabled(false) elseif ( source == GUIEditor_Button[1] ) then slap = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) if slap then triggerServerEvent ("slap", getLocalPlayer(), tostring(slap)) guiSetInputEnabled(false) end سيرفر addEvent( "destroy", true) ----destroy car addEventHandler( "destroy", getRootElement(), function ( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) local theVehicle = getPedOccupiedVehicle ( toWho ) if ( isElement(theVehicle) ) then destroyElement ( theVehicle ) outputChatBox("* Your vehicle has been destroyed by ".. name .."", toWho, 255, 0, 0, true ) else outputChatBox("* he don't have a car !!", source, 255, 0, 0, true ) end end ) --------------- addEvent("slap", true) function slap( 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("* [ #ffff00".. PlayerNick .."#ff0000 ] #999999 has been slapped by#ff0000 [ #ffff00" .. name .."#ff0000 ]", root, 255, 0, 0, true ) end end addEventHandler("slap", getRootElement(),slap) اعتقد الردين الي فوق بزيادة , وانت ضايف اشياء غير طلبه < Link to comment
#1Topro Posted June 22, 2016 Author Share Posted June 22, 2016 صار عندي مشكلة انا مسوي مودين مود باكواد والتاني باكواد اخري ونفس المود عشان اصك سلاب لازم يكونوا الاثنين شغالين ولوحة فقط الي تصكك ولما اقفل الثاني ما تصكك وش الحل ؟ Link to comment
SaedAmer Posted June 22, 2016 Share Posted June 22, 2016 كلنت function getPlayerFromPartName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(283, 158, 198, 327, "Solder Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(14, 27, 170, 219, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Name", 0.9) guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "-", false, false) GUIEditor.button[1] = guiCreateButton(14, 270, 76, 35, "Slap", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(108, 270, 76, 35, "Destory", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") grid = GUIEditor.gridlist[1] end ) bindKey("m","down", function ( ) guiSetVisible(GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end ) if ( source == GUIEditor_Button[2] ) then destroy = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) if destroy then triggerServerEvent ("destroy", getLocalPlayer(), tostring(destroy)) end guiSetInputEnabled(false) elseif ( source == GUIEditor_Button[1] ) then slap = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) if slap then triggerServerEvent ("slap", getLocalPlayer(), tostring(slap)) guiSetInputEnabled(false) end function update () guiGridListClear(GUIEditor.gridlist[1]) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v):gsub("#%x%x%x%x%x%x", ""),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) سيرفر addEvent( "destroy", true) ----destroy car addEventHandler( "destroy", getRootElement(), function ( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) local theVehicle = getPedOccupiedVehicle ( toWho ) if ( isElement(theVehicle) ) then destroyElement ( theVehicle ) outputChatBox("* Your vehicle has been destroyed by ".. name .."", toWho, 255, 0, 0, true ) else outputChatBox("* he don't have a car !!", source, 255, 0, 0, true ) end end ) --------------- addEvent("slap", true) function slap( 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("* [ #ffff00".. PlayerNick .."#ff0000 ] #999999 has been slapped by#ff0000 [ #ffff00" .. name .."#ff0000 ]", root, 255, 0, 0, true ) end end addEventHandler("slap", getRootElement(),slap) Link to comment
#1Topro Posted June 22, 2016 Author Share Posted June 22, 2016 صار عندي مشكلة انا مسوي مودين مود باكواد والتاني باكواد اخريونفس المود عشان اصك سلاب لازم يكونوا الاثنين شغالين ولوحة فقط الي تصكك ولما اقفل الثاني ما تصكك وش الحل ؟ هذه هي Link to comment
Abdul KariM Posted June 22, 2016 Share Posted June 22, 2016 صار عندي مشكلة انا مسوي مودين مود باكواد والتاني باكواد اخريونفس المود عشان اصك سلاب لازم يكونوا الاثنين شغالين ولوحة فقط الي تصكك ولما اقفل الثاني ما تصكك وش الحل ؟ هذه هي تأكد من اكواد المودين , بجانب الكلنت والسيرفر <> Link to comment
Mr.CoR Posted June 22, 2016 Share Posted June 22, 2016 خلي العنوان كذا يالذيب x[ تعديل كود ]x لوحة الشرطة Link to comment
Master_MTA Posted July 6, 2016 Share Posted July 6, 2016 صار عندي مشكلة انا مسوي مودين مود باكواد والتاني باكواد اخريونفس المود عشان اصك سلاب لازم يكونوا الاثنين شغالين ولوحة فقط الي تصكك ولما اقفل الثاني ما تصكك وش الحل ؟ اخي اجمع كودات المودين في مود واحد ولو مسوي تعريف بنفس الاسم غيرو Link to comment
#1Topro Posted July 6, 2016 Author Share Posted July 6, 2016 صار عندي مشكلة انا مسوي مودين مود باكواد والتاني باكواد اخريونفس المود عشان اصك سلاب لازم يكونوا الاثنين شغالين ولوحة فقط الي تصكك ولما اقفل الثاني ما تصكك وش الحل ؟ اخي اجمع كودات المودين في مود واحد ولو مسوي تعريف بنفس الاسم غيرو Ty .. Link to comment
#Soking Posted July 6, 2016 Share Posted July 6, 2016 Client Side _ function getPlayerFromPartName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function guiGridListGetSelectedItemText ( gridList, column ) local item = guiGridListGetSelectedItem ( gridList ) local text = guiGridListGetItemText ( gridList, item, column or 1 ) if ( text ~= '' ) then return text else return false end end 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 function SetWindowVisible ( Panel , StatsP , StatsC ) guiSetVisible( Panel , StatsP) showCursor( StatsC ) centerWindow( Panel ) end Window_ = guiCreateWindow(283, 158, 198, 327, "Solder Panel", false) guiWindowSetSizable(Window_, false) guiSetVisible(Window_,false) GridList_ = guiCreateGridList(14, 27, 170, 219, false, Window_) guiSetFont(GridList_, "default-bold-small") Column_ = guiGridListAddColumn(GridList_, "Name", 0.9) guiGridListAddRow(GridList_) guiGridListSetItemText(GridList_, 0, 1, "-", false, false) Button1_ = guiCreateButton(14, 270, 76, 35, "Slap", false, Window_) guiSetFont(Button1_, "default-bold-small") guiSetProperty(Button1_, "NormalTextColour", "FFAAAAAA") Button2_ = guiCreateButton(108, 270, 76, 35, "Destory", false, Window_) guiSetFont(Button2_, "default-bold-small") guiSetProperty(Button2_, "NormalTextColour", "FFAAAAAA") bindKey("m","down", function ( ) G_ = not guiGetVisible( Window_ ) SetWindowVisible ( Window_ , G_ , G_ ) end ) addEventHandler('onClientGUIClick',getRootElement( ) , function ( ) guiSetInputEnabled(false) local Player = getPlayerFromPartName( guiGridListGetSelectedItemText ( GridList_, Column_ ) ) if ( source == Button2_ ) then triggerServerEvent ("destroy", localPlayer, Player) elseif ( source == Button1_ ) then triggerServerEvent ("slap", localPlayer, Player) end end ) function Update_ ( ) guiGridListClear(GridList_) for _,Players in ipairs (getElementsByType("player")) do local Rows_ , aPlayers_ = guiGridListAddRow ( GridList_ ) , getPlayerName(Players) guiGridListSetItemText (GridList_, Rows_ ,Column_,aPlayers_:gsub("#%x%x%x%x%x%x", ""),false,false) guiGridListSetItemColor(GridList_, Rows_, Column_,math.random( 255 ) ,math.random( 255 ) ,math.random( 255 ) ) end end addEventHandler ("onClientResourceStart",resourceRoot,Update_) addEventHandler ("onClientPlayerJoin",getRootElement ( ),Update_) addEventHandler ("onClientPlayerChangeNick",getRootElement ( ),Update_) addEventHandler ("onClientPlayerQuit",getRootElement ( ),Update_) Server Side_ addEvent( "destroy", true) addEventHandler( "destroy", getRootElement( ), function ( Player ) local aName , aVehicle_ = getPlayerName ( source ) , getPedOccupiedVehicle ( Player ) if ( isElement( aVehicle_ ) ) then destroyElement ( aVehicle_ ) outputChatBox("* Your vehicle has been destroyed by ".. aName .."", Player, 255, 0, 0, true ) else outputChatBox("* he don't have a car !!", source, 255, 0, 0, true ) end end ) addEvent("slap", true) addEventHandler("slap", getRootElement( ), function ( Player ) local aName1_ , aName2_, data = getPlayerName ( Player ) , getPlayerName ( source ) , 100 if ( getElementHealth ( Player ) > 0 ) and ( not isPedDead ( Player ) ) then if ( tonumber ( data ) > getElementHealth ( Player ) ) then setTimer ( killPed, 50, 1, Player ) else setElementHealth ( Player, getElementHealth ( Player ) - data ) local xVelocity ,yVelocity ,zVelocity = getElementVelocity ( Player ) setElementVelocity ( Player, xVelocity ,yVelocity ,zVelocity + 0.2 ) outputChatBox("* [ #ffff00".. aName1_ .."#ff0000 ] #999999 has been slapped by#ff0000 [ #ffff00" ..aName2_.."#ff0000 ]", root, 255, 0, 0, true ) end end end ) Link to comment
#1Topro Posted July 9, 2016 Author Share Posted July 9, 2016 جربت اسوي لوحة جديدة بس في مشكلة يوم اغير لون صك السلاب يجيني كذا [00:35:28] ERROR: Loading script failed: Solder\Server.lua:45: unfinished string near '"#990066..removeHex(getPlayerName(plr))..' Slaped By '..removeHex(getPlayerName(source))..' Reason :- '..r,root,62, 35, 52,true)' وهذا الكود outputChatBox ('' #990066 ..removeHex(getPlayerName(plr))..' Has Been Slaped By '..removeHex(getPlayerName(source))..' Reason '..r,root,255, 0, 255,true ) Link to comment
#Soking Posted July 9, 2016 Share Posted July 9, 2016 outputChatBox ("'' #990066 "..removeHex(getPlayerName(plr)).." Has Been Slaped By "..removeHex(getPlayerName(source)).." Reason """..r,root,255, 0, 255,true ) Link to comment
#1Topro Posted July 9, 2016 Author Share Posted July 9, 2016 outputChatBox ("'' #990066 "..removeHex(getPlayerName(plr)).." Has Been Slaped By "..removeHex(getPlayerName(source)).." Reason """..r,root,255, 0, 255,true ) ERROR: Loading script failed: Solder1/server.lua:44:')' expected near '''''' Link to comment
#1Topro Posted July 9, 2016 Author Share Posted July 9, 2016 عدلته طيب ولو أبي يظهر السبب في [] كيف ؟ Link to comment
#1Topro Posted July 10, 2016 Author Share Posted July 10, 2016 guiGetText هو السبب يظهر وكل شيء بس أبي اكتب السبب في [] مثلا [ تخريب ] Link to comment
N3xT Posted July 10, 2016 Share Posted July 10, 2016 guiGetText هو السبب يظهر وكل شيء بس أبي اكتب السبب في [] مثلا [ تخريب ] حط قبل وبعد " [ ] يعني كذا [ "..r.." ] Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now