H25 Posted August 17, 2015 Share Posted August 17, 2015 addEventHandler("onClientGUIClick", root, function () local Row = guiGridListGetSelectedItem(gr) if (source == GUIEditor.button[1]) then if (Row ~= -1) then local selected = guiGridListGetItemText(gr, Row, 1) if getPlayerTeam(localPlayer) and getTeamName(getPlayerTeam(localPlayer)) == selected then local x, y, z = unpack(guiGridListGetItemData(gr, Row, 1)) setElementPosition(localPlayer, x, y, z) guiSetVisible(wnd, false) showCursor(false) guiSetInputEnabled(false) end end end end ) Link to comment
khaledmhammed Posted August 17, 2015 Author Share Posted August 17, 2015 اخوي حسين الحين صار لا ضغطت الزر وانت بتيم ينقلك ع طول انا ابي لا حدد على بوليس بالقريد وضغطت انتقال لا مات ينقله ابيه لا مات ينقلة Link to comment
H25 Posted August 17, 2015 Share Posted August 17, 2015 (edited) Teams = { ["Police"] = {1154.412109375, -639.7060546875, 104.15550231934 }; ["Army"] = {1236.359375, -619.701171875, 103.74805450439 }; } GUIEditor = { gridlist = {}, button = {} } wnd = guiCreateWindow(324, 140, 394, 514, "الآنتقالات", false) guiWindowSetSizable(wnd, false) guiSetVisible ( wnd, false ) GUIEditor.button[1] = guiCreateButton(64, 439, 244, 65, "انتقال", false, wnd) guiSetProperty(GUIEditor.button[1],"NormalTextColour", "FF00FF00") gr = guiCreateGridList(30, 72, 324, 363, false, wnd) guiGridListSetSelectionMode(gr,1) guiGridListAddColumn(gr, "المكان", 0.9) function OpenWin() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor( false ) else guiSetVisible ( wnd, true ) showCursor( true ) end end bindKey("F6", "down", OpenWin) for k,v in pairs(Teams) do local row = guiGridListAddRow(gr) guiGridListSetItemText(gr,row,1, k,false,false) guiGridListSetItemData(gr,row,1,{v[1],v[2],v[3]}) end addEventHandler("onClientGUIClick", root, function () local Row = guiGridListGetSelectedItem(gr) if (source == GUIEditor.button[1]) then if (Row ~= -1) then local selected = guiGridListGetItemText(gr, Row, 1) if getPlayerTeam(localPlayer) and getTeamName(getPlayerTeam(localPlayer)) == selected then local x, y, z = unpack(guiGridListGetItemData(gr, Row, 1)) setElementPosition(localPlayer, x, y, z) guiSetVisible(wnd, false) showCursor(false) guiSetInputEnabled(false) end end end end ) addEventHandler("onClientPlayerWasted", root, function ( ) if getPlayerTeam(localPlayer) then local x, y, z = unpack(Teams[getTeamName(getPlayerTeam(localPlayer))]) triggerServerEvent("spawn", localPlayer, x, y, z) end end ) -- Server Side addEvent ( "spawn", true ) addEventHandler ( "spawn", root, function (x, y, z) setTimer(spawnPlayer, 6000, 1, source, x, y, z) end ) Edited August 17, 2015 by Guest Link to comment
khaledmhammed Posted August 17, 2015 Author Share Posted August 17, 2015 الحين القريد فتح بس فاضي مافيه خيارات بوليس و ارمي : ) Link to comment
H25 Posted August 17, 2015 Share Posted August 17, 2015 الحين القريد فتح بس فاضي مافيه خيارات بوليس و ارمي : ) عدلته جرب الحين Link to comment
khaledmhammed Posted August 17, 2015 Author Share Posted August 17, 2015 حسين الكود تمام بس هو لو الاعب بتيم وحدد على القريد لاست وضغط انتقال ينقله ع طول انا ابيه لا ضغط انتقال ماينقله اذا مات ينقله على احداث التيم اللي حددة لو هو بالقريد Link to comment
H25 Posted August 17, 2015 Share Posted August 17, 2015 حسين الكود تمام بس هو لو الاعب بتيم وحدد على القريد لاست وضغط انتقال ينقله ع طولانا ابيه لا ضغط انتقال ماينقله اذا مات ينقله على احداث التيم اللي حددة لو هو بالقريد وضح الي تبيه بالضبط تبيه اذا حدد على تيم وضغط الزر ينقله لاحداثيات التيم اذا مات ؟ Link to comment
khaledmhammed Posted August 17, 2015 Author Share Posted August 17, 2015 حسين الكود تمام بس هو لو الاعب بتيم وحدد على القريد لاست وضغط انتقال ينقله ع طولانا ابيه لا ضغط انتقال ماينقله اذا مات ينقله على احداث التيم اللي حددة لو هو بالقريد وضح الي تبيه بالضبط تبيه اذا حدد على تيم وضغط الزر ينقله لاحداثيات التيم اذا مات ؟ اي لو حدد على التيم وضغط الزر يتاكد لو هو بالتيم اللي حدد عليه ينقله بعد مايموت ولو مو بالتيم اللي حدد عليه ماينقله وشكراا لككك Link to comment
H25 Posted August 17, 2015 Share Posted August 17, 2015 Teams = { ["Police"] = {1154.412109375, -639.7060546875, 104.15550231934 }; ["Army"] = {1236.359375, -619.701171875, 103.74805450439 }; } GUIEditor = { gridlist = {}, button = {} } wnd = guiCreateWindow(324, 140, 394, 514, "الآنتقالات", false) guiWindowSetSizable(wnd, false) guiSetVisible ( wnd, false ) GUIEditor.button[1] = guiCreateButton(64, 439, 244, 65, "انتقال", false, wnd) guiSetProperty(GUIEditor.button[1],"NormalTextColour", "FF00FF00") gr = guiCreateGridList(30, 72, 324, 363, false, wnd) guiGridListSetSelectionMode(gr,1) guiGridListAddColumn(gr, "المكان", 0.9) function OpenWin() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor( false ) else guiSetVisible ( wnd, true ) showCursor( true ) end end bindKey("F6", "down", OpenWin) for k,v in pairs(Teams) do local row = guiGridListAddRow(gr) guiGridListSetItemText(gr,row,1, k,false,false) guiGridListSetItemData(gr,row,1,{v[1],v[2],v[3]}) end addEventHandler("onClientGUIClick", root, function () local Row = guiGridListGetSelectedItem(gr) if (source == GUIEditor.button[1]) then if (Row ~= -1) then local selected = guiGridListGetItemText(gr, Row, 1) if getPlayerTeam(localPlayer) and getTeamName(getPlayerTeam(localPlayer)) == selected then --local x, y, z = unpack(guiGridListGetItemData(gr, Row, 1)) --setElementPosition(localPlayer, x, y, z) addEventHandler("onClientPlayerWasted", root, spawnOnWasted) guiSetVisible(wnd, false) showCursor(false) guiSetInputEnabled(false) end end end end ) function spawnOnWasted( ) if getPlayerTeam(localPlayer) then local x, y, z = unpack(Teams[getTeamName(getPlayerTeam(localPlayer))]) triggerServerEvent("spawn", localPlayer, x, y, z) removeEventHandler("onClientPlayerWasted", root, spawnOnWasted) end end -- Server Side addEvent ( "spawn", true ) addEventHandler ( "spawn", root, function (x, y, z) setTimer(spawnPlayer, 6000, 1, source, x, y, z) end ) Link to comment
khaledmhammed Posted August 17, 2015 Author Share Posted August 17, 2015 يطلع خطاء بسطر 49 كلنت وماينقل لا متت Link to comment
H25 Posted August 17, 2015 Share Posted August 17, 2015 يطلع خطاء بسطر 49 كلنت وماينقل لا متت شنو الخطأ ؟؟ Link to comment
khaledmhammed Posted August 17, 2015 Author Share Posted August 17, 2015 يطلع خطاء بسطر 49 كلنت وماينقل لا متت شنو الخطأ ؟؟ الخطاء يطلع هنا toiggered server side spawn but event is not added server side Link to comment
H25 Posted August 17, 2015 Share Posted August 17, 2015 Teams = { ["Police"] = {1154.412109375, -639.7060546875, 104.15550231934 }; ["Army"] = {1236.359375, -619.701171875, 103.74805450439 }; } GUIEditor = { gridlist = {}, button = {} } wnd = guiCreateWindow(324, 140, 394, 514, "الآنتقالات", false) guiWindowSetSizable(wnd, false) guiSetVisible ( wnd, false ) GUIEditor.button[1] = guiCreateButton(64, 439, 244, 65, "انتقال", false, wnd) guiSetProperty(GUIEditor.button[1],"NormalTextColour", "FF00FF00") gr = guiCreateGridList(30, 72, 324, 363, false, wnd) guiGridListSetSelectionMode(gr,1) guiGridListAddColumn(gr, "المكان", 0.9) function OpenWin() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor( false ) else guiSetVisible ( wnd, true ) showCursor( true ) end end bindKey("F6", "down", OpenWin) for k,v in pairs(Teams) do local row = guiGridListAddRow(gr) guiGridListSetItemText(gr,row,1, k,false,false) guiGridListSetItemData(gr,row,1,{v[1],v[2],v[3]}) end addEventHandler("onClientGUIClick", root, function () local Row = guiGridListGetSelectedItem(gr) if (source == GUIEditor.button[1]) then if (Row ~= -1) then local selected = guiGridListGetItemText(gr, Row, 1) if getPlayerTeam(localPlayer) and getTeamName(getPlayerTeam(localPlayer)) == selected then --local x, y, z = unpack(guiGridListGetItemData(gr, Row, 1)) --setElementPosition(localPlayer, x, y, z) addEventHandler("onClientPlayerWasted", localPlayer, spawnOnWasted) guiSetVisible(wnd, false) showCursor(false) guiSetInputEnabled(false) end end end end ) function spawnOnWasted( ) if getPlayerTeam(localPlayer) then local x, y, z = unpack(Teams[getTeamName(getPlayerTeam(localPlayer))]) triggerServerEvent("spawn", localPlayer, x, y, z) removeEventHandler("onClientPlayerWasted", root, spawnOnWasted) end end -- Server Side addEvent ( "spawn", true ) addEventHandler ( "spawn", root, function (x, y, z) setTimer(spawnPlayer, 6000, 1, source, x, y, z) end ) + تأكد انك ضفت حدث الترايقر في السيرفر Link to comment
khaledmhammed Posted August 17, 2015 Author Share Posted August 17, 2015 نفس الخطاء ذي الاكواد Teams = { ["Police"] = {1154.412109375, -639.7060546875, 104.15550231934 }; ["Army"] = {1236.359375, -619.701171875, 103.74805450439 }; } GUIEditor = { gridlist = {}, button = {} } wnd = guiCreateWindow(324, 140, 394, 514, "الآنتقالات", false) guiWindowSetSizable(wnd, false) guiSetVisible ( wnd, false ) GUIEditor.button[1] = guiCreateButton(64, 439, 244, 65, "انتقال", false, wnd) guiSetProperty(GUIEditor.button[1],"NormalTextColour", "FF00FF00") gr = guiCreateGridList(30, 72, 324, 363, false, wnd) guiGridListSetSelectionMode(gr,1) guiGridListAddColumn(gr, "المكان", 0.9) function OpenWin() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor( false ) else guiSetVisible ( wnd, true ) showCursor( true ) end end bindKey("F6", "down", OpenWin) for k,v in pairs(Teams) do local row = guiGridListAddRow(gr) guiGridListSetItemText(gr,row,1, k,false,false) guiGridListSetItemData(gr,row,1,{v[1],v[2],v[3]}) end addEventHandler("onClientGUIClick", root, function () local Row = guiGridListGetSelectedItem(gr) if (source == GUIEditor.button[1]) then if (Row ~= -1) then local selected = guiGridListGetItemText(gr, Row, 1) if getPlayerTeam(localPlayer) and getTeamName(getPlayerTeam(localPlayer)) == selected then --local x, y, z = unpack(guiGridListGetItemData(gr, Row, 1)) --setElementPosition(localPlayer, x, y, z) addEventHandler("onClientPlayerWasted", localPlayer, spawnOnWasted) guiSetVisible(wnd, false) showCursor(false) guiSetInputEnabled(false) end end end end ) function spawnOnWasted( ) if getPlayerTeam(localPlayer) then local x, y, z = unpack(Teams[getTeamName(getPlayerTeam(localPlayer))]) triggerServerEvent("spawn", localPlayer, x, y, z) removeEventHandler("onClientPlayerWasted", root, spawnOnWasted) end end addEvent ( "spawn", true ) addEventHandler ( "spawn", root, function (x, y, z) setTimer(spawnPlayer, 6000, 1, source, x, y, z) end ) Link to comment
H25 Posted August 17, 2015 Share Posted August 17, 2015 Teams = { ["Police"] = {1154.412109375, -639.7060546875, 104.15550231934 }; ["Army"] = {1236.359375, -619.701171875, 103.74805450439 }; } GUIEditor = { gridlist = {}, button = {} } wnd = guiCreateWindow(324, 140, 394, 514, "الآنتقالات", false) guiWindowSetSizable(wnd, false) guiSetVisible ( wnd, false ) GUIEditor.button[1] = guiCreateButton(64, 439, 244, 65, "انتقال", false, wnd) guiSetProperty(GUIEditor.button[1],"NormalTextColour", "FF00FF00") gr = guiCreateGridList(30, 72, 324, 363, false, wnd) guiGridListSetSelectionMode(gr,1) guiGridListAddColumn(gr, "المكان", 0.9) function OpenWin() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor( false ) else guiSetVisible ( wnd, true ) showCursor( true ) end end bindKey("F6", "down", OpenWin) for k,v in pairs(Teams) do local row = guiGridListAddRow(gr) guiGridListSetItemText(gr,row,1, k,false,false) guiGridListSetItemData(gr,row,1,{v[1],v[2],v[3]}) end local SpawnState = false addEventHandler("onClientGUIClick", root, function () local Row = guiGridListGetSelectedItem(gr) if (source == GUIEditor.button[1]) then if (Row ~= -1) then local selected = guiGridListGetItemText(gr, Row, 1) if getPlayerTeam(localPlayer) and getTeamName(getPlayerTeam(localPlayer)) == selected then --local x, y, z = unpack(guiGridListGetItemData(gr, Row, 1)) --setElementPosition(localPlayer, x, y, z) SpawnState = true guiSetVisible(wnd, false) showCursor(false) guiSetInputEnabled(false) end end end end ) function spawnOnWasted( ) if SpawnState == false then return end if getPlayerTeam(localPlayer) then local x, y, z = unpack(Teams[getTeamName(getPlayerTeam(localPlayer))]) triggerServerEvent("spawn", localPlayer, x, y, z) SpawnState = false end end addEventHandler("onClientPlayerWasted", root, spawnOnWasted) -- Server Side addEvent ( "spawn", true ) addEventHandler ( "spawn", root, function (x, y, z) setTimer(spawnPlayer, 6000, 1, source, x, y, z) end ) Link to comment
khaledmhammed Posted August 17, 2015 Author Share Posted August 17, 2015 يعطيكك الف الف الف عافية حسين ماقصرت ضبط الكود وحلو ي حلو معليش كان عندي غلط ب الميتا ولسه تاكدت , انت كفو اشكركك وكل اللي ماقصرو يعطيكم العافية 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