Zloy_Sprite Posted August 20, 2012 Share Posted August 20, 2012 local a51gate1 = createObject ( 2929, 215.99548339844, 1875.40234375, 13.938992500305, 0, 0, 0 ) local a51gate2 = createObject ( 2929, 211.94564819336, 1875.40234375, 13.938992500305, 0, 0, 0 ) addEventHandler ( "onPlayerCommand", root, function ( command ) if ( command == "opengate" ) then if getElementModel ( thePlayer ) == 283,284 then moveObject (a51gate1, 5000, 218.99548339844, 1875.40234375, 13.938992500305 ) moveObject (a51gate2, 5000, 208.94564819336, 1875.40234375, 13.938992500305 ) outputChatBox ("Ворота открыты!", source) end elseif ( command == "closegate" ) then -- команда для закрытия ворот if getElementModel ( thePlayer ) == 283,284 then moveObject ( a51gate1, 5000, 215.99548339844, 1875.40234375, 13.938992500305 ) moveObject ( a51gate2, 5000, 211.94564819336, 1875.40234375, 13.938992500305 ) outputChatBox ("Ворота закрыты!", source) end end end ) Что не правильно в скрипте?Помогите пожалуйста;DD Весь день пытался сделать,нужно чтобы ворота открытились когда у человека стоит скин 283 и 284:D Заранее спасибо Link to comment
Vamp1r Posted August 20, 2012 Share Posted August 20, 2012 local a51gate1 = createObject ( 2929, 215.99548339844, 1875.40234375, 13.938992500305, 0, 0, 0 ) local a51gate2 = createObject ( 2929, 211.94564819336, 1875.40234375, 13.938992500305, 0, 0, 0 ) addEventHandler ( "onPlayerCommand", getRootElement(), function ( command ) if ( command == "opengate" ) then if getElementModel ( source ) == 283 or getElementModel ( source ) == 284 then moveObject (a51gate1, 5000, 218.99548339844, 1875.40234375, 13.938992500305 ) moveObject (a51gate2, 5000, 208.94564819336, 1875.40234375, 13.938992500305 ) outputChatBox ("Ворота открыты!", source) end elseif ( command == "closegate" ) then -- команда для закрытия ворот if getElementModel ( source ) == 283 or getElementModel ( source ) == 284 then moveObject ( a51gate1, 5000, 215.99548339844, 1875.40234375, 13.938992500305 ) moveObject ( a51gate2, 5000, 211.94564819336, 1875.40234375, 13.938992500305 ) outputChatBox ("Ворота закрыты!", source) end end end ) И по-моему, событие onPlayerCommand, вызывается когда пользователь ввел команду не в чат, а в консоль (~). Если конечно не изменяет память. 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