Jump to content

#Ivan7

Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by #Ivan7

  1. #Ivan7

    TaxiHelp

    Actually it said this: http://imgur.com/okPkkjZ
  2. #Ivan7

    Need Help

    Ok so im trying to add a dxDrawText to my taxi marker but nothing shows... the marker does but not the text local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; local markertaxi = createMarker( -2479.9282226563, -197.41656494141, 24.623662948608, 'Cylinder', 1.5, 255, 0, 255, 170 ); addEventHandler ( 'onClientRender', root, function ( ) -- local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( markertaxi ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); -- -- Marker #1 if distance_1 <= gMaxDistance then local x1_, y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ); if x1_ and y1_ then -- local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); end local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); end -- dxDrawText( "Taxi Job", x1_, y1_, x1_, y1_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end ); function math.evalCurve( curve, input ) if input < curve[ 1 ][ 1 ] then return curve[ 1 ][ 2 ]; end for idx = 2, #curve do if input < curve[ idx ][ 1 ] then local x1 = curve[ idx - 1 ][ 1 ]; local y1 = curve[ idx - 1 ][ 2 ]; local x2 = curve[ idx ][ 1 ]; local y2 = curve[ idx ][ 2 ]; local alpha = ( input - x1 ) / ( x2 - x1 ); return math.lerp( y1, y2, alpha ); end end return curve[ #curve ][ 2 ]; end function math.lerp( from, to, alpha ) return from + ( to-from ) * alpha; end GUIEditor = { memo = {}, button = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(0.4, 0.16, 0.35, 0.45, "Gta-Ar Taxi Job", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateButton(0.10, 0.90, 0.41, 0.80, "Accept", true, GUIEditor.window[1]) guiSetProperty(bAccept, "NormalTextColour", "FFAAAAAA") bClose = guiCreateButton(0.52, 0.90, 0.41, 0.80, "Decline", true, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") GUIEditor.memo[1] = guiCreateMemo(0.10, 0.1, 0.80, 0.75, " Gta-Ar Taxi Job Rules: 1) Go To Player (Blue Blip). 2) Pick up Player by pressing car horn. 3) Drop off Player to Red Blip. Be sure not to die, if you do you will lose your customer. Every dropoff you will earn up to $1000! Made By: [Gta-Ar]#Ivan ", true, GUIEditor.window[1]) createBlipAttachedTo( markertaxi, 42) function showGUIbt(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) and getTeamN(hitElement) ~= "Police" and not isPedInVehicle ( hitElement ) then if getElementData(hitElement,"JobNew") ~= 4 then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) else joinTeam() end end end addEventHandler("onClientMarkerHit", joinBD, showGUIbt) function showGUIbf() if source == bAccept then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) joinTeam() elseif source == bClose then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end end addEventHandler("onClientGUIClick", resourceRoot, showGUIbf)
  3. #Ivan7

    TaxiHelp

    Nah it does say anything..
  4. #Ivan7

    TaxiHelp

    I have that but it just wont show up addEventHandler ( 'onClientRender', root, function ( ) -- local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( markertaxi ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); -- -- Marker #1 if distance_1 <= gMaxDistance then local x1_, y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ); if x1_ and y1_ then -- local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); end local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); end -- dxDrawText( "Taxi Job", x1_, y1_, x1_, y1_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end );
  5. #Ivan7

    TaxiHelp

    Its alright diesel thanks for the reply though
  6. #Ivan7

    TaxiHelp

    Problem for this is it doesnt show the dxDrawText and im deleting all the joinTeam so should i just replace all joinTeam with a setElementData and getElementData
  7. #Ivan7

    TaxiHelp

    this would be the client side : local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; local markertaxi = createMarker( -2479.9282226563, -197.41656494141, 24.623662948608, 'Cylinder', 1.5, 255, 0, 255, 170 ); addEventHandler ( 'onClientRender', root, function ( ) -- local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( markertaxi ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); -- -- Marker #1 if distance_1 <= gMaxDistance then local x1_, y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ); if x1_ and y1_ then -- local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); end local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); end -- dxDrawText( "Taxi Job", x1_, y1_, x1_, y1_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end ); function math.evalCurve( curve, input ) if input < curve[ 1 ][ 1 ] then return curve[ 1 ][ 2 ]; end for idx = 2, #curve do if input < curve[ idx ][ 1 ] then local x1 = curve[ idx - 1 ][ 1 ]; local y1 = curve[ idx - 1 ][ 2 ]; local x2 = curve[ idx ][ 1 ]; local y2 = curve[ idx ][ 2 ]; local alpha = ( input - x1 ) / ( x2 - x1 ); return math.lerp( y1, y2, alpha ); end end return curve[ #curve ][ 2 ]; end function math.lerp( from, to, alpha ) return from + ( to-from ) * alpha; end GUIEditor = { memo = {}, button = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(0.4, 0.16, 0.35, 0.45, "Gta-Ar Taxi Job", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateButton(0.10, 0.90, 0.41, 0.80, "Accept", true, GUIEditor.window[1]) guiSetProperty(bAccept, "NormalTextColour", "FFAAAAAA") bClose = guiCreateButton(0.52, 0.90, 0.41, 0.80, "Decline", true, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") GUIEditor.memo[1] = guiCreateMemo(0.10, 0.1, 0.80, 0.75, " Gta-Ar Taxi Job Rules: 1) Go To Player (Blue Blip). 2) Pick up Player by pressing car horn. 3) Drop off Player to Red Blip. Be sure not to die, if you do you will lose your customer. Every dropoff you will earn up to $1000! Made By: [Gta-Ar]#Ivan ", true, GUIEditor.window[1]) createBlipAttachedTo( markertaxi, 42) function showGUIbt(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) and getTeamN(hitElement) ~= "Police" and not isPedInVehicle ( hitElement ) then if getElementData(hitElement,"JobNew") ~= 4 then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) else joinTeam() end end end addEventHandler("onClientMarkerHit", joinBD, showGUIbt) function showGUIbf() if source == bAccept then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) joinTeam() elseif source == bClose then guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end end addEventHandler("onClientGUIClick", resourceRoot, showGUIbf)
  8. #Ivan7

    TaxiHelp

    I know i did same thing... but now i want imrpove my script make it more complex for example now im practicing dxDrawText and im having problems with that to
  9. #Ivan7

    TaxiHelp

    ok I want to make the TaxiJob with out creating a Team that will show on tab.. how would i start this off on client and server?
  10. #Ivan7

    Help

    Lol ok thanks for help man, Ill see you around this isnt last time you will hear from me
  11. #Ivan7

    Help

    Yeh but you started off probley better I have to look at others people scripts to make mine.. i dont know how to start off any type of script
  12. #Ivan7

    Help

    Wow thanks alot... I hope 1 day to become as good as you.
  13. #Ivan7

    Help

    so for example it would be like setElementVisibleTo(TaxiMan,4)
  14. #Ivan7

    Help

    Ok thanks for helping me on last post now i have question about markers.. i know how to make multiple markers that will only be shown for a taxi driver when he goes to pick up his patients... for example you get the job, after you go to your first patient and their is just a marker now ped once you enter the marker the ped will spawn in... can you teach me how to do this? So sorry if asking to much I am a beginner scripter still learning
  15. Ok so im making a TaxiJob.. and their is a problem with the peds the peds show but i onyl want them showing to the taxi drivers please help fix this problem!
×
×
  • Create New...