GoldRupert Posted January 13, 2015 Share Posted January 13, 2015 Все привет,ребята помогите я уже два дня мудрю не как не могу понять в чем дело ворота появляются но по скину не открываются,пожалуйста помогите( local gate = createObject(10841, 2595.5, -2140.3000488281,6.9000000953674 ) local gatecol = createColCircle ( 2595.5, -2140.3000488281, 25 ) --Co-Ordinates "X" and "Y" and the radius, I use 15 as default. function openagates(thePlayer) if getElementModel ( thePlayer ) == 217 then --Will open only if the player is in the male staff skin moveObject ( gate, 6000, 2618.3000488281, -2140.3000488281, 6.9000000953674, 0, 0, 0 ) --The speed in which 7000 is slow and 2000 is fast to open, Co-Ordinates for the gate to move to. end end addEventHandler( "onColShapeHit", gatecol, openagates ) function closeagates(thePlayer) if getElementModel( thePlayer ) == 217 then --Will close only if the player is in the male staff skin moveObject (gate, 6000, 2595.5, -2140.3000488281,6.9000000953674) --The speed in which 7000 is slow and 1000 is fast to open, Co-Ordinates for the gate to close. end end addEventHandler( "onColShapeLeave", gatecol, closeagates ) Link to comment
FranklinRoosevelt Posted January 13, 2015 Share Posted January 13, 2015 Колшелп реагирует на вход/выход? Я не особо спец в колшелпах, но все же попробуй создать его с помощью https://wiki.multitheftauto.com/wiki/CreateColRectangle Link to comment
AMARANT Posted January 15, 2015 Share Posted January 15, 2015 Все привет,ребята помогите я уже два дня мудрю не как не могу понять в чем дело ворота появляются но по скину не открываются,пожалуйста помогите( Что же у тебя не так? Посмотри где твой кулшейп и проверь ты действительно находишься в нем или может быть нет? Визуализируй его с помощью команды /showcol 1. Link to comment
Elengar Posted January 15, 2015 Share Posted January 15, 2015 Визуализируй его с помощью команды /showcol 1. Для автора: Для использования нужно где-нибудь на клиенте выполнить setDevelopmentMode( true ) Link to comment
PauloCascus Posted January 20, 2015 Share Posted January 20, 2015 попробуй сделать на клиентской стороне скорее всего у тебя игрок не определяется как thePlayer что написано в debugscript ? addEventHandler("onClientResourceStart", getRootElement(), function() setDevelopmentMode(true) end) local gate = createObject(10841, 2595.5, -2140.3000488281,6.9000000953674 ) local colshape = createColCircle ( 2595.5, -2140.3000488281, 25 ) function moveUp() if ( getElementModel(localPlayer) == 217 ) then moveObject( gate, 6000, 2618.3000488281, -2140.3000488281, 6.9000000953674, 0, 0, 0 ) else return false end end addEventHandler("onClientColshapeHit", colshape, moveUp) function moveBack() if ( getElementModel( localPlayer ) == 217 ) then moveObject( moveObject (gate, 6000, 2595.5, -2140.3000488281,6.9000000953674) else return false end end addEventHandler("onClientColShapeLeave", colshape, moveBack) Link to comment
Elengar Posted January 21, 2015 Share Posted January 21, 2015 попробуй сделать на клиентской сторонескорее всего у тебя игрок не определяется как thePlayer что написано в debugscript ? addEventHandler("onClientResourceStart", getRootElement(), function() setDevelopmentMode(true) end) local gate = createObject(10841, 2595.5, -2140.3000488281,6.9000000953674 ) local colshape = createColCircle ( 2595.5, -2140.3000488281, 25 ) function moveUp() if ( getElementModel(localPlayer) == 217 ) then moveObject( gate, 6000, 2618.3000488281, -2140.3000488281, 6.9000000953674, 0, 0, 0 ) else return false end end addEventHandler("onClientColshapeHit", colshape, moveUp) function moveBack() if ( getElementModel( localPlayer ) == 217 ) then moveObject( moveObject (gate, 6000, 2595.5, -2140.3000488281,6.9000000953674) else return false end end addEventHandler("onClientColShapeLeave", colshape, moveBack) И что из этого выйдет на клиенте ? Открытие ворот только у данного игрока ? А еще у тебя во второй функции плохой копипаст. В коде ТС вроде бы всё нормально, с thePlayer уж точно. Может быть не работает из-за плохой загрузки ресурса. Link to comment
PauloCascus Posted January 21, 2015 Share Posted January 21, 2015 возможно... а может с позицией колшейпа накасячил Link to comment
Diz100rM Posted January 22, 2015 Share Posted January 22, 2015 Я один оказался самым глазастым local gate = createObject(10841, 2595.5, -2140.3000488281,6.9000000953674 ) local gatecol = createColCircle ( 2595.5, -2140.3000488281, 25 ) --Co-Ordinates "X" and "Y" and the radius, I use 15 as default. function openagates(thePlayer) if getElementModel ( thePlayer ) == 217 then --Will open only if the player is in the male staff skin moveObject ( gate, 6000, 2618.3000488281, -2140.3000488281, 6.9000000953674 ) --The speed in which 7000 is slow and 2000 is fast to open, Co-Ordinates for the gate to move to. end end addEventHandler( "onColShapeHit", gatecol, openagates ) function closeagates(thePlayer) if getElementModel( thePlayer ) == 217 then --Will close only if the player is in the male staff skin moveObject (gate, 6000, 2595.5, -2140.3000488281,6.9000000953674) --The speed in which 7000 is slow and 1000 is fast to open, Co-Ordinates for the gate to close. end end addEventHandler( "onColShapeLeave", gatecol, closeagates ) Вот рабочий код =) Но в чем ошибка спросите вы? А я вам отвечу! moveObject ( gate, 6000, 2618.3000488281, -2140.3000488281, 6.9000000953674, 0, 0, 0 ) в данной строке! После удаления последних трех аргументов которые отвечают за разворот я добился работоспособности скрипта без ошибок) Таким образом строчка должна выглядеть так moveObject ( gate, 6000, 2618.3000488281, -2140.3000488281, 6.9000000953674) ЗЫ Ко всему прочему в коде одинаковые позиции как при вхождении в колшейп так и при выходе, тоесть ворота некуда не уедут потому что им не сказали куда смещаться! Link to comment
Elengar Posted January 22, 2015 Share Posted January 22, 2015 Я один оказался самым глазастым После удаления последних трех аргументов которые отвечают за разворот я добился работоспособности скрипта без ошибок) В ТС, вроде бы, проблема с колшейпом была... Link to comment
obuhhh Posted February 9, 2015 Share Posted February 9, 2015 1. На серве все это делай. 2. Соурс этих ивентов - машина или игрок(делай проверку) 3. Нулики лишние в движении, я думаю. Link to comment
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