Szerző Téma: Csomagszállitó Munka  (Megtekintve 806 alkalommal)

Nem elérhető regun

Csomagszállitó Munka
« Dátum: 2016. május 20. - 16:53:01 »
0 Show voters
Ebbe a csomagszállitó munkába szeretném beilleszteni ezt a markert hogy létrehozza az adott hlyen az autót valaki tudna segiteni hogy melyik részébe kellene bele raknom és hogy ez igy jól van e megírva.
 
marker = createMarker(1010.15234375, -1302.7265625, 13.3828125)
addEventHandler(\"onMarkerHit\", marker, function(player)
   theVeh = createVehicle(456, 1010.15234375, -1302.7265625, 14)
   warpPedIntoVehicle(player, theVeh)
end)

 




mysql = exports.mysql
local lockTimer = nil
local truckruns = { }
local truckwage = { }
local truckroute = { }
local truck = { [456] = true }
marker = createMarker(1010.15234375, -1302.7265625, 13.3828125)
addEventHandler(\"onMarkerHit\", marker, function(player)
   theVeh = createVehicle(456, 1010.15234375, -1302.7265625, 14)
   warpPedIntoVehicle(player, theVeh)
end)
function giveTruckingMoney(vehicle)
    outputChatBox(\"#ffffff[#7CC576Teszt #ffffff- #FFA700Munka#ffffff] Kaptál #FFA700\" .. ( truckwage[vehicle] or 0 ) .. \" #ffffffFt-ot a szállításokért.\", source, 255, 0, 0,true)
    exports.global:giveMoney(source, truckwage[vehicle] or 0)
    --if (truckwage[vehicle] > 1500) then
        --triggerTruckCheatEvent(thePlayer, 2, truckwage[vehicle])
    --end
   
    -- respawn the vehicle
    exports[\'anticheat-system\']:changeProtectedElementDataEx(source, \"realinvehicle\", 0, false)
    removePedFromVehicle(source, vehicle)
    respawnVehicle(vehicle)
    setVehicleLocked(vehicle, false)
    setElementVelocity(vehicle,0,0,0)
   
    -- reset runs/wage
    truckruns[vehicle] = nil
    truckwage[vehicle] = nil
end
addEvent(\"giveTruckingMoney\", true)
addEventHandler(\"giveTruckingMoney\", getRootElement(), giveTruckingMoney)
function checkTruckingEnterVehicle(thePlayer, seat)
    if getElementData(source, \"owner\") == -2 and getElementData(source, \"faction\") == -1 and seat == 0 and truck[getElementModel(source)] and getElementData(source,\"job\") == 1 and getElementData(thePlayer,\"job\") == 1 then
        triggerClientEvent(thePlayer, \"startTruckJob\", thePlayer, truckroute[source] or -1)
        if (truckruns[vehicle] ~= nil) and (truckwage[vehicle] > 0) then
            triggerClientEvent(thePlayer, \"spawnFinishMarkerTruckJob\", thePlayer)
        end
    end
end
addEventHandler(\"onVehicleEnter\", getRootElement(), checkTruckingEnterVehicle)
function startEnterTruck(thePlayer, seat, jacked)
    if seat == 0 and truck[getElementModel(source)] and getElementData(thePlayer,\"job\") == 1 and jacked then -- if someone try to jack the driver stop him
        if isTimer(lockTimer) then
            killTimer(lockTimer)
            lockTimer = nil
        end
        setVehicleLocked(source, true)
        lockTimer = setTimer(setVehicleLocked, 5000, 1, source, false)
    end
end
addEventHandler(\"onVehicleStartEnter\", getRootElement(), startEnterTruck)
function saveDeliveryProgress(vehicle, earned)
    if (truckruns[vehicle] == nil) then
        truckruns[vehicle] = 0
        truckwage[vehicle] = 0
    end
   
    truckruns[vehicle] = truckruns[vehicle] + 1
    truckwage[vehicle] = truckwage[vehicle] + earned
   
outputChatBox(\"#ffffff[#7CC576Teszt #ffffff- #FFA700Munka#ffffff] Befejezted a #53bfdc\" .. truckruns[vehicle] .. \" #ffffffszállítást.  Fizetséged #FFA700\" .. earned .. \" #ffffffFt.\", client, 255, 0, 0,true)
    --if (earned > 60) then
        --triggerTruckCheatEvent(client, 1, earned)
    --end
   
    if (truckruns[vehicle] == 25) then
        outputChatBox(\"#FF9933A transporter raktere üres! Menj vissza a #CC0000raktárba #FF9933először.\", client, 0, 0, 0, true)
    else
        --outputChatBox(\"#FF9933You can now either return to the #CC0000warehouse #FF9933and obtain your wage\", client, 0, 0, 0, true)
        --outputChatBox(\"#FF9933or continue onto the next #FFFF00drop off point#FF9933 and increase your wage.\", client, 0, 0, 0, true)
        triggerClientEvent( client, \"loadNewCheckpointTruckJob\",  client)
        triggerEvent(\"updateGlobalSupplies\", client, math.random(10,20))
    end
end
addEvent(\"saveDeliveryProgress\", true)
addEventHandler(\"saveDeliveryProgress\", getRootElement(), saveDeliveryProgress)
function triggerTruckCheatEvent(thePlayer, cheatType, value1)
    local cheatStr = \"\"
    if (cheatType == 1) then
        cheatStr = \"Too much earned on one trucking run, (c:\"..value1..\", max 60)\"
    elseif (cheatType == 2) then
        cheatStr = \"Too much earned in total. (c:\"..value1..\", max 1500)\"
    end
    exports.logs:logMessage(\"[saveDeliveryProgress]\".. getPlayerName(thePlayer) .. \" \" .. getPlayerIP(thePlayer) .. \" \".. cheatStr  , 32)
end
function updateNextCheckpoint(vehicle, pointid)
    truckroute[vehicle] = pointid
end
addEvent(\"updateNextCheckpoint\", true)
addEventHandler(\"updateNextCheckpoint\", getRootElement(), updateNextCheckpoint)
function restoreTruckingJob()
    if getElementData(source, \"job\") == 1 then
        triggerClientEvent(source, \"restoreTruckerJob\", source)
    end
end
addEventHandler(\"restoreJob\", getRootElement(), restoreTruckingJob)

 
 
[gmod]Máskor figyelj a [code*] tagre.[/gmod]
« Utoljára szerkesztve: 2016. május 21. - 00:57:24 írta ǝuıןʎʞs »

Csomagszállitó Munka
« Válasz #1 Dátum: 2016. május 29. - 15:56:48 »
0 Show voters
A script alapjában véve nem hoz létre járművet, csak kötődik a 456-os model idhez. Magyarán a végére megírod ezt a cuccot, akkor létrehoz neked egy 456-os járművet, utána beszálsz, ugyanúgy működni fog a munka. Így elkerülöd, hogy az adminoknak kelljen lekérni munka járművet.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal