Om. Posted April 4, 2016 Share Posted April 4, 2016 Full Script: -- Client Side Script. addEventHandler ( 'onClientGUIClick', root, function () if (source == kickSubmitBtn) then local reason = guiGetText(Kickreason) player = guiGridListGetItemText ( playersGrid, guiGridListGetSelectedItem ( playersGrid ), 1 ) triggerServerEvent("ERP.staff:kickPlayer", resourceRoot, player, reason) end end ) -- Server Sided Script function kickPlrFromAdminPanel(thePlayer, reason) plr = getPlayerFromName(thePlayer) outputChatBox("User: "..plr.." has been kicked from the server. ("..reason..")", root) kickPlayer(plr, reason) end addEvent("ERP.staff:kickPlayer", true) addEventHandler("ERP.staff:kickPlayer", resourceRoot, kickPlrFromAdminPanel) There are no debug errors, i have no idea why. When i click "Kick player Button", it dosnt trigger, but if i output the value of player and reason vars, they work. Link to comment
Anubhav Posted April 4, 2016 Share Posted April 4, 2016 Make sure it is a resource in Admin group. Link to comment
MIKI785 Posted April 4, 2016 Share Posted April 4, 2016 You say that there are no errors, do you mean just errors? Because if there was an issue with permissions it would throw a warning saying that access was denied. It would also throw a warning if 'plr' variable wasn't a player. It has to output something, use debugscript 3. Also, the outputChatBox should throw an error, because 'plr' is either a player element (if the player was found by getPlayerFromName) or false. In both cases it would be an error if you don't use tostring. 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