Jump to content

AlphaMark

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by AlphaMark

  1. AlphaMark

    Need help

    Hey, I made a script containing this: local route = { {283.33124, 1409.90393, 10.40879}, {-1970.61511, -859.24579, 32.02344}, {-2324.64600, -1653.37061, 483.70313}, {2799.31885, 2582.04321, 10.82031}, {2745.05957, -2431.14282, 13.65159} } and this in a function: currentIndex = math.random(1,#route) marker = createMarker(unpack(route[currentIndex]), 'checkpoint', 2, 255, 255, 0, 255) Though it is not working, It is not creating a marker
  2. AlphaMark

    Exports

    So i should make a client side script for this export?
  3. AlphaMark

    Exports

    Hey, I'm trying to get an export that checks if the player is staff but i get a error message all the time: Failed to call "{MS}Duty:isStaff" Script i'm trying to export from: function isStaff(name) if ( not name ) then return false; end for i,v in ipairs(staffs) do if getAccountName(name) == v then return true end end return false end addEvent ( getResourceName ( getThisResource ( ) )..":isStaff", true ) addEventHandler ( getResourceName ( getThisResource ( ) )..":isStaff", root, isStaff What i use for exporting: local name = getPlayerName(localPlayer) if exports["{MS}Duty"]:isStaff(name) == true then Btw the export is added to the meta like this: function="isStaff" type="server" />
  4. If i do it like this: setWorldSoundEnabled(17 [index = 10], false) Then i still get an error. Same with: setWorldSoundEnabled(17, [index = 10] false) Same with: setWorldSoundEnabled(17 [index = 10,] false)
  5. unexpected symbol near '[' in this line setWorldSoundEnabled(17, [index = 10,] false)
  6. Im getting this error showsound will have no effect because development mode is off But the development mode is activated by this script: addCommandHandler( "devmode", function () setDevelopmentMode ( true ) end )
  7. How can i turn the siren lights on but not the siren sounds?? I found this page... https://wiki.multitheftauto.com/wiki/Ge ... irenParams
  8. I mean the lights going on and off.
  9. Wont that also remove the lights?
  10. Okay, So i want to make an costom siren sound for all police vehicles. And i want the orriginal siren sound to be muted. How can i do that?
  11. AlphaMark

    Cars

    Okay so i want to create 1 infernus and an seasparrow attached to each other. but i also want to control the infernus and the seasparrow. Atm i can only control OR the seasparrow OR the infernus. Help please?
  12. AlphaMark

    Problem

    I have this line: for i,v in ipairs(getElementsWithinMarker(crimMarker)) do And it gives this error: attempt to call global'getElementsWithinMarker'(a nil value) Do u know why?
  13. Bad argument @ CrateMarker
  14. AlphaMark

    Wont work

    Okay so i have this: CrateMarker = createMarker(unpack(BoxPos[math.random(1,3)])) And it creates an big blue marker while i want an cylinder marker.
  15. AlphaMark

    route

    Okay so i added this: function SweepExit(theVehicle, seat, jacked) destroyElement(marker) currentIndex = ((currentIndex or 0) < #route) and ((currentIndex or 0) + 1) or 1 end addEventHandler("onClientPlayerVehicleExit", root, SweepExit) But when i enter the Sweeper again it wont create an marker
  16. AlphaMark

    route

    Okay. It wont create an new marker and i want it that the markers dissapear when you exit the vehicle
  17. AlphaMark

    route

    Im trying. I got this atm. local jobMarker = createMarker(10, 10, 3, 'cylinder', 1, 0, 255, 0, 255) local jobBlip = createBlipAttachedTo(jobMarker, 41) local sweeperTeam = createTeam("Sweeper", 255, 0, 0) local joblessTeam = createTeam("Unemployed", 123, 123, 123) function GetSweeperJob(hitElement) if getElementType(hitElement) == "player" then if getElementData(hitElement, "Occupation") ~= "Sweeper" then triggerClientEvent(hitElement, "SweepWindow", hitElement) else outputChatBox("You already are a sweeper!", hitElement, 255, 0, 0) end end end addEventHandler("onMarkerHit", jobMarker, GetSweeperJob) function GiveSweeperJob() setPlayerSkin(source, 264) setPlayerTeam(source, getTeamFromName("Sweeper")) setElementData(source, "Occupation", "Sweeper") setElementData(source, "hasSweepMarker", "no") outputChatBox("You are now a sweeper!", source, 255, 0, 0) end addEvent("GiveSweeperJob", true) addEventHandler("GiveSweeperJob", root, GiveSweeperJob) function resignSweeperJob(thePlayer) if (getElementData(thePlayer, "Occupation") == "Sweeper") then setElementModel(thePlayer, math.random(1,287)) setPlayerTeam(thePlayer, getTeamFromName("Unemployed")) setElementData(thePlayer, "Occupation", "Unemployed") outputChatBox("You resigned as sweeper!", thePlayer, 255, 0, 0) elseif getElementData(thePlayer, "Occupation") == "Unemployed" then outputChatBox("You are already Unemployed!", thePlayer, 255, 0, 0) end end addCommandHandler("resign", resignSweeperJob) function SweepEnter(theVehicle, seat, jacked) local id = getElementModel(theVehicle) if id == 574 then outputChatBox("You are now sweeping!", source, 255, 0, 0) triggerClientEvent("MakeMarker",getRootElement()) end end addEventHandler("onPlayerVehicleEnter", root, SweepEnter) function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end jobWdw = guiCreateWindow(638, 266, 597, 655, "SANGSweeper", false) guiWindowSetSizable(jobWdw, false) takejobBtn = guiCreateButton(378, 131, 190, 78, "Take Job", false, jobWdw) closeBtn = guiCreateButton(378, 524, 190, 78, "Close", false, jobWdw) guiSetVisible(jobWdw, false) function showJobWindow() if (jobWdw ~= nil) then guiSetVisible(jobWdw, true) guiSetInputEnabled(true) showCursor(true) centerWindow(jobWdw) end end addEvent("SweepWindow", true) addEventHandler("SweepWindow", root, showJobWindow) function clickJobWindow(button,state) if (source == takejobBtn) then triggerServerEvent("GiveSweeperJob", localPlayer) guiSetVisible(jobWdw, false) guiSetInputEnabled(false) showCursor(false) elseif (source == closeBtn) then guiSetVisible(jobWdw, false) guiSetInputEnabled(false) showCursor(false) end end addEventHandler("onClientGUIClick", guiRoot, clickJobWindow) local currentIndex = 1 local route = { { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 0, 3 }, { 0, 0, 4 } } addEventHandler("onMarkerHit", root, function() if (source == marker) then destroyElement(marker) currentIndex = (currentIndex < #route) and (currentIndex + 1) or 1 marker = createMarker(unpack(route[currentIndex])) end end) function MakeMarker(thePlayer, marker) if (source == marker) then createMarker(unpack(route[currentIndex])) end end addEvent("MakeMarker", true)
  18. AlphaMark

    route

    So how whould the scipt look then? Could u make an example?
  19. AlphaMark

    route

    Nothing happends when i hit the marker, Also no errors. And only sweepers should see the marker(When they are in the sweeper vehicle)
  20. AlphaMark

    route

    Server local jobMarker = createMarker(10, 10, 3, 'cylinder', 1, 0, 255, 0, 255) local jobBlip = createBlipAttachedTo(jobMarker, 41) local sweeperTeam = createTeam("Sweeper", 255, 0, 0) local joblessTeam = createTeam("Unemployed", 123, 123, 123) function GetSweeperJob(hitElement, matchingDimension) if getElementData(hitElement, "Occupation") ~= "Sweeper" then triggerClientEvent("SweepWindow", hitElement) else outputChatBox("You already are a sweeper!", hitElement, 255, 0, 0) end end addEventHandler("onMarkerHit", jobMarker, GetSweeperJob) function GiveSweeperJob(client) setPlayerSkin(client, 264) setPlayerTeam(client, getTeamFromName("Sweeper")) setElementData(client, "Occupation", "Sweeper") setElementData(client, "hasSweepMarker", "no") outputChatBox("You are now a sweeper!", client, 255, 0, 0) end addEvent("GiveSweeperJob", true) addEventHandler("GiveSweeperJob", getRootElement(), GiveSweeperJob) function resignSweeperJob(thePlayer, cmd) if (getElementData(thePlayer, "Occupation") == "Sweeper") then setPlayerSkin(thePlayer, math.random(1,287)) setPlayerTeam(thePlayer, getTeamFromName("Unemployed")) setElementData(thePlayer, "Occupation", "Unemployed") outputChatBox("You resigned as sweeper!", thePlayer, 255, 0, 0) elseif getElementData(thePlayer, "Occupation") == "Unemployed" then outputChatBox("You are already Unemployed!", thePlayer, 255, 0, 0) end end addCommandHandler("resign", resignSweeperJob) function SweepEnter(theVehicle, seat, jacked) local id = getElementModel ( theVehicle ) if id == 574 then outputChatBox("You are now sweeping!", thePlayer, 255, 0, 0) triggerClientEvent("SweepRoute", source) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), SweepEnter ) local currentIndex = 1 local route = { { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 0, 3 }, { 0, 0, 4 } } marker = createMarker ( unpack ( route [ currentIndex ] ) ) addEventHandler ( "onMarkerHit", root, function ( ) if ( source == marker ) then currentIndex = ( currentIndex + 1 ) destroyElement ( marker ) marker = nil marker = createMarker ( unpack ( route [ currentIndex ] ) ) end end ) Client function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end function JobWindow() jobWdw = guiCreateWindow(638, 266, 597, 655, "SANGSweeper", false) guiWindowSetSizable(jobWdw, false) takejobBtn = guiCreateButton(378, 131, 190, 78, "Take Job", false, jobWdw) closeBtn = guiCreateButton(378, 524, 190, 78, "Close", false, jobWdw) end function showJobWindow() JobWindow() if (jobWdw ~= nil) then guiSetVisible(jobWdw, true) guiSetInputEnabled(true) showCursor(true) centerWindow(jobWdw) end end addEvent("SweepWindow", true) addEventHandler("SweepWindow", getRootElement(), showJobWindow) function clickJobWindow(button,state) if (source == takejobBtn) then local client = localPlayer triggerServerEvent("GiveSweeperJob", localPlayer, client) guiSetVisible(jobWdw, false) guiSetInputEnabled(false) showCursor(false) elseif (source == closeBtn) then guiSetVisible(jobWdw, false) guiSetInputEnabled(false) showCursor(false) end end addEventHandler("onClientGUIClick", getRootElement(), clickJobWindow)
  21. AlphaMark

    route

    its defined with "local table ="
×
×
  • Create New...