toxicsmoke11 Posted March 29, 2014 Posted March 29, 2014 (edited) -empty,look down please Edited March 30, 2014 by Guest
Karuzo Posted March 29, 2014 Posted March 29, 2014 function forceRedirectPlayer(commandName,who) redirectPlayer( who, "192.168.1.64", 22003 ) else outputDebugString("Unknown error.") end addCommandHandler("freconnect",forceRedirectPlayer)
cheez3d Posted March 29, 2014 Posted March 29, 2014 addCommandHandler("redirect",function(player) redirectPlayer(player,"192.168.1.64",22003) end)
toxicsmoke11 Posted March 30, 2014 Author Posted March 30, 2014 i've tried editing it now just for a bit and it gives me a non sense error! function forceRedirectPlayer(who,commandName,thePlayer) if hasObjectPermissionTo ( player, "function.banPlayer", true ) then redirectPlayer( who, "192.168.1.64", 22003 ) else cancelEvent() and outputChatBox("You cannot use that command.",thePlayer,255,0,0) end end addCommandHandler("freconnect",forceRedirectPlayer) [18:21:32] SCRIPT ERROR: test\freconnect_s.lua:5: unexpected symbol near 'and' [18:21:32] ERROR: Loading script failed: test\freconnect_s.lua:5: unexpe cted symbol near 'and' please help
Jaysds1 Posted March 30, 2014 Posted March 30, 2014 (edited) You don't need that "and" on line 5 try this: function forceRedirectPlayer(player,_, who) if not who then return end if hasObjectPermissionTo ( player, "function.banPlayer", true ) then who = getPlayerFromName(who) if who then redirectPlayer( who, "192.168.1.64", 22003 ) end else cancelEvent() outputChatBox("You cannot use that command.",player,255,0,0) end end addCommandHandler("freconnect",forceRedirectPlayer) Edited March 30, 2014 by Guest
toxicsmoke11 Posted March 30, 2014 Author Posted March 30, 2014 You don't need that "and" on line 5try this: function forceRedirectPlayer(who,commandName) if hasObjectPermissionTo ( player, "function.banPlayer", true ) then redirectPlayer( who, "192.168.1.64", 22003 ) else cancelEvent() outputChatBox("You cannot use that command.",player,255,0,0) end end addCommandHandler("freconnect",forceRedirectPlayer) lol, it doesn't let me force reconnect myself while loggined in as admin [18:37:13] WARNING: test\freconnect_s.lua:2: Bad argument @ 'hasObjectPermissionTo'
Jaysds1 Posted March 30, 2014 Posted March 30, 2014 Sorry, I misread the script... Try the code I've posted again.
toxicsmoke11 Posted March 30, 2014 Author Posted March 30, 2014 Sorry, I misread the script...Try the code I've posted again. Doesn't work at all [18:54:05] ERROR: Loading script failed:test\freconnect_s.lua:13: unexpected symbol near ')' -- line 13 addCommandHandler("freconnect",forceRedirectPlayer)
Jaysds1 Posted March 30, 2014 Posted March 30, 2014 I don't see any problems. Can you post or PM me your full script please.
Sasu Posted March 31, 2014 Posted March 31, 2014 Why are you using cancelEvent in a command handler? cancelEvent is only for event. Try deleting that.
Jaysds1 Posted April 1, 2014 Posted April 1, 2014 Oh ya, Damn, it's been a longtime since I scripted in MTA again... Sorry about that toxicsmoke11, Sasu is right.
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