Не правильно работает скрипт, когда я прописываю команду /veh ID у меня все нормально, когда я администратор, но если ее прописать обычному игроку то выводит сообщение "Вы не являетесь администратором", но все равно спавнит машину.
Но вторая функция у меня работает нормально, где команда /delveh
function createVehicleForPlayer(thePlayer, command, vehicleModel)
local x,y,z = getElementPosition(thePlayer)
x = x + 3
local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
if (createdVehicle == false) then
outputChatBox("*/veh Такого ID Т/C не существует", thePlayer, 255, 215, 0)
else
outputChatBox("*/veh Т/C заспавнено", thePlayer, 255, 215, 0)
end
else
outputChatBox("Вы не являетесь администратором", thePlayer,255, 215, 0, true)
end
end
addCommandHandler("veh", createVehicleForPlayer)
function vehicleDel ( thePlayer )
local theVehicle = getPedOccupiedVehicle ( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
if theVehicle then
destroyElement(theVehicle)
outputChatBox ( "*/delveh Т/C удалено", thePlayer, 255, 215, 0 )
else
outputChatBox ( "*/delveh Вы не находитесь в Т/C", thePlayer, 255, 215, 0, true )
end
else
outputChatBox("Вы не являетесь администратором", thePlayer,255, 215, 0, true)
end
end
addCommandHandler ( "delveh", vehicleDel )
Заранее спасибо :3