ahmedo01 Posted March 21, 2015 Share Posted March 21, 2015 CLIENT addEventHandler ( "onClientGUIClick", oyundanatbuton, function() if source == oyundanatbuton then local selected = guiGridListGetSelectedItem( GUIEditor.gridlist[1] ) if selected then local text = guiGridListGetItemText( GUIEditor.gridlist[1], selected, oyuncucolumn) if getPlayerName(getLocalPlayer( )) == text then outputChatBox("Kendini oyundan atamazsın!",255,0,0) return end local plr = getPlayerFromName( text ) if plr then triggerServerEvent( "TRcezalar.kickPlayer",getLocalPlayer( ), plr) end end end end, false ) SERVER function isStaff(plr) if plr then local account = getPlayerAccount( plr ) local accName = getAccountName( account ) if isGuestAccount( account ) then return end if (isObjectInACLGroup ("user."..accName, aclGetGroup ( "S6 Personel" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "S5 Personel" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "S4 Personel" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "S3 Personel" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "S2 Personel" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "S1 Personel" ) )) then return true end end end function kickPlayer(plr) if isStaff(source) then --kickPlayer( plr, "ADMKICK") kickPlayer(plr, source, "ADMKICK") outputChatBox(getPlayerName(source).." isimli personel "..getPlayerName(plr).." isimli kişiyi oyundan attı!",getRootElement( ),255,0,0) end end addEvent("TRcezalar.kickPlayer",true) addEventHandler("TRcezalar.kickPlayer",getRootElement( ),kickPlayer) It gives error in kickPlayer(plr, source, "ADMKICK") string. Error = stack overflow, i cant find solution. Link to comment
Castillo Posted March 21, 2015 Share Posted March 21, 2015 function kickPlayer(plr) And then: kickPlayer(plr, source, "ADMKICK") See? you named the function the same way as a function you are executing, which causes a infinite loop. Rename: function kickPlayer(plr) to something else, like "kick". Link to comment
ahmedo01 Posted March 21, 2015 Author Share Posted March 21, 2015 Ah sorry its my wrong. 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