Ahmed Araby Posted April 27, 2017 Share Posted April 27, 2017 انا عامل كوماند من اف 8 يضيف ماركر عاوز لو عملت ريستارت للمود الماركر يخليه Link to comment
Adham Posted April 27, 2017 Share Posted April 27, 2017 (edited) executeSQLQuery -- او dbConnect dbQuery dbPoll dbExec شرح للسجل :- Edited April 27, 2017 by Deativated Link to comment
Ahmed Araby Posted April 27, 2017 Author Share Posted April 27, 2017 (edited) 5 hours ago, Deativated said: executeSQLQuery -- او dbConnect dbQuery dbPoll dbExec شرح للسجل :- 11 hours ago, #BrosS said: SQL - database executeSQLQuery("CREATE TABLE IF NOT EXISTS Marker ( Mark, X, Y, Z )") addEventHandler( 'onResourceStop' , root , function ( res ) if res == getThisResource() then local Maere = getElementsByType ( "marker" ) for _,Mark in ipairs(Maere) do if getElementData(Mark,"Marker") == true then A = getElementData(Mark,"Size") x,y,z = getElementPosition(Mark) executeSQLQuery( 'INSERT INTO Marker ( Mark, X, Y, Z ) VALUES ( ?, ?, ?, ? )' , A, x,y,z ) end end end end) addEventHandler( 'onResourceStart' , root , function ( res ) if res == getThisResource() then row = executeSQLQuery( 'SELECT Mark, X, Y, Z FROM Marker' ) if type ( row ) == "table" and #row ~= 0 then Mark = row [1] [ 'Mark' ] X = row [1] [ 'X' ] Y = row [1] [ 'Y' ] Z = row [1] [ 'Z' ] Marker = createMarker ( X, Y, Z, "cylinder", 1.5, 255, 255, 0, 170 ) setMarkerSize(Marker,Mark) end end end ) فين الخطا ؟؟ Edited April 27, 2017 by Ahmed Araby Link to comment
Ahmed Araby Posted April 28, 2017 Author Share Posted April 28, 2017 (edited) 13 minutes ago, Abdul KariM said: سوي لوب وجيب القيم executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS TableMarkers ( X,Y,Z )' ) addEventHandler( 'onResourceStop' , root , function ( res ) for _,marker in ipairs(getElementsByType ( "marker" ) ) do if getElementData(marker,"Created") then local X,Y,Z = getElementData(marker,"X") , getElementData(marker,"Y"), getElementData(marker,"Z") local aSQL_= executeSQLQuery( 'SELECT * FROM TableMarkers ' ) return ( ( ( #aSQL_ == 0 ) and executeSQLQuery( 'INSERT INTO TableMarkers VALUES ( ?, ?, ? )' , X,Y,Z ) ) or executeSQLQuery( 'UPDATE TableMarkers SET X = ?, Y = ?, Z = ? ' , X,Y,Z ) ) end end end ) Marker = { } addEventHandler( 'onResourceStart' , root , function ( res ) if res == getThisResource() then local Table = executeSQLQuery( 'SELECT * FROM TableMarkers' ) for Index in ipairs ( Table ) do x = Table [Index] [ 'X' ] y = Table [Index] [ 'Y' ] z = Table [Index] [ 'Z' ] Marker[Marker] = createMarker ( x, y, z, "cylinder", 1, 255, 255, 0, 170 ) setElementData(Marker[Marker],"Created",true) end end end ) الغلط فين ؟ الدي بق يقول مافي كولمن اسمه فولس Edited April 28, 2017 by Ahmed Araby Link to comment
iMr.WiFi..! Posted April 28, 2017 Share Posted April 28, 2017 executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS TableMarkers ( X,Y,Z )' ) addEventHandler( 'onResourceStop' , root , function ( res ) for _,marker in ipairs(getElementsByType ( "marker" ) ) do if getElementData(marker,"Created") then local X,Y,Z = getElementPosition(marker) local aSQL_= executeSQLQuery( 'SELECT * FROM TableMarkers ' ) if ( #aSQL_ == 0 ) then executeSQLQuery( 'INSERT INTO TableMarkers VALUES ( ?, ?, ? )' , X,Y,Z ) else executeSQLQuery( 'UPDATE TableMarkers SET X = ?, Y = ?, Z = ? ' , X,Y,Z ) end end end end ) Marker = { } addEventHandler( 'onResourceStart' , root , function ( res ) if res == getThisResource() then local Table = executeSQLQuery( 'SELECT * FROM TableMarkers' ) for Index in ipairs ( Table ) do x = Table [Index] [ 'X' ] y = Table [Index] [ 'Y' ] z = Table [Index] [ 'Z' ] Marker[Marker] = createMarker ( x, y, z, "cylinder", 1, 255, 255, 0, 170 ) setElementData(Marker[Marker],"Created",true) end end end ) ^ لم تتم التجربة :_ وليش سويت داتا وجلبت فيهم الاحداثيات , وانت ماوضعت الداتا اساساً 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