Mahlukat

Members
  • Content Count

    32
  • Joined

  • Last visited

Community Reputation

9 Neutral

3 Followers

About Mahlukat

  • Rank
    Rat

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Mahlukat

    Fake black bars on screen?

    dxDrawRectangle
  2. Mahlukat

    coroutine

    i dont understand im so confused would you create some example too please
  3. Mahlukat

    coroutine

    Thanks you for your answer When i call querydb function, its return before dbQuery's callback function and i thought maybe querydb function can wait for dbQuery's callback function because i have a another function like this; function getQueryResult(id) if not queries[id] then return false end return queries[id] end I am using exactly like this; local id = querydb("SOME DB FUNCS") local result = getQueryResult(id)
  4. Mahlukat

    coroutine

    Hey i have a export function for dbQuery but when i call func, data from database stay late I searched the forum and found a few solutions with coroutine but I could not :(( anyone can explain how's work coroutine and what should i do please function querydb(str) if str:find("DROP TABLE") then return end local id = getFreeID() local co = nil function verileriAktar(sorgu) coroutine.resume(co, sorgu) end co = coroutine.create(function() dbQuery(verileriAktar,connection,str) local results = coroutine.yield() local cevap = dbPoll(results,0) queries[id] = cevap print(id) end) coroutine.resume(co) -- should stop here i guess but its not print("cevap: "..id) return id end local id = querydb("SOME DB CODES") -- cevap: 1 -- 1
  5. Mahlukat

    [HELP] Login Texts

    can you try this? addEventHandler("onClientChatMessage", getRootElement(),function(text) if text == "login: You successfully logged in" then cancelEvent() end end)
  6. Mahlukat

    [HELP] GUI GridList

    can you try this? teams = {"Liberation Army", "Imperial Forces"} function getPos() local x, y ,z = getElementPosition(localPlayer) local pos = tostring(x..", "..y..", "..z) outputChatBox(pos, 255, 100, 100, false) setClipboard(pos) end addCommandHandler("pos", getPos) ---- GUI Creation addEventHandler("onClientResourceStart", resourceRoot, function() window = guiCreateWindow(0.57, 0.25, 0.19, 0.37, "Spawn Menu", true) guiWindowSetMovable(window, false) guiWindowSetSizable(window, false) guiSetAlpha(window, 1.00) team_gridlist = guiCreateGridList(10, 32, 284, 98, false, window) column = guiGridListAddColumn(team_gridlist, "Team", 0.9) for i,teamtext in pairs(teams) do local row = guiGridListAddRow(team_gridlist,teamtext) end -- rowA = guiGridListAddRow(team_gridlist) -- rowB = guiGridListAddRow(team_gridlist) -- guiGridListSetItemText(team_gridlist, 0, 1, "Liberation Front", false, false) -- guiGridListSetItemText(team_gridlist, 1, 1, "Imperial Forces", false, false) skin_label = guiCreateLabel(58, 248, 71, 15, "Select a skin", false, window) skin_btn_next = guiCreateButton(96, 273, 33, 16, ">", false, window) skin_btn_previous = guiCreateButton(58, 273, 33, 16, "<", false, window) location_gridlist = guiCreateGridList(10, 140, 284, 98, false, window) location_col = guiGridListAddColumn(location_gridlist, "Location", 0.9) weapon_label = guiCreateLabel(155, 248, 96, 15, "Select a weapon", false, window) weapon_btn_next = guiCreateButton(165, 273, 33, 16, ">", false, window) weapon_btn_previous = guiCreateButton(204, 273, 33, 16, "<", false, window) spawn_btn = guiCreateButton(114, 299, 67, 24, "Spawn", false, window) guiSetVisible(window, false) end ) ---- GUI functions function isGUIVisible(gui) return (guiGetVisible(gui) == true) end -- Make the GUI appear on login. addEvent("onClientPlayerLoginn", true) addEventHandler("onClientPlayerLoginn", root, function() if isGUIVisible(window) then return end guiSetVisible(window, true) -- Set the camera to the desired location. setCameraMatrix(-2610.9792480469, 1445.4840087891, 7.1875, -2610.9792480469, 1445.4840087891, 7.1875) -- Make a ped with default skin (0). local ped = createPed(0, -2614.0212402344, 1451.1651611328, 7.1875, 180) end) -- Team addEventHandler("onClientGUIClick", resourceRoot, function() if (source == spawn_btn) then local team = getSelectedTeam() if team then triggerServerEvent("setTeam", localPlayer, team) end end end) function getSelectedTeam() local row, col = guiGridListGetSelectedItem(team_gridlist) if row and col and row ~= -1 and col ~= -1 then return guiGridListGetItemText(team_gridlist, row, col) else return false end end local LALocations = {"LA Test 1", "LA Test 2", "LA Test 3"} local IFLocations = {"IF Test 1", "IF Test 2", "IF Test 3"} -- Location (according to the team) addEventHandler("onClientGUIClick", resourceRoot, function(button, state) if source == team_gridlist then local team = getSelectedTeam() if team then guiGridListClear(location_gridlist) if team == "Liberation Army" then outputChatBox("Test successful", 100, 255, 100) for _, locations_LA in ipairs(LALocations) do local location_row_LA = guiGridListAddRow(location_gridlist,locations_LA) --guiGridListSetItemText(location_gridlist, location_row_LA, location_col, locations_LA, false, false) end elseif team == "Imperial Forces" then for _, locations_IF in ipairs(IFLocations) do local location_row_IF = guiGridListAddRow(location_gridlist,locations_IF) --guiGridListSetItemText(location_gridlist, location_row_IF, location_col, locations_IF, false, false) end end end end end) -- Skin -- Weapon
  7. Mahlukat

    [Help] getPlayerFromPhoneNumber Help

    function getPlayerFromPhoneNumber(phoneNumber) local phoneNumber = tonumber(phoneNumber) for i,v in pairs(getElementsByType("player")) do local playerNumber = tonumber(getElementData(v,"YOUR_PHONE_NUMBER_DATA_HERE")) if playerNumber and playerNumber == phoneNumber then return v end end return false end try this
  8. Mahlukat

    Text

    carshopWindow = guiCreateWindow(0.01, 0.22, 0.39, 0.58, "CarShop", true) guiSetVisible(carshopWindow, false) guiSetAlpha(carshopWindow, 1) guiWindowSetSizable(carshopWindow, false) carGridList = guiCreateGridList(0.02, 0.06, 0.47, 0.80, true, carshopWindow) guiGridListSetSelectionMode(carGridList, 0) carColumn = guiGridListAddColumn(carGridList, "Car", 0.4) costColumn = guiGridListAddColumn(carGridList, "$", 0.4) local cars = { ["Level1"] = { ------------------TEXT TEX {481, 50000},-- BMX {509, 50000},-- bike {529, 55000},-- Willard {492, 60000},-- Gleenwood }, ["Level2"] = { ------------------TEXT TEX {421, 60000},-- Whasington {466, 65000},-- Glendale {422, 65000},-- Bobcat {600, 70000},-- Picador {578, 70000},-- DFT-30 {582, 70000},-- Newsvan {410, 71000},-- Manana {489, 75000},-- Rancher {474, 75000},-- Hermes {491, 75000}, -- Virgo }, } function setTexts() for i,v in pairs(cars) do local row = guiGridListAddRow(carGridList) guiGridListSetItemText(carGridList,row,1,i,true,false) for i,k in pairs(v) do local model,price = unpack(k) local row2 = guiGridListAddRow(carGridList) guiGridListSetItemText(carGridList,row2,1,getVehicleNameFromModel(model),false,false) guiGridListSetItemText(carGridList,row2,2,price,false,false) end end end setTexts()
  9. Mahlukat

    Death

    try this addEventHandler("onPlayerWasted", root, function() local x,y,z = getElementPosition(source) spawnPlayer(source,x,y,z) end
  10. Mahlukat

    [Help] onClientResourceStop

    Yea, i tried but wiki said; This event is triggered when a remote player quits the game or leaves the server. It will not get triggered on the source player's client. (Use onClientResourceStop to save client side data when the local player quits.) thanks for help but it's still not triggered :((
  11. Mahlukat

    [Help] onClientResourceStop

    Hey i want to save table in client-side when localPlayer disconnected --client addEventHandler( "onClientResourceStop", resourceRoot,function() triggerServerEvent("Freeroam:SureKaydet", localPlayer, sureVerileri, true) if sureVerileri[localPlayer] and isTimer(sureVerileri[localPlayer].timer) then killTimer(sureVerileri[localPlayer].timer) end end) --server addEvent("Freeroam:SureKaydet", true) addEventHandler("Freeroam:SureKaydet", root, function(sureVerileri,bosmu) outputServerLog("triggered server") -- i can't see this message in console local hesap = getPlayerAccount(source) if not isGuestAccount(hesap) then outputServerLog("not guest") local sure = 60*10 if sureVerileri[source] and sureVerileri[source].sure then sure = sureVerileri[source].sure end exports.Hesaplar:SAD(hesap, "KiralikSure", sure) outputServerLog("saved.") outputServerLog(sure) if bosmu then exports.Hesaplar:SAD(hesap, "KiralikSureBos", true) end end end) but event isn't triggered :(( how can ido it? -
  12. Mahlukat

    Ant-Kill

    Canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead.
  13. Mahlukat

    Help in onColShapeHit

    for disable skin changing; --server-side local yourCol = createColSphere(...) addEventHandler("onElementModelChange", root, function(oldModel,newModel) if getElementType(source) == "player" then if isElementWithinColShape(source,yourCol) then setTimer(setElementModel,50,1,source,oldModel) outputChatBox("You can't change skin in this place!",source,255,0,0) end end end)
  14. Mahlukat

    Help GetPlayerSerial

    function spamEngelle(oyuncu,deger) -- spam engelleme fonksiyon if isElement (oyuncu) then -- player check local serial = getPlayerSerial(oyuncu) if deger == "Mutele" then outputChatBox(getPlayerName(oyuncu).."#CC0000 60 #FFFFFFSaniye Susturuldun. #CC0000Sebep: #FFFFFFFlood/Spam", root, 255,255,255,true) setPlayerMuted(oyuncu, true) setTimer (spamEngelle, 60000, 1, oyuncu, "Mute Kaldır") muteliler[serial] = true elseif deger == "Mute Kaldır" then if isElement (oyuncu) and isPlayerMuted (oyuncu) then setPlayerMuted ( oyuncu, false ) antiSpam[oyuncu] = nil muteliler[serial] = false outputChatBox ("#FFFFFF"..getPlayerName ( oyuncu ).." #66FF00Cezan Bitti.",root, 255, 255, 0,true ) else antiSpam[oyuncu] = nil end end end end try this
  15. Mahlukat

    [HELP] GridList

    You can hide with other gui element like this; local backLabel = guiCreateLabel(x,y,w,h, "", relative, parent) local list = guiCreateGridList(0,0,w+15,h, false, backLabel)