STKrush Posted February 8, 2016 Share Posted February 8, 2016 Server: function CreateTeam() tt = createTeam ("Taxi", 255, 255, 255) end addEventHandler("onResourceStart", getRootElement(), CreateTeam) function getTaxiJob() setPlayerTeam(source, tt) end addEvent("gTJ", true) addEventHandler("gTJ", root, getTaxiJob) Client: function createTaxiWindow() local x = 0.375 local y = 0.375 local w = 0.25 local h = 0.25 gJW = guiCreateWindow(x, y, w, h, "Job", true) guiWindowSetSizable(gJW, false) x = 0.35 y = 0.5 w = 0.35 h = 0.35 gJB = guiCreateButton(x, y, w, h, "Join", true, gJW) addEventHandler("onClientGUIClick", gJB, getTheJob, false) x = 0.92 y = 0.15 w = 0.045 h = 0.075 gJBE = guiCreateButton(x, y, w, h, "x", true, gJW) addEventHandler("onClientGUIClick", gJBE, setUnVisTaxi, false) end function setVisTaxi() createTaxiWindow() if (gJW ~= nil) then guiSetVisible(gJW, true) else return end showCursor(true) end addCommandHandler("gtj", setVisTaxi) function setUnVisTaxi(button, state) if button == "left" and state == "up" then guiSetVisible(gJW, false) showCursor(false) end end function getTheJob() triggerServerEvent("gTJ", root) end How to fix it?Help me please. p.s. sorry for my english Link to comment
KariiiM Posted February 8, 2016 Share Posted February 8, 2016 (edited) Try that server side: local tt = createTeam ("Taxi", 255, 255, 255) function getTaxiJob() if tt then setPlayerTeam(source, tt) end end addEvent("gTJ", true) addEventHandler("gTJ", root, getTaxiJob) Edited February 8, 2016 by Guest Link to comment
STKrush Posted February 8, 2016 Author Share Posted February 8, 2016 Try thatserver side: function CreateTeam() local tt = createTeam ("Taxi", 255, 255, 255) end addEventHandler("onResourceStart", getRootElement(), CreateTeam) function getTaxiJob() setPlayerTeam(source, getTeamFromName("Taxi")) end addEvent("gTJ", true) addEventHandler("gTJ", root, getTaxiJob) Same warning Link to comment
STKrush Posted February 8, 2016 Author Share Posted February 8, 2016 Oh, i must been replaced "source" to "client" and this start working Link to comment
KariiiM Posted February 8, 2016 Share Posted February 8, 2016 --Client side: function createTaxiWindow() local x = 0.375 local y = 0.375 local w = 0.25 local h = 0.25 gJW = guiCreateWindow(x, y, w, h, "Job", true) guiWindowSetSizable(gJW, false) x = 0.35 y = 0.5 w = 0.35 h = 0.35 gJB = guiCreateButton(x, y, w, h, "Join", true, gJW) addEventHandler("onClientGUIClick", gJB, getTheJob, false) x = 0.92 y = 0.15 w = 0.045 h = 0.075 gJBE = guiCreateButton(x, y, w, h, "x", true, gJW) addEventHandler("onClientGUIClick", gJBE, setUnVisTaxi, false) end function setVisTaxi() createTaxiWindow() if (gJW ~= nil) then guiSetVisible(gJW, true) else return end showCursor(true) end addCommandHandler("gtj", setVisTaxi) function setUnVisTaxi(button, state) if button == "left" and state == "up" then guiSetVisible(gJW, false) showCursor(false) end end function getTheJob() triggerServerEvent("gTJ", localPlayer) end --Server side: function CreateTeam() local tt = createTeam ("Taxi", 255, 255, 255) end addEventHandler("onResourceStart", getRootElement(), CreateTeam) function getTaxiJob() setPlayerTeam(source, getTeamFromName("Taxi")) end addEvent("gTJ", true) addEventHandler("gTJ", root, getTaxiJob) 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