K4stic Posted March 14, 2013 Posted March 14, 2013 addEventHandler("onClientGUIClick", root, function () if (source == takebtn) then if not( getPlayerTeam ( localPlayer, getTeamFromName("Unemployed") ) ) then outputChatBox("You must Quit From your Job first",255,0,0) return end local row,col = guiGridListGetSelectedItem(skinsgrid) if (row and col and row ~= -1 and col ~= -1) then local skinName = guiGridListGetItemText(skinsgrid, row, 1) if skinName == "Medic 1 (skin: 274)" then triggerServerEvent("setMedic",localPlayer,274) elseif skinName == "Medic 2 (skin: 275)" then triggerServerEvent("setMedic",localPlayer,275) elseif skinName == "Medic 3 (skin: 276)" then triggerServerEvent("setMedic",localPlayer,276) end guiSetVisible(windowjob, false) showCursor(false) else outputChatBox("Please,select a skin of the list.",255,0,0) end elseif (source == closebtn) then guiSetVisible(windowjob, false) showCursor(false) end end ) No errors just nothing How i can make it then player click on takebtn and player not Unemployed to output him/her Message
Renkon Posted March 14, 2013 Posted March 14, 2013 https://wiki.multitheftauto.com/wiki/getPlayerTeam You have 1 more argument
DNL291 Posted March 14, 2013 Posted March 14, 2013 addEventHandler("onClientGUIClick", root, function () if (source == takebtn) then if (not getTeamName(getPlayerTeam(localPlayer)) == "Unemployed") then outputChatBox("You must Quit From your Job first",255,0,0) return end local row,col = guiGridListGetSelectedItem(skinsgrid) if (row and col and row ~= -1 and col ~= -1) then local skinName = guiGridListGetItemText(skinsgrid, row, 1) if skinName == "Medic 1 (skin: 274)" then triggerServerEvent("setMedic",localPlayer,274) elseif skinName == "Medic 2 (skin: 275)" then triggerServerEvent("setMedic",localPlayer,275) elseif skinName == "Medic 3 (skin: 276)" then triggerServerEvent("setMedic",localPlayer,276) end guiSetVisible(windowjob, false) showCursor(false) else outputChatBox("Please,select a skin of the list.",255,0,0) end elseif (source == closebtn) then guiSetVisible(windowjob, false) showCursor(false) end end )
K4stic Posted March 14, 2013 Author Posted March 14, 2013 Thx @Renkon i forgot that the 'getPlayerTeam' is Server side Thx for Try @DNL291 but will not work because 'getPlayerTeam' is Server Side function but now i use Element Data and it work
DNL291 Posted March 14, 2013 Posted March 14, 2013 Thx @Renkon i forgot that the 'getPlayerTeam' is Server sideThx for Try @DNL291 but will not work because 'getPlayerTeam' is Server Side function but now i use Element Data and it work getPlayerTeam Is client-side and server-side.
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