Witam, chcia?bym aby ten kod sprawdza? czy dany gracz jest w grupie acl "Admin"
[code]
playerAcc = getPlayerAccount(source)
if isObjectInACLGroup("user."..getAccountName(playerAcc), aclGetGroup("Admin")) then
[/code]
W tym kodzie, nie wiem od czego zale?y jego miejsce i gdzie go wstawi? w ten aktualny... my?l? ju? nad tym dwa dni i dalej nie wiem
[lua]
addCommandHandler("sp", function(gracz, cmd, auto)
local model = getVehicleModelFromName(auto)
local x, y, z = getElementPosition(gracz)
local rx, ry, rz = getElementRotation(gracz)
local dimension = getElementDimension(gracz)
local interior = getElementInterior(gracz)
if not model then
outputChatBox("Wpisz: /sp <model pojazdu> Przyk?ad: /sp bullet", gracz, 255, 255, 255, true)
else
local pojazd = createVehicle(model, x, y, z, rx, ry, rz)
setElementDimension(pojazd, dimension)
setElementInterior(pojazd, interior)
setElementData(pojazd, "KtoZrespilAuto", getPlayerName(gracz))
setVehiclePlateText(pojazd, "EasyLifeRPG")
warpPedIntoVehicle(gracz, pojazd)
end
end)
addCommandHandler("spu", function(gracz)
for i, v in ipairs(getElementsByType("vehicle")) do
if getElementData(v, "KtoZrespilAuto") == getPlayerName(gracz) then
destroyElement(v)
end
end
end)
[/lua]
Oczywi?cie daje zimne piwko! Mam nadziej?, ?e pisze w dobrym...
Hejka! Ten kod spawnuje pojazd, od razu przenosi gracza do niego jako kierowce, nie rozumiem dzia?ania tej tablicy "new spawned_vehicles[MAX_PLAYERS];"
z reszt? kodu, czy m?g?by kto? prosz? wyt?umaczy? mi w jaki spos?b to dzia?a i zast?puj? ID pojazdu z tego?: "spawned_vehicles[playerid] = CreateVehicle(vmodel, posX, posY, posZ, 0.0, 0, 0, 1000, siren);"