Jump to content

Alpha

Members
  • Posts

    244
  • Joined

  • Last visited

Everything posted by Alpha

  1. You didn't add hitElement as an argument for moveObjectBack function. local marker1 = createMarker ( 1253.0999755859, -1399, 12, 'cylinder', 11, 222, 222, 1, 225 ) local gate1 = createObject ( 980, 1252.8000488281, -1399.0999755859, 14.800000190735, 0, 0, 90 ) function movingObject ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1413, 14.800000190735 ) end end function moveObjectBack (hitElement) if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1399.0999755859, 14.800000190735 ) end end addEventHandler ( "onMarkerHit", marker1 , movingObject ) addEventHandler ( "onMarkerLeave", marker1, moveObjectBack )
  2. https://wiki.multitheftauto.com/wiki/Element
  3. Thanks, but like I said, I'm involved with some server, so I won't be able to release it.
  4. Yes, this will connect with the SQLite database called 'file.db'.
  5. It should return a table with the players, but I don't see a problem with your code.
  6. You have 'mysql' in your dbConnect, should be 'sqlite' since he's using executeSQL* functions.
  7. The resource is compiled, so I can't see how is the value returned, guess you will have to wait for Castillo.
  8. His code already contained all that, he should tell us first what happens exactly.
  9. We really don't understand you well, I already told you, no one will script something for you for free. The only way is to search on the community. https://community.multitheftauto.com/
  10. I don't understand, what happens? Any errors in /debugscript?
  11. The client side script has server sided function.
  12. You should use isGuestAccount to check if he's logged in. function card () local acc = getPlayerAccount(client) if ( acc and isGuestAccount(acc) ) then if(getAccountData(acc,"onHaveGunLicense"))then outputChatBox("You already have a gun license",client,150,0,0) else setAccountData(acc,'onHaveGunLicense', true) end end end addEvent('givecard', true) addEventHandler('givecard', root, card )
  13. Two mistakes: if (country == nil or false) then You need another country == check. And: return false outputDebugScript("Player is not define or is not on the server.",3) It's outputDebugString and nothing can come after return. Every outputDebugScript must be replaced with outputDebugString. I can't post full code as I don't know what's the problem.
  14. Well, it's really messed up, I don't even understand it.
  15. My bad: Server: local marker = createMarker( 94.800003051758, 1925.1999511719, 17, "Cylinder", 2, 40, 73, 0, 200) function createTeamsOnStart () teamAF = createTeam ( "Armed Forces", 40, 73, 0 ) setTeamFriendlyFire ( teamAF, false ) end addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) function joinAF() setPlayerTeam(source,teamAF) setBlipColor ( source, 40, 73, 0, 255 ) setElementModel(source,287) setPlayerNametagColor (source, 40, 73, 0 ) giveWeapon ( source, 3, 1 ) setElementData( source, "Occupation", "Armed Forces", true ) outputChatBox("You have been employed as Armed Forces.",source,0,255,0) end addEvent("setAF", true) addEventHandler("setAF",root,joinAF) function AFjob( pPlayer ) local accName = getAccountName ( getPlayerAccount ( pPlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Armed Forces" ) ) then triggerClientEvent(pPlayer, "hideWindow", pPlayer) end end addEventHandler("onMarkerHit", marker, AFjob) Client: GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} windowjob = guiCreateWindow(531,232,301,397,"Armed Forces",false) guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,352,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,352,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,273,215,"Welcome To Armed Forces\n\nTo take Armed Forces job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) function AFjobleave( pPlayer ) if pPlayer == localPlayer then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, AFjobleave) function joinTeam() triggerServerEvent("setAF",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeAFWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeAFWindow, false) addEvent("hideWindow", true) addEventHandler("hideWindow", root, function() if not guiGetVisible(windowJob) then guiSetVisible(windowjob, true) showCursor(true) end end)
  16. Try: Server: local marker = createMarker( 94.800003051758, 1925.1999511719, 17, "Cylinder", 2, 40, 73, 0, 200) function createTeamsOnStart () teamAF = createTeam ( "Armed Forces", 40, 73, 0 ) setTeamFriendlyFire ( teamAF, false ) end addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) function joinAF() setPlayerTeam(source,teamAF) setBlipColor ( source, 40, 73, 0, 255 ) setElementModel(source,287) setPlayerNametagColor (source, 40, 73, 0 ) giveWeapon ( source, 3, 1 ) setElementData( source, "Occupation", "Armed Forces", true ) outputChatBox("You have been employed as Armed Forces.",source,0,255,0) end addEvent("setAF", true) addEventHandler("setAF",root,joinAF) function AFjob( pPlayer ) local accName = getAccountName ( getPlayerAccount ( pPlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Armed Forces" ) ) then if not guiGetVisible(windowjob) then triggerClientEvent(pPlayer, "hideWindow", pPlayer) end end end addEventHandler("onMarkerHit", marker, AFjob) Client: GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} windowjob = guiCreateWindow(531,232,301,397,"Armed Forces",false) guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,352,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,352,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,273,215,"Welcome To Armed Forces\n\nTo take Armed Forces job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) function AFjobleave( pPlayer ) if pPlayer == localPlayer then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, AFjobleave) function joinTeam() triggerServerEvent("setAF",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeAFWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeAFWindow, false) addEvent("hideWindow", true) addEventHandler("hideWindow", root, function() guiSetVisible(windowjob, true) showCursor(true) end)
  17. We don't accept requests, search here: https://community.multitheftauto.com
  18. Well, let's wait for someone more experienced.
  19. I don't think it's bugged, never worked with it either. Not sure about it.
  20. You're welcome and good luck.
  21. I'm not good at this, but I will try my best. When you enter a server, you download all client sided files in a resource running on that server, after downloading them, they start. So if you just created a GUI using QT, took the code and added it to a client side script, in a resource and ran that resource, when you enter the server you will get that GUI. A way to hide the GUI is using the function: guiSetVisible 2. If the other lua file is in the same resource and the same side (server side or client side) and it's global (not localized), you can call it easily the same way you call a function in the same file. --serverscript.lua (Server sided script in a resource): function myFunction() --code end --serverscript2.lua (Another server sided script in the same resource): myFunction() If the other file is different side you can use: triggerServerEvent triggerClientEvent If it's other resource, you can use exports: call Also check: viewtopic.php?f=148&t=40809
  22. https://community.multitheftauto.com/index.php?p= ... ils&id=222
×
×
  • Create New...