Jump to content

[HELP]LUA REDIRECT


Recommended Posts

Posted (edited)
function redirect() -- You not added source to arguments function. 
redirectPlayer(source, "94.23.38.142", tonumber(22006)) -- Why convert number to number in this case? 
end 
addCommandHandler("freeroam",redirect) 

JasperRieken Read comments.

Edited by Guest

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted (edited)
function redirect(playerSource)  
redirectPlayer (playerSource, "94.23.38.142", tonumber(22006)) 
end 
addCommandHandler("freeroam",redirect) 

worked for me

Edited by Guest

Diet with russian vodka, lose 3 days in one week !

Posted

source is not defined in arguments command handler-function!

3 argument should be number ( not string ).

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted (edited)

Why convert number to number in this case?

tonumber(22006) 

:?:

Edited by Guest

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted
function redirect()  
redirectPlayer(source, "94.23.38.142", "22006") 
end 
addCommandHandler("freeroam",redirect) 

That doesn't work for me

Copy my code again.

Kenix:

on the wiki is

redirectPlayer (playerSource, serverIP, tonumber(serverPort)) 

Diet with russian vodka, lose 3 days in one week !

Posted (edited)

In your code you convert number to number. It's not needed. In Wiki example string converted to number.

Edited by Guest

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted
In your code you convert number to number. It's not needed. In Wiki example string converted to number.

Oh ok. Thanks for letting me know

Diet with russian vodka, lose 3 days in one week !

Posted

Handler function parameters

player playerSource, string commandName, [string arg1, string arg2, ...] 

I guess you understand :wink:

Correct code

addCommandHandler( 'freeroam', 
    function( pPlayer ) 
        redirectPlayer( pPlayer, '94.23.38.142', 22006 ) 
    end 
) 

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

Thanks, this one works only the chat thing doesn't :o both of the outputchatbox don't work

function redirect1(player)  
redirectPlayer(player, "94.23.38.142", "22003") 
outputChatBox ("*#000000  [ #FF0000"..getPlayerName(source) .." #000000]#FFFF00 Has turning to the Zombie Server #ff0000!!",getRootElement(), 255, 0, 0, true ) 
end 
addCommandHandler("zombie",redirect1) 
  
function chat() 
  outputChatBox ("#FFff00~@  #00bbccTyp #000000[ #ff0000/zombie #000000] #00bbccTo connect to The#000000: #ff0000Zombie #00bbccServer #ffff00 @~",getRootElement(), 255, 255, 255, true ) 
end 
setTimer ( chat, 60000, 0) 

Posted
function redirect1(player)  
redirectPlayer(player, "94.23.38.142", "22003") -- 22003 should be number ( not string ) i said about this 
outputChatBox ("*#000000  [ #FF0000"..getPlayerName(source) .." #000000]#FFFF00 Has turning to the Zombie Server #ff0000!!",getRootElement(), 255, 0, 0, true ) -- source not defined here. You should use player variable. 
end 
addCommandHandler("zombie",redirect1) 
  
function chat() 
  outputChatBox ("#FFff00~@  #00bbccTyp #000000[ #ff0000/zombie #000000] #00bbccTo connect to The#000000: #ff0000Zombie #00bbccServer #ffff00 @~",getRootElement(), 255, 255, 255, true ) 
end 
setTimer ( chat, 60000, 0) 

Read comments.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

Try This

  
addCommandHandler( 'zombie', 
function ( pPlayer ) 
redirectPlayer( pPlayer, "94.23.38.142", 22003) 
outputChatBox ("*#000000  [ #FF0000"..getPlayerName(pPlayer) .." #000000]#FFFF00 Has turning to the Zombie Server #ff0000!!",getRootElement(), 255, 0, 0, true ) 
end 
) 
  
function chat() 
  outputChatBox ("#FFff00~@  #00bbccTyp #000000[ #ff0000/zombie #000000] #00bbccTo connect to The#000000: #ff0000Zombie #00bbccServer #ffff00 @~",getRootElement(), 255, 255, 255, true ) 
end 
setTimer ( chat, 60000, 0) 

My ingame nickname : Ops!

-DeathMatch GameMode By Ops! : 5%

Posted

What about this part?

7.function chat()

8. outputChatBox ("#FFff00~@ #00bbccTyp #000000[ #ff0000/zombie #000000] #00bbccTo connect to The#000000: #ff0000Zombie #00bbccServer #ffff00 @~",getRootElement(), 255, 255, 255, true )

9.end

10.setTimer ( chat, 60000, 0)

Posted
setTimer( 
function() 
    outputChatBox ("#FFff00~@ #00bbccTyp #000000[ #ff0000/zombie #000000] #00bbccTo connect to The#000000: #ff0000Zombie #00bbccServer #ffff00 @~",root, 255, 255, 255, true ) 
end 
, 60000, 0) 

try

Diet with russian vodka, lose 3 days in one week !

Posted

This is what i've got neither of the chatbox things work

function redirect(player)  
redirectPlayer(player, "94.23.38.142", "22006") 
outputChatBox ("*#000000  [ #FF0000"..getPlayerName(player) .." #000000]#FFFF00 Has turning to the Freeroam Server #ff0000!!",getRootElement(), 255, 0, 0, true ) 
end 
addCommandHandler("freeroam",redirect) 
  
setTimer( 
function() 
    outputChatBox ("#FFff00~@ #00bbccTyp #000000[ #ff0000/freeroam #000000] #00bbccTo connect to The#000000: #ff0000Freeroam #00bbccServer #ffff00 @~",root, 255, 255, 255, true ) 
end 
, 60000, 0) 

function redirect1(player)  
redirectPlayer(player, "94.23.38.142", "22003") 
outputChatBox ("*#000000  [ #FF0000"..getPlayerName(player) .." #000000]#FFFF00 Has turning to the Zombie Server #ff0000!!",getRootElement(), 255, 0, 0, true ) 
end 
addCommandHandler("zombie",redirect1) 
  
  
setTimer( 
function() 
    outputChatBox ("#FFff00~@ #00bbccTyp #000000[ #ff0000/zombie #000000] #00bbccTo connect to The#000000: #ff0000Zombie #00bbccServer #ffff00 @~",root, 255, 255, 255, true ) 
end 
, 60000, 0) 

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