Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Frigiv et køretøj
- local ch_free_vehicle = {function(player,choice)
- vRP.prompt(player,"Hvad er nummerpladen på køretøjet du vil frigive?","",function(player, plate)
- if plate ~= "" then
- vRP.prompt(player,"Skal personen betale et gebyr? (ja/nej)","",function(player,answer)
- if string.lower(answer) == "ja" then
- vRPclient.getNearestPlayers(player,{15},function(nplayers)
- local user_list = ""
- for k,v in pairs(nplayers) do
- user_list = user_list .. "[" .. vRP.getUserId({k}) .. "]" .. GetPlayerName(k) .. " | "
- end
- if user_list ~= "" then
- vRP.prompt({player,"Spillere tæt på:" .. user_list,"",function(player,target_id)
- if target_id ~= nil and target_id ~= "" then
- vRP.prompt({player,"Gebyr størrelse:","1000",function(player,gebyr)
- if gebyr ~= nil and gebyr ~= "" then
- local target = vRP.getUserSource({tonumber(target_id)})
- if target ~= nil then
- if tonumber(gebyr) < 100 then
- gebyr = 100
- end
- MySQL.query("vRP/police_get_vehicle", {plate = plate}, function(rows, affected)
- if #rows > 0 then
- if vRP.tryFullPayment({tonumber(target_id), tonumber(gebyr)}) then
- vRP.updateVehicleConfi(plate,0)
- TriggerClientEvent("pNotify:SendNotification", player,{text = "Personen betalte gebyret og køretøj er nu frigivet", type = "success", queue = "global", timeout = 4000, layout = "bottomCenter",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
- TriggerClientEvent("pNotify:SendNotification", target,{text = "Du betalte et gebyr for at få dit køretøj frigivet", type = "warning", queue = "global",timeout = 4000, layout = "bottomCenter",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"},killer = true})
- else
- TriggerClientEvent("pNotify:SendNotification", player,{text = {lang.money.not_enough()}, type = "info", queue = "global",timeout = 4000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"},killer = true})
- end
- else
- TriggerClientEvent("pNotify:SendNotification", player,{text = "Det indtastede køretøj eksistere ikke.", type = "error", queue = "global", timeout = 4000, layout = "bottomCenter",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
- end
- end)
- else
- TriggerClientEvent("pNotify:SendNotification", player,{text = "~r~ID Ugyldigt.", type = "info", queue = "global",timeout = 4000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"},killer = true})
- end
- else
- TriggerClientEvent("pNotify:SendNotification", player,{text = "Du skal indtaste beløb.", type = "info", queue = "global",timeout = 4000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"},killer = true})
- end
- end})
- else
- TriggerClientEvent("pNotify:SendNotification", player,{text = "Du har ikke indtastet spiller ID.", type = "info", queue = "global",timeout = 4000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"},killer = true})
- end
- end})
- else
- TriggerClientEvent("pNotify:SendNotification", player,{text = "Ingen spiller i nærheden.", type = "info", queue = "global",timeout = 4000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"},killer = true})
- end
- end)
- else
- vRP.updateVehicleConfi(plate,0)
- TriggerClientEvent("pNotify:SendNotification", player,{text = "Køretøj frigivet med ingen gebyrer", type = "error", queue = "global", timeout = 5000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
- end
- end)
- else
- TriggerClientEvent("pNotify:SendNotification", player,{text = "Frigivelsen er blevet annulleret da du ikke skrev nogen nummerplade", type = "error", queue = "global", timeout = 4000, layout = "bottomCenter",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
- end
- end)
- end, "Frigiv en spillers køretøj"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement