TheIceman1 Posted February 20, 2013 Share Posted February 20, 2013 Why this dont show reason? Client: function kickplayer () local text = guiGetText ( GUIEditor_Edit[1] ) triggerServerEvent ( "kickplayer", getLocalPlayer(), text ) end addEventHandler ( "onClientGUIClick", GUIEditor_Button[5], kickplayer ) Server: function kickplay () if ( hasObjectPermissionTo ( source, "function.kickPlayer" ) ) then kickPlayer ( source, source, reason ) end end addEvent ( "kickplayer", true ) addEventHandler ( "kickplayer", root, kickplay ) Link to comment
iPrestege Posted February 20, 2013 Share Posted February 20, 2013 You forgot the string here "reason" . function kickplay () if ( hasObjectPermissionTo ( source, "function.kickPlayer" ) ) then kickPlayer ( source, source, "reason" ) end end addEvent ( "kickplayer", true ) addEventHandler ( "kickplayer", root, kickplay ) Link to comment
TheIceman1 Posted February 20, 2013 Author Share Posted February 20, 2013 When i fill reason in edit then press button "kick" then i want kick that player with reason.This code kick him without reason.Understand? Link to comment
iPrestege Posted February 20, 2013 Share Posted February 20, 2013 use : getPlayerFromName to get Players name on the server . Link to comment
TheIceman1 Posted February 20, 2013 Author Share Posted February 20, 2013 use : getPlayerFromName to get Players name on the server . Noo,you dont understand what i want Link to comment
iPrestege Posted February 20, 2013 Share Posted February 20, 2013 use : getPlayerFromName to get Players name on the server . Noo,you dont understand what i want Try didn,t get it but this should work . function kickplay () if ( hasObjectPermissionTo ( source, "function.kickPlayer" ) ) then kickPlayer ( source, source, "reason" ) end end addEvent ( "kickplayer", true ) addEventHandler ( "kickplayer", root, kickplay ) Link to comment
Vision Posted February 20, 2013 Share Posted February 20, 2013 function kickplay ( reason ) if ( hasObjectPermissionTo ( source, "function.kickPlayer" ) ) then kickPlayer ( source, reason ) end end addEvent ( "kickplayer", true ) addEventHandler ( "kickplayer", root, kickplay ) 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