JasperRieken Posted May 20, 2012 Share Posted May 20, 2012 function redirect() redirectPlayer(source, "94.23.38.142", tonumber(22006)) end addCommandHandler("freeroam",redirect) This doesn't seem to work Link to comment
JasperRieken Posted May 20, 2012 Author Share Posted May 20, 2012 i did that, first it said permission denied. I added it to the acl now it sais bad argument line 4 Link to comment
Kenix Posted May 20, 2012 Share Posted May 20, 2012 (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 May 20, 2012 by Guest Link to comment
Wei Posted May 20, 2012 Share Posted May 20, 2012 (edited) function redirect(playerSource) redirectPlayer (playerSource, "94.23.38.142", tonumber(22006)) end addCommandHandler("freeroam",redirect) worked for me Edited May 20, 2012 by Guest Link to comment
Kenix Posted May 20, 2012 Share Posted May 20, 2012 source is not defined in arguments command handler-function! 3 argument should be number ( not string ). Link to comment
Kenix Posted May 20, 2012 Share Posted May 20, 2012 (edited) Why convert number to number in this case? tonumber(22006) Edited May 20, 2012 by Guest Link to comment
JasperRieken Posted May 20, 2012 Author Share Posted May 20, 2012 function redirect() redirectPlayer(source, "94.23.38.142", "22006") end addCommandHandler("freeroam",redirect) That doesn't work for me Link to comment
Kenix Posted May 20, 2012 Share Posted May 20, 2012 Read my comments. I said mistakes. Link to comment
Wei Posted May 20, 2012 Share Posted May 20, 2012 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)) Link to comment
Kenix Posted May 20, 2012 Share Posted May 20, 2012 (edited) In your code you convert number to number. It's not needed. In Wiki example string converted to number. Edited May 20, 2012 by Guest Link to comment
Wei Posted May 20, 2012 Share Posted May 20, 2012 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 Link to comment
Kenix Posted May 20, 2012 Share Posted May 20, 2012 Handler function parameters player playerSource, string commandName, [string arg1, string arg2, ...] I guess you understand Correct code addCommandHandler( 'freeroam', function( pPlayer ) redirectPlayer( pPlayer, '94.23.38.142', 22006 ) end ) Link to comment
JasperRieken Posted May 20, 2012 Author Share Posted May 20, 2012 Thanks, this one works only the chat thing doesn't 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) Link to comment
Kenix Posted May 20, 2012 Share Posted May 20, 2012 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. Link to comment
X-SHADOW Posted May 20, 2012 Share Posted May 20, 2012 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) Link to comment
JasperRieken Posted May 20, 2012 Author Share Posted May 20, 2012 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) Link to comment
Wei Posted May 20, 2012 Share Posted May 20, 2012 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 Link to comment
Noneatme Posted May 20, 2012 Share Posted May 20, 2012 @JasperRieken I think the string is too long, remove the color-codes and try again. -Multivan Link to comment
JasperRieken Posted May 20, 2012 Author Share Posted May 20, 2012 it's not the color codes i used this one before copied it Link to comment
Noneatme Posted May 20, 2012 Share Posted May 20, 2012 Hmm okay, This happens to me too sometimes Link to comment
JasperRieken Posted May 20, 2012 Author Share Posted May 20, 2012 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) 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