gghvcffcv Posted March 25, 2014 Share Posted March 25, 2014 Hello guys, The problem is a player can Get all weapons That he wants. i want to put to it a limit, if the player Has accepted the job he cannot accept it For More weapons. only 1 time if player was to Criminal Job and Later to SWAT job Then they can get SWAT Job again. marker5 = createMarker( 1288.17566, -1641.94141, 12.54688, "Cylinder", 1, 0, 0, 255, 200) pedi = createPed ( 285, 1288.17566, -1641.94141, 13.54688, 270) blipA = createBlip ( 1288.17566, -1641.94141, 13.54688, 58, 2, 255, 0,0, 255) function panel(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then panel = guiCreateWindow(443, 132, 416, 514, "S.W.A.T Job", false) guiWindowSetSizable(panel, false) aceptar = guiCreateButton(16, 282, 169, 72, "Accept", false, panel) cerrar = guiCreateButton(230, 282, 169, 72, "Close", false, panel) memo = guiCreateMemo(12, 26, 382, 238, "Welcome to the SWAT Job Accept this job if you are an SWAT\nIf you aren't a swat You cannot accept this Job.", false, panel) showCursor (true) addEventHandler ("onClientGUIClick", aceptar, aceptarr, false ) addEventHandler ("onClientGUIClick", cerrar, cerrarr, false ) guiMemoSetReadOnly(memo, true) end end addEventHandler("onClientMarkerHit", marker5, panel ) function aceptarr ( thePlayer ) triggerServerEvent ( "onGreeting", localPlayer) guiSetVisible ( panel, false ) showCursor(false) end function cerrarr ( hitElement ) guiSetVisible ( panel, false ) showCursor(false) end Link to comment
Castillo Posted March 25, 2014 Share Posted March 25, 2014 Get the player team and see if it's SWAT or not. getPlayerTeam getTeamName Link to comment
gghvcffcv Posted March 25, 2014 Author Share Posted March 25, 2014 Get the player team and see if it's SWAT or not. getPlayerTeam getTeamName i tried it but i don't know if i did something wrong Link to comment
gghvcffcv Posted March 25, 2014 Author Share Posted March 25, 2014 Post what you tried. marker5 = createMarker( 1288.17566, -1641.94141, 12.54688, "Cylinder", 1, 0, 0, 255, 200) pedi = createPed ( 285, 1288.17566, -1641.94141, 13.54688, 270) blipA = createBlip ( 1288.17566, -1641.94141, 13.54688, 58, 2, 255, 0,0, 255) function panel(hitElement) local playerTeam = getPlayerTeam ( source ) if ( playerTeam ) then local oldTeamName = getTeamName ( playerTeam ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then panel = guiCreateWindow(443, 132, 416, 514, "S.W.A.T Job", false) guiWindowSetSizable(panel, false) aceptar = guiCreateButton(16, 282, 169, 72, "Accept", false, panel) cerrar = guiCreateButton(230, 282, 169, 72, "Close", false, panel) memo = guiCreateMemo(12, 26, 382, 238, "Welcome to the SWAT Job Accept this job if you are an SWAT\nIf you aren't a swat You cannot accept this Job.", false, panel) showCursor (true) addEventHandler ("onClientGUIClick", aceptar, aceptarr, false ) addEventHandler ("onClientGUIClick", cerrar, cerrarr, false ) guiMemoSetReadOnly(memo, true) end end end addEventHandler("onClientMarkerHit", marker5, panel ) function aceptarr ( thePlayer ) triggerServerEvent ( "onGreeting", localPlayer) guiSetVisible ( panel, false ) showCursor(false) end function cerrarr ( hitElement ) guiSetVisible ( panel, false ) showCursor(false) end Link to comment
Castillo Posted March 25, 2014 Share Posted March 25, 2014 marker5 = createMarker( 1288.17566, -1641.94141, 12.54688, "Cylinder", 1, 0, 0, 255, 200) pedi = createPed ( 285, 1288.17566, -1641.94141, 13.54688, 270) blipA = createBlip ( 1288.17566, -1641.94141, 13.54688, 58, 2, 255, 0,0, 255) function panel(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then local playerTeam = getPlayerTeam ( localPlayer ) if ( playerTeam ) then local oldTeamName = getTeamName ( playerTeam ) if ( oldTeamName ~= "SWAT" ) then panel = guiCreateWindow(443, 132, 416, 514, "S.W.A.T Job", false) guiWindowSetSizable(panel, false) aceptar = guiCreateButton(16, 282, 169, 72, "Accept", false, panel) cerrar = guiCreateButton(230, 282, 169, 72, "Close", false, panel) memo = guiCreateMemo(12, 26, 382, 238, "Welcome to the SWAT Job Accept this job if you are an SWAT\nIf you aren't a swat You cannot accept this Job.", false, panel) showCursor (true) addEventHandler ("onClientGUIClick", aceptar, aceptarr, false ) addEventHandler ("onClientGUIClick", cerrar, cerrarr, false ) guiMemoSetReadOnly(memo, true) end end end end addEventHandler("onClientMarkerHit", marker5, panel ) function aceptarr ( thePlayer ) triggerServerEvent ( "onGreeting", localPlayer) guiSetVisible ( panel, false ) showCursor(false) end function cerrarr ( hitElement ) guiSetVisible ( panel, false ) showCursor(false) end 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