Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Data : Name : Ati , 2017.06.21, 0:18
- local dbName = "test"
- local host = "localhost"
- local username = "root"
- local password = ""
- local dbConnection = dbConnect( "mysql", "dbname="..dbName..";host="..host, username, password)
- local contact = {{}}
- local picsa = contact
- function create_marker(player,commandName,types,x,y,z)
- local types = tonumber(types)
- if types then
- outputChatBox("Lerakva")
- local Px,Py,Pz = getElementPosition(player)
- local find_table = dbQuery( dbConnection, "SELECT * FROM interior" )
- local hit = dbPoll( find_table, -1 )
- if hit then
- local set_marker_data = dbExec(dbConnection, "INSERT INTO interior SET x = ?, y = ?, z = ?, type = ?", Px, Py, Pz, types)
- end
- else
- outputChatBox("/add_interior [típus]")
- end
- end
- addCommandHandler("add_interior",create_marker)
- -- function name ()
- -- local find_table = dbQuery( dbConnection, "SELECT * FROM interior" )
- -- local hit = dbPoll( find_table, -1 )
- -- end
- function get_marker(player,commandName,x,y,z)
- local find_table = dbQuery( dbConnection, "SELECT * FROM interior" )
- local hit = dbPoll( find_table, -1 )
- local X,Y,Z,ID,T
- if hit then
- for k,v in pairs(hit) do
- --local get_marker_data = dbExec(dbConnection,"SELECT * FROM interior WHERE x=?", x )
- if v["x"] and v["y"] and v["z"] and v["id"] and v["type"]then
- ID = v["id"]
- X = v["x"]
- Y = v["y"]
- Z = v["z"]
- T = v["type"]
- -- outputChatBox(ID..": "..X..","..Y..","..Z)
- end
- contact[k] = createMarker(X,Y,Z, "cylinder", 1,244,20,20,140)
- end
- end
- end
- addCommandHandler("get_I",get_marker)
- function remove_interior(player,commandName,ID)
- local find_table = dbQuery( dbConnection, "SELECT * FROM interior " )
- local hit = dbPoll( find_table, -1 )
- local ID = tonumber(ID)
- if ID then
- for k,v in pairs(hit) do
- if ID == v["id"] then
- remove_int = dbExec(dbConnection,"DELETE FROM interior WHERE id = '"..ID.."'")
- end
- end
- else
- outputChatBox("/remove_I [ID]")
- end
- end
- addCommandHandler("remove_I", remove_interior)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement