tim260 Posted March 18, 2012 Share Posted March 18, 2012 this was working before and now not anymore can someone please help me. and explain me what i did wrong not just post the solution and type try this fixmarker = createMarker(-2053.4602050781, 170.26126098633, 29.102718353271, 'cylinder', 4.0, 255, 255, 0, 75) fixmarker2 = createMarker(-2053.4973144531, 178.64505004883, 29.102718353271, 'cylinder', 4.0, 255, 255, 0, 75) vehicles = getElementsByType ( "vehicle" ) setElementAlpha ( fixmarker, 0 ) setElementAlpha ( fixmarker2, 0 ) for vehicleKey, vehicleValue in ipairs">ipairs(vehicles) do function fix(thePlayer) local redteam = getTeamFromName ( "Sierra Towing Inc." ) if isElementWithinMarker( thePlayer, fixmarker) or isElementWithinMarker( thePlayer, fixmarker2) and ( redteam ) then fixVehicle ( vehicleValue ) elseif not ( redteam ) then outputChatBox("You are not in the sierra team !", thePlayer, 255, 0, 0) elseif not isElementWithinMarker( thePlayer, fixmarker) or isElementWithinMarker( thePlayer, fixmarker2) then outputChatBox("You are not withing a sierra workshop !", thePlayer, 255, 0, 0) end end end addCommandHandler("fix", fix) Link to comment
GanJaRuleZ Posted March 18, 2012 Share Posted March 18, 2012 Can you specify the version in wich was working ? 1. vehicleValue isn't specified. 2. You can make like this : local team = getPlayerTeam() if isElementWithinMarker( thePlayer, fixmarker) or isElementWithinMarker( thePlayer, fixmarker2) then if ( team == "Sierra Towing Inc.") then --code else -- Here is when we get the team --code else -- Here is when we get if the player is in marker --code Hope i helped Link to comment
tim260 Posted March 18, 2012 Author Share Posted March 18, 2012 solved Hope i helped i dont get it Link to comment
Al3grab Posted March 18, 2012 Share Posted March 18, 2012 your code had some mess fixmarker = createMarker(-2053.4602050781, 170.26126098633, 29.102718353271, 'cylinder', 4.0, 255, 255, 0, 75) fixmarker2 = createMarker(-2053.4973144531, 178.64505004883, 29.102718353271, 'cylinder', 4.0, 255, 255, 0, 75) if fixmarker and fixmarker2 then setElementAlpha ( fixmarker, 0 ) setElementAlpha ( fixmarker2, 0 ) end function fix ( player ) local redteam = getTeamFromName ( "Sierra Towing Inc." ) ---- get the sierra team local playerteam = getPlayerTeam( player ) -- get the player who wrote the command team --- local playercar = getPedOccupiedVehicle ( player ) -- get the player who wrote the command car if redteam and redteam == playerteam then -- if got the sierra team and its the player who wrote the command team then if isElementWithinMarker( player, fixmarker) or isElementWithinMarker( player, fixmarker2) then -- if the player inside the marker then for _,playercar in ipairs ( getElementsByType("vehicle") ) do fixVehicle ( playercar ) -- fix it end else -- else if he is not in the marker outputChatBox("You are not withing a sierra workshop !", player, 255, 0, 0) end else -- else if he is not in the sierra team or it is not exsisted outputChatBox("You are not in the sierra team !", player, 255, 0, 0) end end addCommandHandler("fix", fix) * there is bug in lua tag 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