MX_Master Posted August 1, 2011 Posted August 1, 2011 Вот еще какой момент. Можно ли сделать так, чтобы debug window открывалось автоматически, без необходимости вводить команду? я не уверен, но можно серверно попробовать executeCommandHandler ( 'debugscript', player, '3' ) при условии, что игрок залогинился и админ topcnc.ru # vydrenko.ru
lil Toady Posted August 1, 2011 Author Posted August 1, 2011 Нельзя через executeCommandHandler вызывать встроенные команды мта. Но можно для удобства сделать бинд на какую-нибудь кнопку. "/bind f2 debugscript 3" Do not PM me, im not going to read it anyway.
Antibird Posted August 1, 2011 Posted August 1, 2011 Но можно для удобства сделать бинд на какую-нибудь кнопку. "/bind f2 debugscript 3" Благодарю.
MX_Master Posted August 1, 2011 Posted August 1, 2011 Нельзя через executeCommandHandler вызывать встроенные команды мта. Но можно для удобства сделать бинд на какую-нибудь кнопку. "/bind f2 debugscript 3" какая жаль, а почему? все-таки серверный скрипт вызывает серверную команду (я так думаю) кстати, бинд комбинации кнопок нельзя с консоли сделать? topcnc.ru # vydrenko.ru
lil Toady Posted August 2, 2011 Author Posted August 2, 2011 Тоади, доделай плиз триггеры Завтра сделаю, я код уже давно написал и он уже давно на svn. Просто надо перекинуть пару файлов чтобы он и клиентскую часть покрыл. Do not PM me, im not going to read it anyway.
StUNt71 Posted August 4, 2011 Posted August 4, 2011 Можно как-нибудь педа(NPC) заставить стрелять? Sorry for my bad english!
Nodward_Nichrome Posted August 4, 2011 Posted August 4, 2011 можно заставить педа делать все, что он умеет делать в сингле, главное иметь нужные знания и терпение. вот пример ресурса: https://community.multitheftauto.com/ind ... ils&id=672 Resources: Simple pistol silencer Vending machines system
_Vincent_ Posted August 5, 2011 Posted August 5, 2011 Сколько будет MTA-серв на Linux при 16 игроках жрать ресурсов?
MX_Master Posted August 6, 2011 Posted August 6, 2011 Сколько будет MTA-серв на Linux при 16 игроках жрать ресурсов? если мод типа freeroam, то 32 МБ ОЗУ и крошечку от проца если полноценный ДМ/ТДМ, то в два раза больше topcnc.ru # vydrenko.ru
killer100 Posted August 6, 2011 Posted August 6, 2011 Объясните пожалуйста что это за ошибка, и как её исправить? ERROR: script\script.lua:62: attempt to call global 'aclGetAccount' (a nil value)
Arisu Posted August 6, 2011 Posted August 6, 2011 (edited) Где ты нашел такую функцию? Есть либо getAccount, либо aclGet. Что выбирать, смотри по ситуации. Edited August 6, 2011 by Guest
killer100 Posted August 6, 2011 Posted August 6, 2011 Попробовал с getAccount, теперь пишет вот такую ошибку: WARNING: script\script.lua:62: Bad argument @ 'getAccount' WARNING: script\script.lua:71: Bad argument @ 'getAccount'
Arisu Posted August 6, 2011 Posted August 6, 2011 Да покажи же ты, что там за script.lua:62 и :71. Я не практикую гадание по рунам.
_Vincent_ Posted August 6, 2011 Posted August 6, 2011 https://wiki.multitheftauto.com/wiki/Ser ... _functions Потыкай по функциям account'ным и почитай какая и для чего и, исходя из того, что у тебя имеется и что тебе нужно, выбери соответствующую(ие).
killer100 Posted August 6, 2011 Posted August 6, 2011 В общем вот мой скрипт, нерабочий, помогите пожалуйста что бы он работал. addCommandHandler("arg", function (thePlayer, theCommand, theTarget) if (theTarget ~= "all") then if ( ( getAccount ( thePlayer ) ) and ( hasObjectPermissionTo ( getAccount ( thePlayer ), "command."..theCommand ) ) ) then playerName = getPlayerNameShort(thePlayer, theTarget) adminName = getPlayerName(thePlayer) theTarget = getPlayerFromName(playerName) theVehicle = getPedOccupiedVehicle(getPlayerFromName(playerName)) local bX, bY, bZ = getElementPosition(getPlayerFromName(playerName)) theRamp2 = createObject(1632, bX, bY, bZ, 0, 0, 0) attachElements(theRamp2, theVehicle) outputChatBox(adminName .. " gives ramp to " .. playerName .. "!", getRootElement(), 255, 255, 0) elseif ( ( getAccount ( thePlayer ) ) and ( hasObjectPermissionTo ( getAccount ( thePlayer ), "command.argall" ) ) ) then adminName = getPlayerName(thePlayer) outputChatBox(adminName .. " gives ramp to everyone!", getRootElement(), 255, 255, 0) for i,thePlayer in ipairs(getElementsByType('player')) do playerName = getPlayerName(thePlayer) theVehicle = getPedOccupiedVehicle(getPlayerFromName(playerName)) local bX, bY, bZ = getElementPosition(getPlayerFromName(playerName)) theRamp2 = createObject(1632, bX, bY, bZ, 0, 0, 0) attachElements(theRamp2, theVehicle) end else outputChatBox("ERROR: Syntax error or access blocked", thePlayer, 255, 0, 0) end else outputChatBox("ACL: Access to /" .. theCommand .. " denied for your group", thePlayer, 255, 0, 0) end end )
MX_Master Posted August 6, 2011 Posted August 6, 2011 getAccount ( thePlayer ) заменить на thePlayer topcnc.ru # vydrenko.ru
_Vincent_ Posted August 6, 2011 Posted August 6, 2011 А тот единственный неразрешенный баг в родмапе - последний, или еще что-то более серьезное решается, не объявленное на багтрекере?
MX_Master Posted August 6, 2011 Posted August 6, 2011 это еще решится, ща просто идут тесты и решение багов при этих тестах topcnc.ru # vydrenko.ru
killer100 Posted August 7, 2011 Posted August 7, 2011 getAccount ( thePlayer ) заменить на thePlayer Сделал, но похоже что то не правильно и он снова не работает, вот такая ошибка: WARNING: script\script.lua:3: Bad argument @ 'hasObjectPermissionTo' ERROR: script\script.lua:3: attempt to call a nil value Скрипт: addCommandHandler("arg", function (thePlayer, theCommand, theTarget) if ((thePlayer) and ( hasObjectPermissionTo (thePlayer)) "command."..theCommand ) then if (theTarget ~= "all") then playerName = getPlayerNameShort(thePlayer, theTarget) adminName = getPlayerName(thePlayer) theTarget = getPlayerFromName(playerName) theVehicle = getPedOccupiedVehicle(getPlayerFromName(playerName)) local bX, bY, bZ = getElementPosition(getPlayerFromName(playerName)) theRamp2 = createObject(1632, bX, bY, bZ, 0, 0, 0) attachElements(theRamp2, theVehicle) outputChatBox(adminName .. " gives ramp to " .. playerName .. "!") adminName = getPlayerName(thePlayer) outputChatBox(adminName .. " gives ramp to everyone!") elseif ((thePlayer) and ( hasObjectPermissionTo (thePlayer)) "command.argall" ) then for i,thePlayer in ipairs(getElementsByType('player')) do playerName = getPlayerName(thePlayer) theVehicle = getPedOccupiedVehicle(getPlayerFromName(playerName)) local bX, bY, bZ = getElementPosition(getPlayerFromName(playerName)) theRamp2 = createObject(1632, bX, bY, bZ, 0, 0, 0) attachElements(theRamp2, theVehicle) end else outputChatBox(thePlayer,"ERROR: Syntax error or access blocked") end else outputChatBox(thePlayer,"ACL: Access to /" .. theCommand .. " denied for your group") end end )
Arisu Posted August 7, 2011 Posted August 7, 2011 Думаю тебе не хватает редактора с хорошей подсветкой синтаксиса. Если приглядеться, то в строке if ((thePlayer) and ( hasObjectPermissionTo (thePlayer)) "command."..theCommand ) then hasObjectPermissionTo (thePlayer)) "command."..theCommand ) thePlayer)) "command."..theCommand имеется лишняя скобка и недостает запятой. Исправляем на if ((thePlayer) and ( hasObjectPermissionTo (thePlayer, "command."..theCommand) ) then . И вообще я считаю, что юзать лишние скобки в условиях в lua - моветон, если можно записать if (expression) then как if expression then , то зачем ухудшать читаемость и создавать себе лишние проблемы? (при этом никто не запрещает группировать условия скобками. т.к. это необходимость)
Kenix Posted August 7, 2011 Posted August 7, 2011 killer100,пользуйся LuaEdit или MTA script editor'ом. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
killer100 Posted August 7, 2011 Posted August 7, 2011 killer100,пользуйся LuaEdit или MTA script editor'ом. А где их скачать? Дай ссылку пожалуйста.
MX_Master Posted August 7, 2011 Posted August 7, 2011 И вообще я считаю, что юзать лишние скобки в условиях в lua - моветон Я с Вами категорически согласен, коллега. И когда он говорил, что это его скрипт, я понял, что это не его скрипт. topcnc.ru # vydrenko.ru
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now