Jump to content

justn

Members
  • Posts

    525
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by justn

  1. -- Replace an MTA Object with your custom interior model using these engineLoadDFF engineReplaceModel engineLoadCOL engineReplaceCOL engineLoadTXD engineImportTXD -- Create the model using createObject -- Set the object to an interior using setElementInterior Where you warp depends on where you create it
  2. He's saying there was no reason to use 'getPedOccupiedVehicleSeat' as the seat is already provided , so checking for the player's seat is completely pointless. This would be your new code. function checkCarJack(thePlayer, seat, jacked) if ( jacked ) and ( seat == 0 ) then outputChatBox("[!] #f0f0f0CarJack atmanız yasaklanmıştır!", thePlayer, 255, 0, 0, true) cancelEvent() end end addEventHandler("onVehicleStartEnter", getRootElement(), checkCarJack)
  3. justn

    Gta map to MTA

    https://www.upload.ee/files/10104663/Hakone.zip.html There you go
  4. local spawnDelayTime = 120000 -- delay time in ms local spawnTimer = { } function carSpawn () if isTimer(spawnTimer[source]) then local timeleft = math.ceil( getTimerDetails(spawnTimer[source])/1000 ) -- Get seconds left from timer if timeleft then local secondString = " second" if timeleft > 1 then secondString = " seconds" end outputChatBox("You may spawn your vehicle again in "..tostring(timeleft)..secondString) return false end else if not (isGuestAccount (getPlayerAccount (source))) and not (isPedInVehicle(source)) then spawnTimer[source] = setTimer(function(source) spawnTimer[source] = false end,spawnDelayTime,1,source) end end end
  5. I'd suggest using element data. And store it however you feel like
  6. addEventHandler ( "onClientRender", root, theFunction)
  7. 1- For data saving on objects I'd suggest using SQLite(or MySQL) 2- You could use tables.
  8. Basically: --Client local newElement = createMarker(0,0,0,"cylinder",1,255,255,255,255) if ( newElement ) then setElementData(newElement, "meat", (getElementData(newElement, "meat") or 0) + 10) end As long as this is client-sided it should work as intended.
  9. addEventHandler("onDgsMouseClick", root, function(btn,state) local sw, sh = guiGetScreenSize() local px, py = sw/1920,sh/1080 local myfontt = DGS:dgsCreateFont( "fonts/Roboto-Medium.ttf", 9 ) if ( state == "down" ) then if source == buttont then if (DGS:dgsCheckBoxGetSelected(v11) ~= true) and (DGS:dgsCheckBoxGetSelected(v12) ~= true) and (DGS:dgsCheckBoxGetSelected(v13) ~= true) and (DGS:dgsCheckBoxGetSelected(v14) ~= true) then vibot1 = DGS:dgsCreateLabel(210,130,20,40,"Choose Answer!",false,vopros1) DGS:dgsLabelSetColor ( vibot1, tocolor(255, 0, 0, 255 ) ,true ) DGS:dgsSetFont(vibot1,myfontt) playSoundFrontEnd ( 4 ) else
  10. 'client' isn't defined in the function with the timer. addEvent("getTicket",true) addEventHandler("getTicket", root, function() setElementInterior(client, 1) setElementPosition(client, 1.76953125 ,28.478515625 ,1199.59375) outputChatBox("#00ff00You are now in air plane!", client, 255, 255, 255, true) setTimer( function(client) setElementInterior(client, 0) setElementPosition(client, 1685.8193359375 ,-2237.5400390625 ,13.546875) outputChatBox("#00ff00Welcome To Los Santos!", client, 255, 255, 255, true) end , 60000, 1 ,client) end)
  11. justn

    [help] example

    https://wiki.multitheftauto.com/wiki/Main_Page Tons there
  12. This is what you want local startbus = createMarker ( 2184.10229, -1451.73291, 25.55586, "cylinder",1.0,254,239,0,255 ) if ( startbus ) then local startbusblip = createBlipAttachedTo ( startbus , 46, 2, 255, 0, 0, 255, 0, 16383) end function startjobbus() if ( not bus ) then bus = createVehicle ( 431, 2180.24292, -1460.47717, 25.53906 ) if ( bus ) then warpPedIntoVehicle ( localPlayer, bus ) end end end addEventHandler( "onClientMarkerHit", startbus, startjobbus )
  13. https://wiki.multitheftauto.com/wiki/GuiComboBoxGetSelected https://wiki.multitheftauto.com/wiki/GuiComboBoxGetItemText
  14. Basically the main things you need.. https://wiki.multitheftauto.com/wiki/TriggerServerEvent https://wiki.multitheftauto.com/wiki/TriggerClientEvent https://wiki.multitheftauto.com/wiki/PlaySound
  15. You pretty much wanna do something like this. function testImage() dxDrawImage(0,0,50,50,"image.png") end function createOnClick ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( clickedElement ) then addEventHandler("onClientRender",root,testImage) end end addEventHandler ( "onClientClick", getRootElement(), createOnClick )
  16. justn

    setTimer

    Place that code into the event where the first button is clicked (make sure you put it after checking if the button clicked is the button you're looking for)
  17. Oops, this is what you want here. if source == bv2 then if ( DGS:dgsCheckBoxGetSelected(v12) == true ) and ( DGS:dgsCheckBoxGetSelected(v14) == true ) then window5 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"+",false) elseif ( DGS:dgsCheckBoxGetSelected(v12) ~= true ) and ( DGS:dgsCheckBoxGetSelected(v14) ~= true )then window6 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"-",false) end end
  18. if source == bv2 then if DGS:dgsCheckBoxGetSelected(v12,true) and DGS:dgsCheckBoxGetSelected(v14,true) then window5 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"+",false) elseif DGS:dgsCheckBoxGetSelected(v12,false) and DGS:dgsCheckBoxGetSelected(v14,false) then window6 = DGS:dgsCreateWindow((sw-424)/2,(sh-363)/2,400,200,"-",false) end end
  19. Oops! Forgot to replace something that I changed in your code leading to me checking a variable that didn't exist. I edited my code, try it now.
  20. Use that as a replacement of the code in your server file where your 'onPlayerLogin' and 'onResourceStart' events triggers
  21. function setFactionOnLogin() local faction, player_rank = getPlayerFaction(source) local data = getFactionData(faction) if faction and player_rank then for rank,kk in pairs(clanRankNames) do if ( rank == player_rank ) then local GangRank = clanRankNames[rank] setElementData(source,"faction",faction) setElementData(source,"GangRank",GangRank) if getTeamFromName (faction) then setPlayerTeam(source,getTeamFromName (faction)) else local team = createTeam(faction,unpack(data["Color"])) setPlayerTeam(source,team) end local oldName = getPlayerName(source) local newName = "["..faction.."]"..oldName setPlayerName(source, newName ) if data["X"] ~= 0 and data["Y"] ~= 0 and data["Z"] ~= 0 then setElementPosition(source,data["X"],data["Y"],data["Z"]+0.2) end break end end end end addEventHandler("onPlayerLogin",root,setFactionOnLogin) function setFactionOnStart() exports.scoreboard:addScoreboardColumn("GangRank") for i, v in ipairs (getElementsByType ("player")) do local acc = getPlayerAccount (v) if not isGuestAccount (acc) then local faction, player_rank = getPlayerFaction(v) local data = getFactionData(faction) if faction and player_rank then for rank,kk in pairs(clanRankNames) do if ( rank == player_rank ) then local GangRank = clanRankNames[rank] setElementData(v,"faction",faction) setElementData(v,"GangRank",GangRank) if getTeamFromName (faction) then setPlayerTeam(v,getTeamFromName (faction)) else local team = createTeam(faction,unpack(data["Color"])) setPlayerTeam(v,team) end local oldName = getPlayerName(v) local newName = "["..faction.."]"..oldName setPlayerName(v, newName ) if data["X"] ~= 0 and data["Y"] ~= 0 and data["Z"] ~= 0 then setElementPosition(v,data["X"],data["Y"],data["Z"]+0.2) end break end end end end end end addEventHandler("onResourceStart",resourceRoot,setFactionOnStart)
  22. Basically you want.. local function outputTeamChatToAdmins(plr,msg) for i,admin in ipairs(getElementsByType("player")) do local plr_teamName = getTeamName(getPlayerTeam(plr)) local accName = getAccountName(getPlayerAccount(admin)) if ( accName ) then if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "LathatatlanAdmin" ) ) then outputChatBox("#00FF01[Csoport chat - "..plr_teamName.."] ".. string.format("#%02X%02X%02X", getPlayerNametagColor(plr)) ..""..getPlayerName(plr).."#73FF73: "..msg, admin, 255,255,255, true ) end end end end local function playerTeamChat(message, messageType) if ( messageType == 2 ) then outputTeamChatToAdmins(source,message) end end addEventHandler("onPlayerChat", root, playerTeamChat)
  23. No big problem, just some spaces in the code wasn't making it start, removed them for you. Also added in a simple one-liner so the gui isn't showing when the client downloads the file. Here you go. function cancelPedDamage ( attacker ) cancelEvent() -- cancel any damage done to peds end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage) GUIEditor = { checkbox = {}, memo = {} } local screenW, screenH = guiGetScreenSize() windowStart = guiCreateWindow((screenW - 441) / 2, (screenH - 317) / 2, 441, 317, "Handlarz bronią", false) guiSetVisible(windowStart,false) guiWindowSetSizable(windowStart, false) guiSetAlpha(windowStart, 0.72) textAk47 = guiCreateEdit(10, 32, 255, 19, "AK-47 | 10, 000$", false, windowStart) buyAk47 = guiCreateButton(283, 31, 148, 20, "Zakup", false, windowStart) textM231 = guiCreateEdit(9, 60, 256, 20, "Karabin M231 FPW | 15, 000$", false, windowStart) buyM231 = guiCreateButton(283, 62, 148, 18, "Zakup", false, windowStart) leaveButton = guiCreateButton(75, 292, 291, 15, "Wyjdz", false, windowStart) markerCreate = createMarker(-369.2470703125, 1202.2958984375, 19.7421875, "cylinder", 1) function guiStart() guiSetVisible(windowStart, true) guiSetVisible(textAk47, true) guiSetVisible(buyAk47, true) guiSetVisible(textM231, true) guiSetVisible(buyM231, true) guiSetVisible(leaveButton, true) showCursor(true) end addEventHandler("onClientMarkerHit", markerCreate, guiStart) function guiStop(btn,state) if ( source == leaveButton ) then -- If the player presses the 'leaveButton' guiSetVisible(windowStart, false) guiSetVisible(textAk47, false) guiSetVisible(buyAk47, false) guiSetVisible(textM231, false) guiSetVisible(buyM231, false) guiSetVisible(leaveButton, false) showCursor(false) elseif ( source == buyAk47 ) then -- If the player presses the 'buyAk47' button triggerServerEvent("onBuyAK47",localPlayer) end end addEventHandler("onClientGUIClick", root, guiStop)
  24. Client: function cancelPedDamage ( attacker ) cancelEvent() -- cancel any damage done to peds end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage) GUIEditor = { checkbox = {}, memo = {} } local screenW, screenH = guiGetScreenSize() windowStart = guiCreateWindow((screenW - 441) / 2, (screenH - 317) / 2, 441, 317, "Handlarz bronią", false) guiWindowSetSizable(windowStart, false) guiSetAlpha(windowStart, 0.72) textAk47 = guiCreateEdit(10, 32, 255, 19, "AK-47 | 10, 000$", false, windowStart) buyAk47 = guiCreateButton(283, 31, 148, 20, "Zakup", false, windowStart) textM231 = guiCreateEdit(9, 60, 256, 20, "Karabin M231 FPW | 15, 000$", false, windowStart) buyM231 = guiCreateButton(283, 62, 148, 18, "Zakup", false, windowStart) leaveButton = guiCreateButton(75, 292, 291, 15, "Wyjdz", false, windowStart) markerCreate = createMarker(-369.2470703125, 1202.2958984375, 19.7421875, "cylinder", 1) function guiStart() guiSetVisible(windowStart, true) guiSetVisible(textAk47, true) guiSetVisible(buyAk47, true) guiSetVisible(textM231, true) guiSetVisible(buyM231, true) guiSetVisible(leaveButton, true) showCursor(true) end addEventHandler("onClientMarkerHit", markerCreate, guiStart) function guiStop(btn,state) if ( source == leaveButton ) then -- If the player presses the 'leaveButton' guiSetVisible(windowStart, false) guiSetVisible(textAk47, false) guiSetVisible(buyAk47, false) guiSetVisible(textM231, false) guiSetVisible(buyM231, false) guiSetVisible(leaveButton, false) showCursor(false) elseif ( source == buyAk47 ) then -- If the player presses the 'buyAk47' button triggerServerEvent("onBuyAK47",localPlayer) end end addEventHandler("onClientGUIClick", root, guiStop) Server: function buyAkPlayer() takePlayerMoney(client, 10000) giveWeapon(client, 30, 80) outputChatBox("Otrzymales AK47",client) end addEvent("onBuyAK47",true) addEventHandler("onBuyAK47",root,buyAkPlayer)
×
×
  • Create New...