Tokio Posted March 30, 2018 Share Posted March 30, 2018 function outputChatBoxRemote ( playerName, message, type, serverport ) outputChatBox ( "From " .. playerName .. " on " .. serverport .. ": " .. message ) return "hello sailor" end function finishedCallback( responseData, errno ) responseData = tostring(responseData) if responseData == "ERROR" then outputDebugString( "callRemote: ERROR #" .. errno ) elseif responseData ~= "hello sailor" then outputDebugString( "callRemote: Unexpected reply: " .. responseData ) else end end function playerChat ( message, type ) callRemote ( "87.229.77.40:22030", getResourceName(getThisResource()), "outputChatBoxRemote", finishedCallback, getPlayerName(source), message, type, getServerPort() ) end addEventHandler ( "onPlayerChat", getRootElement(), playerChat ) This is the code, but does not working.. what wrong? Link to comment
Moderators IIYAMA Posted March 30, 2018 Moderators Share Posted March 30, 2018 Did you give it acl rights? Link to comment
Tokio Posted March 30, 2018 Author Share Posted March 30, 2018 1 minute ago, IIYAMA said: Did you give it acl rights? Yes 3 minutes ago, IIYAMA said: Did you give it acl rights? i get "ERROR: #404" in debugscript Link to comment
Moderators IIYAMA Posted March 30, 2018 Moderators Share Posted March 30, 2018 I am not sure if you can call remote to yourself. But the error 404 means not found. So try to ping to the ip, just to check if it available. Also the port is important, just to figure out which port you should use: function playerChat ( message, type ) for port=22000, 22030 do callRemote ( "87.229.77.40:" .. port, getResourceName(getThisResource()), "outputChatBoxRemote", finishedCallback, getPlayerName(source), message, type, getServerPort() ) end end Link to comment
Tokio Posted March 30, 2018 Author Share Posted March 30, 2018 (edited) 18 minutes ago, IIYAMA said: I am not sure if you can call remote to yourself. But the error 404 means not found. So try to ping to the ip, just to check if it available. Also the port is important, just to figure out which port you should use: function playerChat ( message, type ) for port=22000, 22030 do callRemote ( "87.229.77.40:" .. port, getResourceName(getThisResource()), "outputChatBoxRemote", finishedCallback, getPlayerName(source), message, type, getServerPort() ) end end now i do not get error, but the message does not show in another server and my server use 22030 as http port, and this is a hosted server, not localhost Edited March 30, 2018 by 50cent Link to comment
Moderators IIYAMA Posted March 30, 2018 Moderators Share Posted March 30, 2018 Did you make sure you added this to the meta.xml? (on the resource where this function is located) <export function="outputChatBoxRemote" http="true" /> Link to comment
Tokio Posted March 30, 2018 Author Share Posted March 30, 2018 1 minute ago, IIYAMA said: Did you make sure you added this to the meta.xml? (on the resource where this function is located) <export function="outputChatBoxRemote" http="true" /> yes, added Link to comment
Moderators IIYAMA Posted March 30, 2018 Moderators Share Posted March 30, 2018 And what does responseData contain? Link to comment
Tokio Posted March 30, 2018 Author Share Posted March 30, 2018 1 minute ago, IIYAMA said: And what does responseData contain? ERROR #404 Link to comment
Moderators IIYAMA Posted March 30, 2018 Moderators Share Posted March 30, 2018 I think you should do some more digging in the server. Because it is almost as if the Firewall is blocking it. Also check the mta config file at that server, on this: <!-- This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as <serverport>. It is a required parameter if <httpserver> is set to 1. --> <httpport>22005</httpport> Link to comment
Tokio Posted March 30, 2018 Author Share Posted March 30, 2018 2 minutes ago, IIYAMA said: I think you should do some more digging in the server. Because it is almost as if the Firewall is blocking it. Also check the mta config file at that server, on this: <!-- This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as <serverport>. It is a required parameter if <httpserver> is set to 1. --> <httpport>22005</httpport> <!-- This parameter specifies the UDP port on which the server will be accepting incoming player connections; default value: 22003. It is a required parameter. --> <serverport>22030</serverport> <!-- This parameter specifies the number of maximum player slots available on the server; default value: 32. It is a required parameter. --> <maxplayers>40</maxplayers> <!-- This parameter specifies whether the built-in http server will be used. Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter. --> <httpserver>1</httpserver> <!-- This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as <serverport>22030</serverport> if <httpserver> is set to 1. --> <httpport>22030</httpport> Link to comment
Moderators IIYAMA Posted March 30, 2018 Moderators Share Posted March 30, 2018 hmm, well to figure out the problem, should start with try the same thing on another (2) server(s). Just to be sure that it isn't the server. Link to comment
Tokio Posted March 30, 2018 Author Share Posted March 30, 2018 9 minutes ago, IIYAMA said: hmm, well to figure out the problem, should start with try the same thing on another (2) server(s). Just to be sure that it isn't the server. i tried with another server, but does not working too Link to comment
Moderators IIYAMA Posted March 30, 2018 Moderators Share Posted March 30, 2018 Maybe you could ask it to somebody who already has done it, or the one who created the wiki topic. I am very sure those guys are out there. 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