Jump to content

Link Servers, Need help from 0!


baruffa123

Recommended Posts

Here you go, Try this one :)

The Script :

marker = createMarker( X, Y, Z, "cylinder", 1.5, 210, 0, 0, 255 ) 
IP =  
Port =  
  
addEventHandler( "onMarkerHit", marker 
    function ( player ) 
        if ( getElementType ( player ) == "player" ) then 
            redirectPlayer( player, IP, Port ) 
        end 
    end 
) 

And the meta.xml :

  

    "redirect" author="baruffa123" version="1.0"/> 
    

Here is what to do :

At the first line, Replace X, Y, Z by the marker coordinates ( You can get it from the Admin Panel in the game )

Place your server IP after ( IP = ) at line 2

And place you server port after ( Port = ) at line 3

And it should work :D

P.S. : The Script name MUST BE Redirect ( Like in the meta.xml code ), Or else it wont work .

Link to comment

^^

You forgot the comma in the event and you have some simple mistakes should to be :

-- Server Side : 
marker = createMarker( X, Y, Z, "cylinder", 1.5, 210, 0, 0, 255 ) 
IP = "You,re IP" 
Port = "You,re Port" 
  
addEventHandler( "onMarkerHit", marker , 
    function (player) 
        if ( getElementType (player) == "player" ) then 
            redirectPlayer (player,IP,tonumber(Port))  
        end 
end 
) 

Should Have Admin Rights .

Link to comment

marker creates, but when going thru it nothing happens!

My lua.

-- Server Side : 
marker = createMarker( 2504.8000488281, -1669.9000244141, 13.39999961853, "cylinder", 1.5, 210, 0, 0, 255 ) 
IP = "190.194.32.159" 
Port = "22003" 
  
addEventHandler( "onMarkerHit", marker , 
    function (player) 
        if ( getElementType (player) == "player" ) then 
            redirectPlayer (player, "88.198.11.8", tonumber("31338")) 
        end 
end 
) 

my meta:

<meta> 
    <info name="redirect" author="baruffa123" version="1.0"/> 
    <script src="Redirect.lua" type="server"/> 
    <object name="resource.admin"></object> 
</meta> 

whats wrong? thanks!

Edit: when going thru marker console says: redirect\redirect.lua:9: access denied @ redirectPlayer.

why is this?

Link to comment

Your code is completely messed up.

1st. Use local variables whenever you can;

2nd. Why is this:

Port = "22003" 

..needed if you are doing this?

tonumber ( "31338" ) 

It doesn't even make sense. Either use the variable or write the port number directly in the function, without tonumber or as string.

redirectPlayer ( player, "88.198.11.8", 31338 ); 

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