Jump to content

Some questions


Recommended Posts

Hi everyone,

I've some questions and I hope you have the answer.

The first one is, how I can get the server IP where the script is executed? I search for a function talking about that but I can't find it. Why it doesn't exist?

Second question is about an script i've seen on the wiki and I would love to use it's that:

function outputChatBoxRemote ( playerName, message, type, serverport ) 
    if serverport ~= getServerPort() then 
        outputChatBox ( "From " .. playerName .. " on " .. serverport .. ": " .. message ) 
    end 
end 
  
function playerChatCallback() 
end 
  
function playerChat ( message, type ) 
    callRemote ( "play.mtabeta.com:33004", getResourceName(getThisResource()), "outputChatBoxRemote", playerChatCallback, getPlayerName(source), message, type, getServerPort() ) 
    callRemote ( "play.mtabeta.com:33005", getResourceName(getThisResource()), "outputChatBoxRemote", playerChatCallback, getPlayerName(source), message, type, getServerPort() ) 
    callRemote ( "play.mtabeta.com:33006", getResourceName(getThisResource()), "outputChatBoxRemote", playerChatCallback, getPlayerName(source), message, type, getServerPort() ) 
end 
addEventHandler ( "onPlayerChat", getRootElement(), playerChat ) 

Link: https://wiki.multitheftauto.com/wiki/CallRemote

I've read the instructions but this still not working.

Last question, with the script below. It only works with servers who have the same IP with differents ports?

I hope you can help me guys :D

Link to comment
Added the resource to acl.xml?

Well, of course i've added the resource to the ACL but in the Admin group.

They say to create an group for that resource, I think it's useless cuz the Admin group got all rights.

  
<group name="OutRPCGroup"> 
    <acl name="OutRPC" /> 
    <object name="resource.examplechat" /> 
</group> 
<acl name="OutRPC"> 
    <right name="function.callRemote" access="true" /> 
</acl> 
  

  
<group name="InRPCGroup"> 
    <acl name="InRPC" /> 
    <object name="user.http_guest" /> 
</group> 
<acl name="InRPC"> 
    <right name="resource.examplechat.http" access="true" /> 
</acl> 
  

The script still not working.

And about the 2 other questions?

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...