Jump to content

Запрос выполнения серверной функции со стороны клиента


Recommended Posts

Доброго времени суток. Пытался выполнить запрос к функции со стороны клиента

Код клиента:

elseif command == "/test" then 
    local thePlayer = getPlayerSkin ( getLocalPlayer()) 
    triggerServerEvent("onClientCallsServerFunction", thePlayer, thePlayer, openls_gate) 
        return true 

Код сервера:

function openls_gate(thePlayer) 
local p_model = getElementModel( thePlayer ) 
if ( p_model == 285 ) or ( p_model == 288 ) or ( p_model == 265 ) then 
       moveObject (ls_gate1, 1000, 1541.8000488281, -1627.9000244141, 11.699999809265, 0, 0, 0 ) 
       outputChatBox ("Ворота открыты", thePlayer, 230, 100, 100 ) 
end 
end 
addCommandHandler ( "lsopen", openls_gate ) 
addEvent("onClientCallsServerFunction", true) 
addEventHandler("onClientCallsServerFunction", thePlayer , openls_gate) 

Подскажите пожалуйста где я накосячил ибо скрипт не выполняется(

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...