Szerző Téma: Csomagszállító meló  (Megtekintve 542 alkalommal)

Csomagszállító meló
« Dátum: 2014. július 18. - 13:57:04 »
0 Show voters
Sziasztok Jó arcok ! :D
Van nekem egy csomagszállító melóm 1 baj van vele ,hogy:
Mikor leadom a csomagokat a piros cpnél akkor nem reseteli a csomagok számát 0ra.
 
   local lockTimer = nil
local truckruns = { }
local truckwage = { }
local truckroute = { }
local truck = { [414] = true ,[456] = true,[482] = true}
function giveTruckingMoney(vehicle)
outputChatBox(\"Kaptál \" .. ( truckwage[vehicle] or 0 ) .. \" FT-t a szállításokért.\", source, 255, 194, 15)
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(\"Befejezted a \" .. truckruns[vehicle] .. \" szállítást.  Fizetséged \" .. earned .. \" FT.\", client, 0, 255, 0)
--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)

 
ja meg amit beleírtam kocsikat azzal nem mûködik a mleó miért  ?:S
+ valaki beletudná írni ha leadom a cpbe akkor a kocsit kispawnolja alólam?:D és oda tegye egy helyre majd én megadom a pozíciót. .:\'D

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal