Maksoud Posted April 5, 2016 Share Posted April 5, 2016 #Client Side addEventHandler("onClientGUIClick",root, function ( ) if ( source == tkbtn ) then if ( guiGridListGetSelectedItem(pList ) ~= -1 ) then local plr = guiGridListGetItemText(pList ,guiGridListGetSelectedItem(pList ),1) local myPlayer = getPlayerFromName ( plr ) triggerServerEvent ("takecar", resourceRoot, plr) end end end ) #Server Side addEvent ("takecar", true) addEventHandler ("takecar", root, function (plr) toggleControl ( plr, "enter_exit", false ) outputChatBox ( "# Your License Has Been Removed", plr, 255, 0, 0, true ) end ) Link to comment
iMr.WiFi..! Posted April 5, 2016 Share Posted April 5, 2016 (edited) addEventHandler("onClientGUIClick",root, function ( ) local sel = guiGridListGetSelectedItem( pList ) if source == tkbtn and sel ~= -1 then local plr = guiGridListGetItemText(pList ,sel,1) local myPlayer = getPlayerFromName ( plr ) triggerServerEvent ("takecar", localPlayer, myPlayer) end end end ) addEvent ("takecar", true) addEventHandler ("takecar", root, function ( myPlayer ) toggleControl ( myPlayer, "enter_exit", false ) outputChatBox ( "# Your License Has Been Removed", myPlayer, 255, 0, 0, true ) end ) جرب Edit * Edited April 5, 2016 by Guest Link to comment
iMr.WiFi..! Posted April 5, 2016 Share Posted April 5, 2016 جرب الكود الكلينت مع السيرفر ,, + اطرح الكلينت Link to comment
Maksoud Posted April 5, 2016 Author Share Posted April 5, 2016 addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(458, 273, 447, 499, "Police Manager Panel | لوحة رئيس الشرطة", false) guiWindowSetSizable(wnd, false) guiWindowSetMovable(wnd, false) guiSetAlpha(wnd, 1.00) pList = guiCreateGridList(17, 25, 202, 452, false, wnd) guiGridListAddColumn(pList, "# Players List", 0.9) slapbtn = guiCreateButton(226, 30, 193, 36, "~# Slap #~", false, wnd) guiSetProperty(slapbtn, "NormalTextColour", "FFFF1D1D") desbtn = guiCreateButton(226, 76, 193, 36, "~# Destroy Car #~", false, wnd) guiSetProperty(desbtn, "NormalTextColour", "FFFF1D1D") gvbtn = guiCreateButton(226, 118, 193, 36, "~# Give License #~", false, wnd) guiSetProperty(gvbtn, "NormalTextColour", "FF1BFF03") tkbtn = guiCreateButton(226, 164, 193, 36, "~# Take License #~", false, wnd) guiSetProperty(tkbtn, "NormalTextColour", "FFFF0202") jailOpen = guiCreateButton(226, 215, 193, 36, "~# Jail Player #~", false, wnd) guiSetProperty(jailOpen, "NormalTextColour", "FFFF0202") unbtn = guiCreateButton(226, 266, 193, 36, "~# UnJail Player #~", false, wnd) guiSetProperty(unbtn, "NormalTextColour", "FF1BFF03") enbtn = guiCreateButton(226, 316, 193, 36, "~# English #~", false, wnd) guiSetProperty(enbtn, "NormalTextColour", "FF02B4FF") arbtn = guiCreateButton(226, 367, 193, 36, "~# Arabic #~", false, wnd) guiSetProperty(arbtn, "NormalTextColour", "FF02B4FF") Close = guiCreateButton(226, 413, 193, 36, "~# Close #~", false, wnd) guiSetProperty(Close, "NormalTextColour", "FFFFAE01") VersionLabel = guiCreateLabel(226, 457, 193, 15, "# Police Manager Panal | V1.5.2", false, wnd) guiLabelSetColor(VersionLabel, 255, 82, 29) label2 = guiCreateLabel(227, 474, 193, 15, "# Created By | Sha[D]ow & mIDO", false, wnd) guiLabelSetColor(label2, 45, 255, 29) guiSetVisible(wnd,false) end ) -------------------------------------------------------------- addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() jailWnd = guiCreateWindow((screenW - 337) / 2, (screenH - 238) / 2, 337, 238, "# Jail Information", false) guiWindowSetMovable(jailWnd, false) guiWindowSetSizable(jailWnd, false) guiSetAlpha(jailWnd, 1.00) tList = guiCreateGridList(23, 24, 140, 151, false, jailWnd) guiGridListAddColumn(tList, "# Time", 0.9) jList = guiCreateGridList(175, 24, 138, 152, false, jailWnd) guiGridListAddColumn(jList, "# Places", 0.9) jailButton = guiCreateButton(23, 186, 138, 32, "Jail Player", false, jailWnd) guiSetProperty(jailButton, "NormalTextColour", "FFAAAAAA") JailClose = guiCreateButton(175, 186, 138, 32, "Close", false, jailWnd) guiSetProperty(JailClose, "NormalTextColour", "FFAAAAAA") guiSetVisible(jailWnd,false) end ) -------------------------------------------------------------- bindKey ("m","down", function () triggerServerEvent ("check",localPlayer) end) addEvent ("openWND",true) addEventHandler ("openWND",root, function () guiSetVisible(wnd,not guiGetVisible(wnd)) showCursor(guiGetVisible(wnd)) guiSetInputEnabled (guiGetVisible(wnd)) end ) -------------------------------------------------------------- addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == jailOpen ) then guiSetVisible(wnd,false) guiSetVisible(jailWnd,true) end end ) -------------------------------------------------------------- addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == JailClose ) then guiSetVisible(jailWnd,false) guiSetInputEnabled (false) showCursor(false) end end ) -------------------------------------------------------------- addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == Close ) then guiSetVisible(wnd,false) guiSetInputEnabled (false) showCursor(false) end end ) -------------------------------------------------------------- function update () guiGridListClear(pList) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (pList) guiGridListSetItemText (pList,rp,1,getPlayerName(v),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) -------------------------------------------------------------- -------------------------------------------------------------- addEventHandler("onClientGUIClick",root, function ( ) local sel = guiGridListGetSelectedItem( pList ) if source == tkbtn and sel ~= -1 then local plr = guiGridListGetItemText(pList ,sel,1) local myPlayer = getPlayerFromName ( plr ) triggerServerEvent ("takecar", localPlayer, myPlayer) end end end ) Link to comment
iMr.WiFi..! Posted April 5, 2016 Share Posted April 5, 2016 يخي سعود تعب تعب مو طبيعي يششرحلكم يخي لازم تحذف هذا addEventHandler("onClientResourceStart", resourceRoot, ولا مابيشتغل لانه هو داخل حدث الكود local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow(458, 273, 447, 499, "Police Manager Panel | لوحة رئيس الشرطة", false) guiWindowSetSizable(wnd, false) guiWindowSetMovable(wnd, false) guiSetAlpha(wnd, 1.00) pList = guiCreateGridList(17, 25, 202, 452, false, wnd) guiGridListAddColumn(pList, "# Players List", 0.9) slapbtn = guiCreateButton(226, 30, 193, 36, "~# Slap #~", false, wnd) guiSetProperty(slapbtn, "NormalTextColour", "FFFF1D1D") desbtn = guiCreateButton(226, 76, 193, 36, "~# Destroy Car #~", false, wnd) guiSetProperty(desbtn, "NormalTextColour", "FFFF1D1D") gvbtn = guiCreateButton(226, 118, 193, 36, "~# Give License #~", false, wnd) guiSetProperty(gvbtn, "NormalTextColour", "FF1BFF03") tkbtn = guiCreateButton(226, 164, 193, 36, "~# Take License #~", false, wnd) guiSetProperty(tkbtn, "NormalTextColour", "FFFF0202") jailOpen = guiCreateButton(226, 215, 193, 36, "~# Jail Player #~", false, wnd) guiSetProperty(jailOpen, "NormalTextColour", "FFFF0202") unbtn = guiCreateButton(226, 266, 193, 36, "~# UnJail Player #~", false, wnd) guiSetProperty(unbtn, "NormalTextColour", "FF1BFF03") enbtn = guiCreateButton(226, 316, 193, 36, "~# English #~", false, wnd) guiSetProperty(enbtn, "NormalTextColour", "FF02B4FF") arbtn = guiCreateButton(226, 367, 193, 36, "~# Arabic #~", false, wnd) guiSetProperty(arbtn, "NormalTextColour", "FF02B4FF") Close = guiCreateButton(226, 413, 193, 36, "~# Close #~", false, wnd) guiSetProperty(Close, "NormalTextColour", "FFFFAE01") VersionLabel = guiCreateLabel(226, 457, 193, 15, "# Police Manager Panal | V1.5.2", false, wnd) guiLabelSetColor(VersionLabel, 255, 82, 29) label2 = guiCreateLabel(227, 474, 193, 15, "# Created By | Sha[D]ow & mIDO", false, wnd) guiLabelSetColor(label2, 45, 255, 29) guiSetVisible(wnd,false) jailWnd = guiCreateWindow((screenW - 337) / 2, (screenH - 238) / 2, 337, 238, "# Jail Information", false) guiWindowSetMovable(jailWnd, false) guiWindowSetSizable(jailWnd, false) guiSetAlpha(jailWnd, 1.00) tList = guiCreateGridList(23, 24, 140, 151, false, jailWnd) guiGridListAddColumn(tList, "# Time", 0.9) jList = guiCreateGridList(175, 24, 138, 152, false, jailWnd) guiGridListAddColumn(jList, "# Places", 0.9) jailButton = guiCreateButton(23, 186, 138, 32, "Jail Player", false, jailWnd) guiSetProperty(jailButton, "NormalTextColour", "FFAAAAAA") JailClose = guiCreateButton(175, 186, 138, 32, "Close", false, jailWnd) guiSetProperty(JailClose, "NormalTextColour", "FFAAAAAA") guiSetVisible(jailWnd,false) بدله بدل من سطر رقم 1 لين سطر58 Link to comment
iMr.WiFi..! Posted April 5, 2016 Share Posted April 5, 2016 (edited) طيب جرب wnd = guiCreateWindow(458, 273, 447, 499, "Police Manager Panel | لوحة رئيس الشرطة", false) guiWindowSetSizable(wnd, false) guiWindowSetMovable(wnd, false) guiSetAlpha(wnd, 1.00) pList = guiCreateGridList(17, 25, 202, 452, false, wnd) guiGridListAddColumn(pList, "# Players List", 0.9) slapbtn = guiCreateButton(226, 30, 193, 36, "~# Slap #~", false, wnd) guiSetProperty(slapbtn, "NormalTextColour", "FFFF1D1D") desbtn = guiCreateButton(226, 76, 193, 36, "~# Destroy Car #~", false, wnd) guiSetProperty(desbtn, "NormalTextColour", "FFFF1D1D") gvbtn = guiCreateButton(226, 118, 193, 36, "~# Give License #~", false, wnd) guiSetProperty(gvbtn, "NormalTextColour", "FF1BFF03") tkbtn = guiCreateButton(226, 164, 193, 36, "~# Take License #~", false, wnd) guiSetProperty(tkbtn, "NormalTextColour", "FFFF0202") jailOpen = guiCreateButton(226, 215, 193, 36, "~# Jail Player #~", false, wnd) guiSetProperty(jailOpen, "NormalTextColour", "FFFF0202") unbtn = guiCreateButton(226, 266, 193, 36, "~# UnJail Player #~", false, wnd) guiSetProperty(unbtn, "NormalTextColour", "FF1BFF03") enbtn = guiCreateButton(226, 316, 193, 36, "~# English #~", false, wnd) guiSetProperty(enbtn, "NormalTextColour", "FF02B4FF") arbtn = guiCreateButton(226, 367, 193, 36, "~# Arabic #~", false, wnd) guiSetProperty(arbtn, "NormalTextColour", "FF02B4FF") Close = guiCreateButton(226, 413, 193, 36, "~# Close #~", false, wnd) guiSetProperty(Close, "NormalTextColour", "FFFFAE01") VersionLabel = guiCreateLabel(226, 457, 193, 15, "# Police Manager Panal | V1.5.2", false, wnd) guiLabelSetColor(VersionLabel, 255, 82, 29) label2 = guiCreateLabel(227, 474, 193, 15, "# Created By | Sha[D]ow & mIDO", false, wnd) guiLabelSetColor(label2, 45, 255, 29) guiSetVisible(wnd,false) -------------------------------------------------------------- local screenW, screenH = guiGetScreenSize() jailWnd = guiCreateWindow((screenW - 337) / 2, (screenH - 238) / 2, 337, 238, "# Jail Information", false) guiWindowSetMovable(jailWnd, false) guiWindowSetSizable(jailWnd, false) guiSetAlpha(jailWnd, 1.00) tList = guiCreateGridList(23, 24, 140, 151, false, jailWnd) guiGridListAddColumn(tList, "# Time", 0.9) jList = guiCreateGridList(175, 24, 138, 152, false, jailWnd) guiGridListAddColumn(jList, "# Places", 0.9) jailButton = guiCreateButton(23, 186, 138, 32, "Jail Player", false, jailWnd) guiSetProperty(jailButton, "NormalTextColour", "FFAAAAAA") JailClose = guiCreateButton(175, 186, 138, 32, "Close", false, jailWnd) guiSetProperty(JailClose, "NormalTextColour", "FFAAAAAA") guiSetVisible(jailWnd,false) -------------------------------------------------------------- bindKey ("m","down", function () triggerServerEvent ("check",localPlayer) end) addEvent ("openWND",true) addEventHandler ("openWND",root, function () guiSetVisible(wnd,not guiGetVisible(wnd)) showCursor(guiGetVisible(wnd)) guiSetInputEnabled (guiGetVisible(wnd)) end ) -------------------------------------------------------------- addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == jailOpen ) then guiSetVisible(wnd,false) guiSetVisible(jailWnd,true) end end ) -------------------------------------------------------------- addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == JailClose ) then guiSetVisible(jailWnd,false) guiSetInputEnabled (false) showCursor(false) end end ) -------------------------------------------------------------- addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == Close ) then guiSetVisible(wnd,false) guiSetInputEnabled (false) showCursor(false) end end ) -------------------------------------------------------------- function update () guiGridListClear(pList) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (pList) guiGridListSetItemText (pList,rp,1,getPlayerName(v),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) -------------------------------------------------------------- -------------------------------------------------------------- addEventHandler("onClientGUIClick",tkbtn,function ( ) sel = guiGridListGetSelectedItem( pList ) if sel ~= -1 then triggerServerEvent ("takecar", localPlayer,getPlayerFromName (guiGridListGetItemText(pList ,sel,1))) end end,false) ^^ Edit Edited April 5, 2016 by Guest Link to comment
#|_oskar_|# Posted April 5, 2016 Share Posted April 5, 2016 addEventHandler("onClientGUIClick",root, function ( ) local sel = guiGridListGetSelectedItem( pList ) if source == tkbtn and sel ~= -1 then local plr = guiGridListGetItemText(pList ,sel,1) local myPlayer = getPlayerFromName ( plr ) triggerServerEvent ("takecar", localPlayer, myPlayer) end end end ) جرب Edit * فى اند زايده + جرب addEventHandler("onClientGUIClick",tkbtn,function ( ) sel = guiGridListGetSelectedItem( pList ) if sel ~= -1 then triggerServerEvent ("takecar", localPlayer,getPlayerFromName (guiGridListGetItemText(pList ,sel,1))) end end,false) Link to comment
#|_oskar_|# Posted April 5, 2016 Share Posted April 5, 2016 شكراً ع تعديل ^^ العفو كلنا بنغلط 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