Jump to content

wesleywillems17

Members
  • Posts

    106
  • Joined

  • Last visited

Posts posted by wesleywillems17

  1. Thx!

    But now i get this error in the dubug:

    Warning: [gameplay]\(SARS)CarJacker\script\server.lua:47 Bad argument @ 'getElementType' [Expected element at argument 1] — Line preview: local elementType = getElementType( hitElement )

  2. Hello,

    I'm creating a Car Jacking script for my server.

    But there is something wrong with line 2

    I'm not a pro scripter i'm trying to learn it. :P

    Server.lua

    function JobDone ( hitElement, matchingDimension ) 
        local elementType = getElementType( hitElement ) 
        if elemenyType == "player" then 
            if isElement( EndDesMarker ) then 
                destroyElement( EndDesMarker ) 
            end 
            if isElement( EndDesBlip ) then 
                destroyElement( EndDesBlip ) 
            end 
            if isElement( CarJacker ) then 
                destroyElement( CarJacker ) 
            end 
            if isElement( CarJackerBlip ) then 
                destroyElement( CarJackerBlip ) 
            end 
            money = math.random ( 2000, 5000 ) 
            givePlayerMoney ( source, money ) 
            outputChatBox ( "Got job! You received $" ..money, source ) 
        end 
    end 
    addEventHandler( "onMarkerHit", EndDesMarker, JobDone ) 
    

    Can somebody tell me what's wrong with it?

  3. Hello,

    Recently i got a new laptop with Windows 10 preinstalled.

    I download MTA and i started creating a server.

    But after a week of 2 something noticed me in the server.

    Sometimes when i use a fuction like restart then a white bar shows up.

    When i typ something and the white bar is there, then it go's away.

    Does somebody else have the same probmen?

    I have this problem since i'm using Windows 10.

    I hope somebody can help me fix this problem because it's very annoying.

    Server problem:

    Look at the bottom of the server

    SmiJ6t.jpg

    MTA version: 1.5.2

    My pc specifications:

    .) Windows 10 home (64-bit)

    .) Processor: Intel® Celeron® CPU N3050 @ 1.60GHz 1.60 GHz

    .) RAM memory: 4,00 GB

  4. Hello,

    I have a mechanic job in my server but it gives me error's when i enter a random vehicle.

    even when i'm not in the mechanic team.

    How could i fix this?

    function fix () 
    car = getPedOccupiedVehicle(source) 
    if allowedTeams[getTeamName(getPlayerTeam(source))] and getElementHealth(car) < 999 then 
    price = 1001 - getElementHealth(car)  
    givePlayerMoney(source, price*2) 
    fixVehicle(car) 
    outputChatBox("You have repair Brooken Stuff of this car", source, 0, 255, 0) 
    end 
    end 
    addEventHandler("onPlayerVehicleEnter", getRootElement(), fix) 
    

    Debug:

    Warning: [gameplay]\(SARS)Mechanic\server.lua:54 Bad argument @ 'getTeamName' [Expected team at argument 1, got boolean] — Line preview: if allowedTeams[getTeamName(getPlayerTeam(source))] and getElementHealth(car) < 999 then 
      
    

    (lijn 3 ligt gelijk aan lijn 54)

  5. Hello,

    Is it possible to attach a red flashing light to a object?

    MviSDZ.jpg

    I have a script that plays a sirene from this object but now i want to add a red flash light at the top of the object when i activate the sound.

    Could somebody help me please?

  6. Thx for the help!

    This code works:

        addCommandHandler("start", 
        function() 
            local sirenSound = playSound3D("siren.mp3", 2097.00, -1629.59, 18.79, true) 
            setSoundVolume(sirenSound,100) 
            
            addCommandHandler("stop", 
            function() 
                stopSound(sirenSound) 
            end) 
            
        end) 
    

  7. Hello,

    I have made a little script but i can't stop the playSound3D

    It starts when you use the command start and it needs to stop when you use the command stop.

    But i get a error in debug

    Client:

    function startSiren() 
        local sirenSound = playSound3D( 'siren.mp3', 2097.00, -1629.59, 18.79, true ) 
        setSoundVolume(sirenSound,100) 
    end 
    addCommandHandler ( "start", startSiren ) 
      
    function stopSiren() 
        stopSound(sirenSound) 
    end 
    addCommandHandler ( "stop", stopSiren ) 
    

    meta.xml

    Debug:

    WARNING: (SARS)Siren/client:8 Bad argument @ 'stopSound' [expected sound at argument 1, got nill]

    What did i do wrong?

  8. What? The team name is the same name in server.lua.

    Server:

      
    Teame1= createTeam("Mechanic",0,255,160) 
      
    miqTeams = { [Teame1] = true } 
    miqVehs = { [525] = true } 
      
    local vehicleTable = {} 
    function teamSet ( ) 
        local team = getTeamFromName ( "Mechanic" ) 
        if team then 
            local TT = vehicleTable[source] -- load 
            if TT then -- check 
                if isElement( TT ) then 
                    destroyElement( TT ) 
                end 
                vehicleTable[source]= nil -- clean 
            end 
            setPlayerTeam ( source, team ) 
            setPlayerNametagColor ( source, 0, 255, 0 ) 
            setElementModel(source, 50) 
                TT = createVehicle(525,1063.32, -1030.27, 32.29, 0, 0, 180) 
                warpPedIntoVehicle ( source, TT ) 
                vehicleTable[source]= TT 
                outputChatBox("You are now employed as a Mechanic!", thePlayer) 
            else 
                local teamw = getTeamFromName ( "Mechanic" ) 
                if teamw then 
                cancelEvent() 
                outputChatBox("You are already a Mechanic!", source) 
            end 
        end 
    end 
    addEvent ( "sTeame5", true) 
    addEventHandler ( "sTeame5", root, teamSet ) 
      
    function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle 
        if getElementType ( thePlayer ) == "player" then 
        if ( miqVehs[getElementModel ( source )] ) and ( not miqTeams[getPlayerTeam( thePlayer )] ) then -- if the vehicle is one of 4 police cars, and the skin is not a police skin 
                removePedFromVehicle( thePlayer )-- force the player out of the vehicle 
                outputChatBox("Only Mechanics can drive this vehicle!", thePlayer) 
            end 
        end 
    end 
    addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) 
      
    addEventHandler("onPlayerQuit",root, 
    function () 
        local TT = vehicleTable[source] 
        if TT then 
            if isElement( TT ) then 
                destroyElement( TT ) 
            end 
            vehicleTable[source]= nil 
        end 
    end) 
      
    local allowedTeams = {  
    ["Mechanics"] = true, 
    ["Mechanic"] = true, 
    } 
      
    function fix () 
    car = getPedOccupiedVehicle(source) 
    if allowedTeams[getTeamName(getPlayerTeam(source))] and getElementHealth(car) < 999 then 
    price = 1001 - getElementHealth(car)  
    givePlayerMoney(source, price*2) 
    fixVehicle(car) 
    outputChatBox("You have repair Brooken Stuff of this car", source, 0, 255, 0) 
    end 
    end 
    addEventHandler("onPlayerVehicleEnter", getRootElement(), fix) 
      
    

  9. Hello everybody,

    I'm making a server but sometimes i get a error from the debugscript.

    For example:

    WARNING: [gameplay]\(SARS)Mechanic\server.lua:63: Bad argument @ 'getTeamName' [Expected team at argument 1, got boolean]

    or

    WARNING: [gameplay]\(SARS)Police\JobVehicle\s_vehicles.lua:3: Bad argument @ 'getPlayerTeam' [Expected player at argument 1, got nil]

    What does the [Expected team at argument 1, got boolean] and [Expected player at argument 1, got nil] mean?

    I don't understand it but i want to understand it :P

    Is there a list with the information what does error means?

    Sorry for bad English :P

    Hope somebody could help me :)

  10. Hello,

    I have downloaded a drug transport resource from the community.

    But it has some error's in the debug.

    Also when i hit the LSmarker with the CarLS then it gives me the money and wanted level from JobLS, jobLV and JobSF..

    How could i fix this? i have tried a lot of thing but nothing works.

    (Sorry for bad English)

    Debug:

    [2016-04-21 00:08:05] ERROR: [gameplay]\(SARS)DugTrans\JobLS.lua:13: Valid wanted levels are between 0 and 6 inclusive

    [2016-04-21 00:08:05] ERROR: [gameplay]\(SARS)DugTrans\JobLV.lua:13: Valid wanted levels are between 0 and 6 inclusive

    [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:14: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil]

    [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:15: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil]

    [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:16: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil]

    [2016-04-21 00:08:05] ERROR: [gameplay]\(SARS)DugTrans\JobSF.lua:13: Valid wanted levels are between 0 and 6 inclusive

    [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobSF.lua:14: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil]

    [2016-04-21 00:08:06] WARNING: [gameplay]\(SARS)DugTrans\JobSF.lua:15: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil]

    [2016-04-21 00:08:06] WARNING: [gameplay]\(SARS)DugTrans\JobSF.lua:16: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil]

    Client.lua

    function guiMyCwindow(w,h,t)

    local x,y = guiGetScreenSize()

    return guiCreateWindow((x-w)/2,(y-h)/2,w,h,t,false)

    end

    transWindow = guiMyCwindow(320,350,"Drugs Transport")

    guiWindowSetMovable(transWindow,false)

    guiWindowSetSizable(transWindow,false)

    guiSetVisible(transWindow, false)

    destiLabel = guiCreateLabel(25,120,450,55,"Choose Your Destination:",false,transWindow)

    transInfo = guiCreateMemo(20,30,300,90,"What To Do?\n\nAs a drugs transporter it's your job to deliver\nthe drugs.\nYou must deliver the drugs to the destination that you have choosed here below.\n\nIf you step out of the vehicle then the vehicle will be destroyed!",false,transWindow)

    guiMemoSetReadOnly( transInfo, true )

    lsButtonRadio = guiCreateRadioButton(20,140,437,45,"Travel To: Los Santos\n(+ 2 stars of wanted level)\nYou will earn $3000",false,transWindow)

    lvButtonRadio = guiCreateRadioButton(20,190,437,45,"Travel To Las Venturas\n(+ 4 stars of wanted level)\nYou will earn $6000",false,transWindow)

    sfButtonRadio = guiCreateRadioButton(20,240,437,45,"Travel to: San Fierro\n(+ 6 stars of wanted level)\nYou will earn $10.000",false,transWindow)

    acceptButton = guiCreateButton(22,300,108,37,"Accept",false,transWindow)

    closeButton = guiCreateButton(171,300,108,37,"Quit",false,transWindow)

    guiCreateLabel(144, 307, 20, 18, "OR",false,transWindow )

    local jobmarker = createMarker ( 1612.52, -1500.88, 12.58, "cylinder", 2, 255, 0, 0, 255 )

    function MarkerHit ( thePlayer, hitPlayer, matchingDimension )

    if ( getTeamName(getPlayerTeam(thePlayer)) == "Criminal" ) then

    guiSetVisible(transWindow, true)

    showCursor(true)

    end

    end

    addEventHandler ( "onClientMarkerHit", jobmarker, MarkerHit )

    function closeChangeJobWindow()

    if (source == closeButton) then

    guiSetVisible(transWindow, false)

    showCursor(false)

    end

    end

    addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), closeChangeJobWindow)

    function lsjobcli()

    if (source == acceptButton) then

    if (guiRadioButtonGetSelected(lsButtonRadio)) then

    triggerServerEvent ("givePlayerJobLS",getLocalPlayer())

    guiSetVisible(transWindow, false)

    showCursor(false)

    end

    end

    end

    addEventHandler("onClientGUIClick", acceptButton, lsjobcli, false )

    function lvjobcli()

    if (source == acceptButton) then

    if (guiRadioButtonGetSelected(lvButtonRadio)) then

    triggerServerEvent ("givePlayerJobLV",getLocalPlayer())

    guiSetVisible(transWindow, false)

    showCursor(false)

    end

    end

    end

    addEventHandler("onClientGUIClick", acceptButton, lvjobcli, false )

    function sfjobcli()

    if (source == acceptButton) then

    if (guiRadioButtonGetSelected(sfButtonRadio)) then

    triggerServerEvent ("givePlayerJobSF",getLocalPlayer())

    guiSetVisible(transWindow, false)

    showCursor(false)

    end

    end

    end

    addEventHandler("onClientGUIClick", acceptButton, sfjobcli, false )

    JobLS.lua

    function lsjobser ()

    carLS = createVehicle (482, 1617.65, -1554.01, 13.56)

    warpPedIntoVehicle(source, carLS)

    markerLS = createMarker (1784.78, -1702.06, 12.50, "cylinder", 2, 255, 0, 0, 255)

    blipLS = createBlipAttachedTo (markerLS, 40)

    end

    addEvent ("givePlayerJobLS", true)

    addEventHandler ("givePlayerJobLS", root, lsjobser)

    function moneyLS (attackerLS)

    if (attackerLS) and (attackerLS ~= source) then

    givePlayerMoney(attackerLS, 3000)

    setPlayerWantedLevel(attackerLS, getPlayerWantedLevel(attackerLS)+2)

    destroyElement(markerLS)

    destroyElement(blipLS)

    destroyElement(carLS)

    end

    end

    addEventHandler( "onMarkerHit", root, moneyLS)

    JobLV.lua

    function lvjobser ()

    carlv = createVehicle (482, 1606.96, -1554.01, 13.56)

    warpPedIntoVehicle(source, carlv)

    markerLV = createMarker (1074.43, 1292.71, 9.82, "cylinder", 2, 255, 0, 0, 255)

    blipLV = createBlipAttachedTo (markerLV, 40)

    end

    addEvent ("givePlayerJobLV", true)

    addEventHandler ("givePlayerJobLV", root, lvjobser)

    function moneyLV (attackerLV)

    if (attackerLV) and (attackerLV ~= source) then

    givePlayerMoney(attackerLV, 6000)

    setPlayerWantedLevel(attackerLV, getPlayerWantedLevel(attackerLV)+4)

    destroyElement ( markerLV )

    destroyElement ( blipLV )

    destroyElement ( carlv )

    end

    end

    addEventHandler( "onMarkerHit", root, moneyLV )

    JobSF.lua

    function sfjobser ()

    carSF = createVehicle (482, 1597.13, -1554.01, 13.56)

    warpPedIntoVehicle(source, carSF)

    markerSF = createMarker (-2052.80, 144.87, 27.83, "cylinder", 2, 255, 0, 0, 255)

    blipSF = createBlipAttachedTo (markerSF, 40)

    end

    addEvent ("givePlayerJobSF", true)

    addEventHandler ("givePlayerJobSF", root, sfjobser)

    function moneySF (attackerSF)

    if (attackerSF) and (attackerSF ~= source) then

    givePlayerMoney(attackerSF, 10000)

    setPlayerWantedLevel(attackerSF, getPlayerWantedLevel(attackerSF)+6)

    destroyElement(markerSF)

    destroyElement(blipSF)

    destroyElement(carSF)

    end

    end

    addEventHandler( "onMarkerHit", root, moneySF )

  11. Hello,

    I have a script that makes a image moving from the top of your screen to the middle of your screen.

    But i was wondering if it is possible to change the image to a gif?

      
    local screenWidth, screenHeight = guiGetScreenSize() 
    local startPos = {0.4, 0.0} --the relative position from where the image will start 
    local endPos = {0.4, 0.5} --the relative position from where the image will stop 
    local animType = "OutBounce" --the animation type, see [url=https://wiki.multitheftauto.com/wiki/Easing]https://wiki.multitheftauto.com/wiki/Easing[/url] 
    local speed = 0.5 --the speed of the entire animation 
    local hideTime = 7 --time in sec after the dead image will hidden (starting from the end of the anim) 
    local animStep = 0 --do not modify, used to hold the progression of the animation 
    local stopingTimer = nil  
    --the distance between the line and the top of the image 
    local lOffsetY = 0.07*screenHeight 
      
      
      
    function animateDeadImage() 
        local x, y, _ = interpolateBetween( 
            startPos[1]*screenWidth, startPos[2]*screenHeight, 0, 
            endPos[1]*screenWidth, endPos[2]*screenHeight, 0, animStep/100, animType) 
      
      
        dxDrawImage(x, y, 250, 250, 'image/intro.png', 0, 0, -120) 
      
        animStep = animStep + speed --steping the animation 
        if animStep >= 100 and not stopingTimer then 
            stopingTimer = setTimer(hideDeadImage, hideTime*1000, 1) --start the timer to make hide it 
        end 
    end 
      
    function hideDeadImage() 
        removeEventHandler("onClientRender", root, animateDeadImage) 
        stopingTimer = nil --reset it for our condition 
    end 
      
    function cursorMove ( _, _, x, y ) 
        if ( isCursorShowing ( ) and not guiGetVisible ( window ) and isOpen) then 
            if ( x >= pX+156 and x <= pX+246 and y >=  pY+170 and y <=  pY+200 ) then 
                data.login.hovering = true 
                return 
            elseif ( y >=  pY+170 and y <=  pY+200 and x >= pX+300 and x <= pX+440 ) then 
                data.reg.hovering = true 
                return 
            end 
        end 
        data.login.hovering = false 
        data.reg.hovering = false 
    end 
      
    

  12. hallo allemaal,

    Ik heb laatst een drugs transport job gedownload van de MTA Community.

    Maar er is een probleem met de job die ik zelf (na meerdere malen geprobeerd te hebben) niet opgelost krijg.

    Het probleem is dat wanneer ik alleen naar de marker van Los Santos rij hoor ik $3000 te ontvangen.

    Maar ik plaats van dat ontvang ik $19000 en dit is het bedrag bij elkaar opgeteld dat ik zou ontvangen wanneer ik naar LS, SF en LV zal rijden.

    Ik zal hier onder de scripts plaatsen en hoop dat iemand mij zou kunnen helpen.

    Cliend:

      
    local jobmarker = createMarker ( 1615.36, -1490.20, 13.23, "cylinder", 2, 255, 0, 0, 0 ) 
    local ped = createPed  (0, 1615.36, -1490.20, 14.23, 180) 
    local maxDistance = 12 
    myFont = dxCreateFont( "font/SF Automaton Bold.ttf", 20 ) 
    setElementFrozen(ped, true) 
      
    GUIEditor_Label = {} 
      
    local teamName = "Criminal" 
    transWindow = guiCreateWindow(0.0, 0.8, 1.00, 0.20,"Transport the drugs",true) 
    guiSetVisible(transWindow, false) 
    destiLabel = guiCreateLabel(0.04,0.1,0.2,0.2,"Choose your destination:",true,transWindow) 
    guiSetFont(destiLabel, guiCreateFont("font/1.ttf", 15)) 
    lsButtonRadio = guiCreateRadioButton(0.01,0.4,0.25,0.07,"Los Santos, +2 Wanted Stars and 3000 if you made it",true,transWindow) 
    lvButtonRadio = guiCreateRadioButton(0.01,0.5,0.25,0.07,"Las Venturas, +4 Wanted Stars and 6000 if you made it",true,transWindow) 
    sfButtonRadio = guiCreateRadioButton(0.01,0.6,0.25,0.07,"San Fierro, +6 Wanted Stars and 10000 if you made it",true,transWindow) 
    infoMemo = guiCreateMemo(0.30, 0.15, 0.40, 0.80,"Transport the drugs\n\nWhen you take the job you will get a free van with drugs.\nYou need to transport the drugs to the location that you have chosen.\nHow further the location how more money you will get paid.\nBut also you will get wanted level at the end of the ride!\n\nWhen you exit the vehicle then the vehicle will be destroyed.\nSo don't exit the vehicle our you must join the job again!",true,transWindow) 
    guiMemoSetReadOnly(infoMemo,true) 
    acceptButton = guiCreateButton(0.90, 0.15, 0.50, 0.90,"Accept job",true,transWindow) 
    closeButton = guiCreateButton(0.80, 0.15, 0.10, 0.80,"Quit job",true,transWindow) 
      
    addEventHandler("onClientMarkerHit", jobmarker, 
            function ( hitPlayer, matchingDimension ) 
                    if ( hitPlayer == localPlayer and isElementWithinMarker(hitPlayer, jobmarker) ) then 
                            if ( getTeamName( getPlayerTeam( hitPlayer ) ) == teamName ) then 
                                    if getElementType(hitPlayer) == "player" then 
                                            guiSetVisible ( transWindow, true ) 
                                            showCursor(true) 
                                            showChat(false) 
                                            showPlayerHudComponent ( 'all', false ) 
                                    end 
                            else 
                            exports["AC_message"]:outputTopBar ( "Only criminals can transport drugs!", player, 255, 255, 0, 170 ,true ) 
                            end 
                    end 
            end 
    ) 
      
    function closeChangeJobWindow() 
        if (source == closeButton) then 
            guiSetVisible(transWindow, false) 
            showCursor(false) 
            showChat(true) 
            showPlayerHudComponent ( 'all', true ) 
            triggerServerEvent ( "sum", lp) 
        end 
    end 
    addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), closeChangeJobWindow) 
      
      
             
    addEventHandler ( "onClientPedDamage", resourceRoot, 
        function () 
            cancelEvent () 
            setElementFrozen(player, true) 
        end 
    ) 
      
    function lsjobcli() 
       if (source == acceptButton) then 
                if (guiRadioButtonGetSelected(lsButtonRadio)) then 
            triggerServerEvent ("givePlayerJobLS",getLocalPlayer()) 
            guiSetVisible(transWindow, false) 
            showCursor(false) 
            showChat(true) 
            showPlayerHudComponent ( 'all', true ) 
        end 
    end 
    end 
    addEventHandler("onClientGUIClick", acceptButton, lsjobcli, false ) 
      
    function lvjobcli() 
       if (source == acceptButton) then  
                if (guiRadioButtonGetSelected(lvButtonRadio)) then  
            triggerServerEvent ("givePlayerJobLV",getLocalPlayer()) 
            guiSetVisible(transWindow, false) 
          showCursor(false) 
            showCursor(false) 
            showChat(true) 
            showPlayerHudComponent ( 'all', true ) 
        end 
    end 
    end 
    addEventHandler("onClientGUIClick", acceptButton, lvjobcli, false ) 
      
    function sfjobcli() 
       if (source == acceptButton) then  
                if (guiRadioButtonGetSelected(sfButtonRadio)) then  
            triggerServerEvent ("givePlayerJobSF",getLocalPlayer()) 
            guiSetVisible(transWindow, false) 
          showCursor(false) 
            showCursor(false) 
            showChat(true) 
            showPlayerHudComponent ( 'all', true ) 
        end 
    end 
    end 
    addEventHandler("onClientGUIClick", acceptButton, sfjobcli, false ) 
             
                addEventHandler ( "onClientRender", root, 
            function ( ) 
         local pX, pY, pZ = getElementPosition ( localPlayer ) 
                local pedX, pedY, pedZ = getElementPosition ( ped ) 
                local distance = getDistanceBetweenPoints3D ( pX, pY, pZ, pedX, pedY, pedZ ) 
                
                if ( distance <= 12 ) then 
                    local x, y = getScreenFromWorldPosition ( pedX, pedY, pedZ ) 
                    if ( x and y ) then 
                    dxDrawText( "Drugs transport", x, y+1.5, _, _, tocolor( 255, 0, 0, 255 ), 1.2, myFont, "center", "center" ) 
                    end 
                end 
            end 
        ) 
      
    

    Server:

      
    function lsjobser () 
         carLS = createVehicle (440, 2460.52, -2004.38, 13.54) 
         warpPedIntoVehicle(source, carLS) 
         markerLS = createMarker (1784.78, -1702.06, 12.50, "cylinder", 2, 255, 0, 0, 255) 
         blipLS = createBlipAttachedTo (markerLS, 40) 
    end 
    addEvent ("givePlayerJobLS", true) 
    addEventHandler ("givePlayerJobLS", root, lsjobser) 
      
    function moneyLS (attacker) 
         if (attackerLS) and (attackerLS ~= source) then 
         givePlayerMoney(attackerLS, 3000) 
         setPlayerWantedLevel(attackerLS, getPlayerWantedLevel(attackerLS)+2) 
         destroyElement(markerLS) 
         destroyElement(blipLS) 
         destroyElement(carLS) 
    end 
    end 
    addEventHandler( "onMarkerHit", root, moneyLS ) 
      
    function lvjobser () 
         carlv = createVehicle (440, 2460.52, -2004.38, 13.54) 
         warpPedIntoVehicle(source, carlv) 
         markerLV = createMarker (1074.43, 1292.71, 9.82, "cylinder", 2, 255, 0, 0, 255) 
         blipLV = createBlipAttachedTo (markerLV, 40) 
    end 
    addEvent ("givePlayerJobLV", true) 
    addEventHandler ("givePlayerJobLV", root, lvjobser) 
      
    function moneyLV (attackerLV) 
        if (attackerLV) and (attackerLV ~= source) then 
         givePlayerMoney(attackerLV, 6000) 
         setPlayerWantedLevel(attackerLV, getPlayerWantedLevel(attackerLV)+4) 
         destroyElement(markerLV) 
         destroyElement(blipLV) 
         destroyElement(carlv) 
    end 
    end 
    addEventHandler( "onMarkerHit", root, moneyLV ) 
      
      
    function sfjobser () 
         carSF = createVehicle (440, 2460.52, -2004.38, 13.54) 
         warpPedIntoVehicle(source, carSF) 
         markerSF = createMarker (-2052.80, 144.87, 27.83, "cylinder", 2, 255, 0, 0, 255) 
         blipSF = createBlipAttachedTo (markerSF, 40) 
    end 
    addEvent ("givePlayerJobSF", true) 
    addEventHandler ("givePlayerJobSF", root, sfjobser) 
      
    function moneySF (attackerSF) 
        if (attackerSF) and (attackerSF ~= source) then 
         givePlayerMoney(attackerSF, 10000) 
         setPlayerWantedLevel(attackerSF, getPlayerWantedLevel(attackerSF)+6) 
         destroyElement(markerSF) 
         destroyElement(blipSF) 
         destroyElement(carSF) 
    end 
    end 
    addEventHandler( "onMarkerHit", root, moneySF ) 
      
    

  13. Still does not work :(

    When i choose los santos as my destination and when i drive to the marker and hot the marker.

    Then i receive the money of the destination Los Santos San Fierro and Las Venturas.

    When i drive to LS normally i would receive $3000

    When i drive to LV normally i would receive $6000

    When i drive to SF normally i would receive $10,000

    3000+6000+10000=19000

    So i receive $19000 for only driving to LS.

  14. I have a problem with my drugs transport scripts.

    When i hit the marker i will get the money of:

    Los Santos, Las venturas and san fierro.

    How can i fix this?

    Server-side:

      
    function lsjobser () 
         carLS = createVehicle (498, 1604.68, -1475.15, 13.93) 
         warpPedIntoVehicle ( source, carLS ) 
         markerLS = createMarker (979.65, -1261.75, 15.22, "cylinder", 2, 255, 0, 0, 255) 
         blipLS = createBlipAttachedTo (markerLS, 51) 
    end 
    addEvent ("givePlayerJobLS", true) 
    addEventHandler ("givePlayerJobLS", root, lsjobser) 
      
      
    function moneyLS (attacker) 
         if (attacker) and (attacker ~= source) then 
         givePlayerMoney(attacker, 3000) 
         setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+2) 
         destroyElement(markerLS) 
         destroyElement(blipLS) 
         destroyElement(carLS) 
    end 
    end 
    addEventHandler( "onMarkerHit", root, moneyLS ) 
      
    function lvjobser () 
         carlv = createVehicle (498, 1604.68, -1475.15, 13.93) 
         warpPedIntoVehicle(attacker, carlv) 
         markerLV = createMarker (1074.43, 1292.71, 9.82, "cylinder", 2, 255, 0, 0, 255) 
         blipLV = createBlipAttachedTo (markerLV, 51) 
    end 
    addEvent ("givePlayerJobLV", true) 
    addEventHandler ("givePlayerJobLV", root, lvjobser) 
      
    function moneyLV (attacker) 
        if (attacker) and (attacker ~= source) then 
         givePlayerMoney(attacker, 6000) 
         setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+4) 
         destroyElement(markerLV) 
         destroyElement(blipLV) 
         destroyElement(carlv) 
    end 
    end 
    addEventHandler( "onMarkerHit", root, moneyLV ) 
      
      
    function sfjobser () 
         carSF = createVehicle (498, 1604.68, -1475.15, 13.93) 
         warpPedIntoVehicle(source, carSF) 
         markerSF = createMarker (-2052.80, 144.87, 27.83, "cylinder", 2, 255, 0, 0, 255) 
         blipSF = createBlipAttachedTo (markerSF, 51) 
    end 
    addEvent ("givePlayerJobSF", true) 
    addEventHandler ("givePlayerJobSF", root, sfjobser) 
      
    function moneySF (attacker) 
        if (attacker) and (attacker ~= source) then 
         givePlayerMoney(source, 10000) 
         setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+6) 
         destroyElement(markerSF) 
         destroyElement(blipSF) 
         destroyElement(carSF) 
    end 
    end 
    addEventHandler( "onMarkerHit", root, moneySF ) 
      
    

  15. Hi,

    I have a drugs transport scripts for my server.

    But the problem with this scripts is that every group can take this job and i only want that the group criminal can take the job and also when you leave the vehicle then the vehicle will be destroyed.

    Can somebody please help me with this scripts?

    Client:

      
    GUIEditor_Label = {} 
      
    transWindow = guiCreateWindow(182,134,482,342,"Drug Transport Window",false) 
    guiSetVisible(transWindow, false) 
    destiLabel = guiCreateLabel(19,33,450,55,"Choose your destination",false,transWindow) 
    lsButtonRadio = guiCreateRadioButton(21,104,437,19,"Los Santos, +2 Wanted Stars and 3000 if you made it",false,transWindow) 
    lvButtonRadio = guiCreateRadioButton(20,149,437,19,"Las Venturas, +4 Wanted Stars and 6000 if you made it",false,transWindow) 
    sfButtonRadio = guiCreateRadioButton(20,193,437,19,"San Fierro, +6 Wanted Stars and 10000 if you made it",false,transWindow) 
    acceptButton = guiCreateButton(103,267,113,37,"Accept",false,transWindow) 
    closeButton = guiCreateButton(241,266,108,37,"Close",false,transWindow) 
      
    local jobmarker = createMarker ( 2448.68, -1976.63, 12.54, "cylinder", 2, 255, 0, 0, 255 ) 
    createBlipAttachedTo (jobmarker, 40) 
    function MarkerHit ( hitPlayer, matchingDimension ) 
        guiSetVisible(transWindow, true) 
        showCursor(true) 
        end 
    addEventHandler ( "onClientMarkerHit", jobmarker, MarkerHit ) 
      
    function closeChangeJobWindow() 
        if (source == closeButton) then 
            guiSetVisible(transWindow, false) 
            showCursor(false) 
        end 
    end 
    addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), closeChangeJobWindow) 
      
    function lsjobcli() 
       if (source == acceptButton) then  
                if (guiRadioButtonGetSelected(lsButtonRadio)) then  
            triggerServerEvent ("givePlayerJobLS",getLocalPlayer()) 
            guiSetVisible(transWindow, false) 
          showCursor(false) 
        end 
    end 
    end 
    addEventHandler("onClientGUIClick", acceptButton, lsjobcli, false ) 
      
    function lvjobcli() 
       if (source == acceptButton) then  
                if (guiRadioButtonGetSelected(lvButtonRadio)) then  
            triggerServerEvent ("givePlayerJobLV",getLocalPlayer()) 
            guiSetVisible(transWindow, false) 
          showCursor(false) 
        end 
    end 
    end 
    addEventHandler("onClientGUIClick", acceptButton, lvjobcli, false ) 
      
    function sfjobcli() 
       if (source == acceptButton) then  
                if (guiRadioButtonGetSelected(sfButtonRadio)) then  
            triggerServerEvent ("givePlayerJobSF",getLocalPlayer()) 
            guiSetVisible(transWindow, false) 
          showCursor(false) 
        end 
    end 
    end 
    addEventHandler("onClientGUIClick", acceptButton, sfjobcli, false ) 
      
    

    Server:

      
    function lsjobser () 
         car = createVehicle (440, 2460.52, -2004.38, 13.54) 
         warpPedIntoVehicle(source, car) 
         markerLS = createMarker (1784.78, -1702.06, 12.50, "cylinder", 2, 255, 0, 0, 255) 
         blipLS = createBlipAttachedTo (markerLS, 40) 
    end 
    addEvent ("givePlayerJobLS", true) 
    addEventHandler ("givePlayerJobLS", root, lsjobser) 
      
    function moneyLS (attacker) 
         if (attacker) and (attacker ~= source) then 
         givePlayerMoney(attacker, 3000) 
         setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+2) 
         destroyElement(markerLS) 
         destroyElement(blipLS) 
         destroyElement(car) 
    end 
    end 
    addEventHandler( "onMarkerHit", root, moneyLS ) 
      
    function lvjobser () 
         carlv = createVehicle (440, 2460.52, -2004.38, 13.54) 
         warpPedIntoVehicle(source, carlv) 
         markerLV = createMarker (1074.43, 1292.71, 9.82, "cylinder", 2, 255, 0, 0, 255) 
         blipLV = createBlipAttachedTo (markerLV, 40) 
    end 
    addEvent ("givePlayerJobLV", true) 
    addEventHandler ("givePlayerJobLV", root, lvjobser) 
      
    function moneyLV (attacker) 
        if (attacker) and (attacker ~= source) then 
         givePlayerMoney(attacker, 6000) 
         setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+4) 
         destroyElement(markerLV) 
         destroyElement(blipLV) 
         destroyElement(carlv) 
    end 
    end 
    addEventHandler( "onMarkerHit", root, moneyLV ) 
      
      
    function sfjobser () 
         carSF = createVehicle (440, 2460.52, -2004.38, 13.54) 
         warpPedIntoVehicle(source, carSF) 
         markerSF = createMarker (-2052.80, 144.87, 27.83, "cylinder", 2, 255, 0, 0, 255) 
         blipSF = createBlipAttachedTo (markerSF, 40) 
    end 
    addEvent ("givePlayerJobSF", true) 
    addEventHandler ("givePlayerJobSF", root, sfjobser) 
      
    function moneySF (attacker) 
        if (attacker) and (attacker ~= source) then 
         givePlayerMoney(attacker, 10000) 
         setPlayerWantedLevel(attacker, getPlayerWantedLevel(attacker)+6) 
         destroyElement(markerSF) 
         destroyElement(blipSF) 
         destroyElement(carSF) 
    end 
    end 
    addEventHandler( "onMarkerHit", root, moneySF ) 
      
    function Box11() 
        outputChatBox("You must be a criminal!", source, 255, 0, 0) 
    end 
    addEvent("Box11", true) 
    addEventHandler("Box11", root, Box11) 
      
    

  16. SARS_header.jpg

    Paid scripter

    Become a paid scripter of SARS:RPG.

    You will get paid for your work every month.

    What is SARS:RPG?

    SARS:RPG is a RPG server with a 24/7 VPS.

    When you are a scripter of SARS:RPG you will have access to our VPS.

    Only to work on the server.

    Our intention

    We are trying to make SARS:RPG 1 of the best servers for MTA:SA.

    With much players and great staff people.

    What we expect from you

    We don't expect any thing special from you.

    Only that you make the scripts that we ask from you.

    Contact me

    If you like the job and you would to become a scripter.

    Than you can add me on skype: wesleywillems17

    Greetings,

    Wesley Willems

  17. Hello,

    I'm the owner of SARS:RPG.

    I i'm searching for some active staff members for my server.

    What i expected

    I expected that you will be active on the server and website of SARS:RPG.

    That you will be friendly to other players and that you will know the rules of SARS:RPG.

    Do i get paid?

    No you don't get paid of being a staff member.

    I only pay for a good scripter at my server.

    For more information you can look at our website:

    http://www.sars-rpg.com/

    Greetings,

    W. Willems

×
×
  • Create New...