Jump to content

problem


Wei

Recommended Posts

what i need to make there at triggerServerEvent

addEventHandler("onClientGUIClick", guiRoot,function(button) 
    if (button == "left") then 
        if (source == kickButton) then 
            guiSetVisible( adminWindow, false) 
            showCursor(false) 
        elseif ( source == setWantedLevelButton ) then 
            local playerName = guiGridListGetItemText ( gridListOfPlayers, guiGridListGetSelectedItem ( gridListOfPlayers ), 1 ) 
            local wlGet = guiGetText ( tonumber (wantedLevelEdit) ) 
            triggerServerEvent ( button ,playerName, wlGet ) 
             
        end 
    end 
end,true) 

Link to comment
Guest Guest4401

Client

addEventHandler("onClientGUIClick", guiRoot, 
    function(button) 
        if (button == "left") then 
            if (source == kickButton) then 
                guiSetVisible( adminWindow, false) 
                showCursor(false) 
            elseif ( source == setWantedLevelButton ) then 
                local playerName = guiGridListGetItemText ( gridListOfPlayers, guiGridListGetSelectedItem ( gridListOfPlayers ), 1 ) 
                local wlGet = tonumber(guiGetText(wantedLevelEdit)) 
                local player = getPlayerFromName(playerName) 
                if player then 
                    triggerServerEvent ("myEvent", localPlayer, player, wlGet) 
                end 
            end 
        end 
    end 
) 

Server

addEvent("myEvent",true) 
addEventHandler("myEvent",root, 
    function(thePlayer,wLevel) 
        setPlayerWantedLevel(thePlayer,wLevel) 
    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...