Jump to content

مشكله بكود الاعب


Recommended Posts

  • Replies 94
  • Created
  • Last Reply

Top Posters In This Topic

كلينت 
addEventHandler ( "onClientGUIClick", root, 
  
    function ( ) 
  
        if source == اسم الزر then 
  
        triggerServerEvent("kick",getLocalPlayer())   
  
     end 
  
end) 
--- سيرفر 
addEvent("kick", true) 
addEventHandler("kick", root, 
  
function () 
    kickPlayer (source,"سبب الكيك") 
end) 

Link to comment
كلينت 
addEventHandler ( "onClientGUIClick", root, 
  
    function ( ) 
  
        if source == اسم الزر then 
  
        triggerServerEvent("kick",getLocalPlayer())   
  
     end 
  
end) 
--- سيرفر 
addEvent("kick", true) 
addEventHandler("kick", root, 
  
function () 
    kickPlayer (source,"سبب الكيك") 
end) 

خطأ لآزم تجيب الاعب من القريد وتسوي

-- client --

guiGridListGetItemText 
guiGridListGetSelectedItem 

-- server --

getPlayerFromName 

وارسلها اللي من الكلنت بالترايقر وجيب اسم الاعب من السيرفر ,

Link to comment

لم يتم التجربة ..

-- Client --

addEventHandler("onClientGUIClick",getRootElement(), 
    function ( ) 
    if ( source == GUIEditor_Button[5] ) then 
    local Player = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) 
    if ( guiGridListGetSelectedItem(GUIEditor_Grid[1]) == -1 ) then return outputChatBox("الرجاء اختيار لاعب ..") end 
    triggerServerEvent("KickSelectedPlayer",localPlayer,Player) 
    end 
end 
) 

-- Server --

addEvent("KickSelectedPlayer",true) 
addEventHandler("KickSelectedPlayer",getRootElement(), 
    function  ( Player )  
    SelectedElement = getPlayerFromName ( Player )  
        if ( SelectedElement ) then 
            kickPlayer( SelectedElement,"Reason" ) 
        end 
    end 
) 

بالتوفيق و لاتنسى تضيفة السكربت لـ الصلاحيات بـ الادمن ... :)

Link to comment

كود الباند

addEventHandler("onClientGUIClick",getRootElement(), 
    function ( ) 
    if ( source == GUIEditor_Button[5] ) then 
  
        local Player = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ) 
               ( GUIEditor_Grid[1] ), 1 ) 
outputChatBox("الرجاء اختيار لاعب ..") end 
    triggerServerEvent("KickSelectedPlayer",localPlayer,Player) 
    end 
end 
) 
  
- سيرفر 
addEvent("onPlayerLogin",true) 
addEventHandler ( 'onPlayerLogin', getRootElement ( ), 
    function  ( Player ) 
    SelectedElement = getPlayerFromName ( Player ) 
        if ( SelectedElement ) then 
            if Serial ~= getPlayerSerial ( source ) then 
                banPlayer ( source, false, false, true, getRootElement ( ), 'reason ban' ) 
            end 
        end 
    end 
) 

Link to comment

-- Server --

addEvent("BanSelectedPlayer",true) 
addEventHandler("BanSelectedPlayer",getRootElement(), 
    function ( Player ) 
    local element = getPlayerFromName ( Player ) 
        if ( element ) then 
            outputChatBox("* [ "..getPlayerName(element).." ] Has Been Banded By "..getPlayerName(source).." ",getRootElement(),0,255,255,true) 
            banPlayer ( element, false, false, true, getRootElement ( ), 'Reason' , 3600 ) 
        end 
    end 
) 

-- Client --

addEventHandler("onClientGUIClick",getRootElement(), 
    function ( ) 
     local Player = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) 
    if ( source == GUIEditor_Button[5] ) then 
    if ( guiGridListGetSelectedItem(GUIEditor_Grid[1]) == -1 ) then return outputChatBox("الرجاء اختيار لاعب ..") end 
    triggerServerEvent("KickSelectedPlayer",localPlayer,Player) 
    elseif ( source == GUIEditor_Button[6] ) then 
   if ( guiGridListGetSelectedItem(GUIEditor_Grid[1]) == -1 ) then return outputChatBox("الرجاء اختيار لاعب ..") end 
    triggerServerEvent("BanSelectedPlayer",localPlayer,Player) 
    end 
end 
) 

Link to comment

-- Server --

addEvent("MuteSelectedPlayer",true) 
addEventHandler("MuteSelectedPlayer",getRootElement(), 
    function ( Player ) 
    local element = getPlayerFromName ( Player ) 
        if ( element ) then 
            outputChatBox("* [ "..getPlayerName(element).." ] Has Been Muted By "..getPlayerName(source).." ",getRootElement(),0,255,255,true) 
            setPlayerMuted ( element , true ) 
            setTimer ( function ( ) 
            outputChatBox("* [ "..getPlayerName(element).." ] Has Been UnMuted ",getRootElement(),0,255,255,true) 
                setPlayerMuted ( element , false ) 
            end,300000,1) 
        end 
    end 
) 

-- Client --

addEventHandler("onClientGUIClick",getRootElement(), 
    function ( ) 
     local Player = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) 
    if ( source == GUIEditor_Button[5] ) then 
    if ( guiGridListGetSelectedItem(GUIEditor_Grid[1]) == -1 ) then return outputChatBox("الرجاء اختيار لاعب ..") end 
    triggerServerEvent("KickSelectedPlayer",localPlayer,Player) 
    elseif ( source == GUIEditor_Button[6] ) then 
    if ( guiGridListGetSelectedItem(GUIEditor_Grid[1]) == -1 ) then return outputChatBox("الرجاء اختيار لاعب ..") end 
    triggerServerEvent("BanSelectedPlayer",localPlayer,Player) 
    elseif ( source == GUIEditor_Button[7] ) then 
    if ( guiGridListGetSelectedItem(GUIEditor_Grid[1]) == -1 ) then return outputChatBox("الرجاء اختيار لاعب ..") end 
    triggerServerEvent("MuteSelectedPlayer",localPlayer,Player) 
    end 
end 
) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...