Jump to content

justn

Members
  • Posts

    527
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by justn

  1. Feel free to PM me with contact information(preferably Discord) and we can discuss this.
  2. I don't get it. you have all the information you need right there for saving/receiving data to/from an account. what do you mean exactly? Provide more details
  3. -- 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
  4. 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)
  5. justn

    Gta map to MTA

    https://www.upload.ee/files/10104663/Hakone.zip.html There you go
  6. 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
  7. I'd suggest using element data. And store it however you feel like
  8. addEventHandler ( "onClientRender", root, theFunction)
  9. 1- For data saving on objects I'd suggest using SQLite(or MySQL) 2- You could use tables.
  10. 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.
  11. 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
  12. '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)
  13. justn

    [help] example

    https://wiki.multitheftauto.com/wiki/Main_Page Tons there
  14. 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 )
  15. https://wiki.multitheftauto.com/wiki/GuiComboBoxGetSelected https://wiki.multitheftauto.com/wiki/GuiComboBoxGetItemText
  16. Basically the main things you need.. https://wiki.multitheftauto.com/wiki/TriggerServerEvent https://wiki.multitheftauto.com/wiki/TriggerClientEvent https://wiki.multitheftauto.com/wiki/PlaySound
  17. 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 )
  18. 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)
  19. 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
  20. 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
  21. 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.
  22. Use that as a replacement of the code in your server file where your 'onPlayerLogin' and 'onResourceStart' events triggers
  23. 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)
  24. 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)
×
×
  • Create New...