Попробуй что-то типо этого, но я не проверял в игре.
Gate1 = createObject ( 8948, 2790, 2618.69995, 11.6, 0, 0, 90 )
GarageStatus = false
function setMyGate (toggle)
if toggle == true then
moveObject ( Gate1, 3000, 2797.2, 2618.69995, 11.6, 0, 0, 0 )
GarageStatus = true
else
moveObject ( Gate1, 3000, 2790, 2618.69995, 11.6, 0, 0, 0 )
GarageStatus = false
end
end
function openMyGate ( player )
if GarageStatus == false then
if getPlayerMoney( player ) >= 500 then
takePlayerMoney( player, 500 )
outputChatBox("Вы использовали автогараж. Со счета снято 500$.", player)
setMyGate(true)
else
outputChatBox("Не хватает денег...", player)
end
else
outputChatBox("Гараж уже открыт.", player)
end
end
addCommandHandler("og", openMyGate)
function closeMyGate ( player )
if GarageStatus == true then
setMyGate(false)
end
end
addCommandHandler("cg", closeMyGate)