- Katılım
- 4 yıl 7 ay 11 gün
- Mesajlar
- 151
Adminler için araç tamir kodu
client.lua
Kod:
RegisterCommand('carfix', function(source, args, raw)
ESX.TriggerServerCallback("geni_base:getGroup", function(grup)
if grup == "admin" then
local playerVehicle = GetVehiclePedIsIn(player, false)
SetVehicleEngineHealth(playerVehicle, 1000)
SetVehicleEngineOn(playerVehicle, true, true)
SetVehicleFixed(playerVehicle)
SetVehicleDirtLevel(playerVehicle, 0)
end
end)
end)
server.lua
Kod:
ESX.RegisterServerCallback("geni_base:getGroup", function(source, cb)
local player = ESX.GetPlayerFromId(source)
if player ~= nil then
local playerGroup = player.getGroup()
if playerGroup ~= nil then
cb(playerGroup)
else
cb("user")
end
else
cb("user")
end
end)
Son düzenleme: