toxicsmoke11 Posted March 29, 2014 Share Posted March 29, 2014 (edited) -empty,look down please Edited March 30, 2014 by Guest Link to comment
Karuzo Posted March 29, 2014 Share Posted March 29, 2014 function forceRedirectPlayer(commandName,who) redirectPlayer( who, "192.168.1.64", 22003 ) else outputDebugString("Unknown error.") end addCommandHandler("freconnect",forceRedirectPlayer) Link to comment
cheez3d Posted March 29, 2014 Share Posted March 29, 2014 addCommandHandler("redirect",function(player) redirectPlayer(player,"192.168.1.64",22003) end) Link to comment
toxicsmoke11 Posted March 30, 2014 Author Share 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 Link to comment
Jaysds1 Posted March 30, 2014 Share 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 Link to comment
toxicsmoke11 Posted March 30, 2014 Author Share 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' Link to comment
Jaysds1 Posted March 30, 2014 Share Posted March 30, 2014 Sorry, I misread the script... Try the code I've posted again. Link to comment
toxicsmoke11 Posted March 30, 2014 Author Share 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) Link to comment
Jaysds1 Posted March 30, 2014 Share Posted March 30, 2014 I don't see any problems. Can you post or PM me your full script please. Link to comment
Sasu Posted March 31, 2014 Share Posted March 31, 2014 Why are you using cancelEvent in a command handler? cancelEvent is only for event. Try deleting that. Link to comment
Jaysds1 Posted April 1, 2014 Share 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. 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