TheSmart
Members-
Posts
516 -
Joined
-
Last visited
Everything posted by TheSmart
-
ofc mean "of course", yes it will work
-
thnx its work but animation not working when i use it like that setPedAnimation (source, "BAR", "Barserve_glass") i got no error but still not working and when i use it like that setPedAnimation ( "BAR", "Barserve_glass") i got that error http://prntscr.com/7xzgca any solution?
-
ahh now panel won't showing when i hit marker local maxDistance = 12 -- the distance showing 3dtext local ped = createPed (2,-836.33, 2734.16, 45.67) addEventHandler ( "onClientRender", root, function ( ) local pX, pY, pZ = getElementPosition ( localPlayer ) local pedX, pedY, pedZ = getElementPosition ( ped ) local distance = getDistanceBetweenPoints3D ( pX, pY, pZ, pedX, pedY, pedZ ) if ( distance <= 12 ) then local x, y = getScreenFromWorldPosition ( pedX, pedY, pedZ ) if ( x and y ) then dxDrawText("Barman", x, y+1, _, _, tocolor(248, 251, 3, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) no error -- dxDrawText( "Barman", x, y+1.5, _, _, tocolor( 255, 0, 0, 255 ), 1, "center", "center" ) end end end ) function dx() dxDrawRectangle(405, 301, 408, 304, tocolor(17, 16, 16, 220), false) dxDrawText("Barman", 433, 291, 775, 392, tocolor(255, 255, 255, 255), 4.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(404, 394, 810, 394, tocolor(255, 255, 255, 255), 2, false) dxDrawLine(404, 398, 812, 398, tocolor(255, 255, 255, 255), 1, false) dxDrawText("Do you want to buy Beer?", 405, 421, 799, 452, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Price : 1000", 406, 459, 677, 499, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawRectangle(407, 537, 151, 58, tocolor(16, 16, 16, 220), false) dxDrawRectangle(638, 537, 151, 58, tocolor(16, 16, 16, 220), false) dxDrawText("Buy", 404, 538, 558, 595, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Close", 638, 538, 789, 595, tocolor(255, 255, 255, 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false) end function button() buybtn = guiCreateButton(404, 539, 154, 56, "", false) guiSetAlpha(buybtn, 0.00) closebtn = guiCreateButton(638, 540, 151, 55, "", false) guiSetAlpha(closebtn, 0.00) end addEventHandler("onClientResourceStart", resourceRoot, button) marker = createMarker( -836.33, 2734.87, 45.68, "cylinder", 2, 255, 255, 255, 150 ) function close(button,state) if (button == "left" and state == "up") then if (source == closebtn) then removeEventHandler("onClientRender", root, dx) showCursor(false) end end end addEventHandler("onClientGUIClick", getRootElement(), close) function buy(button,state) if (button == "left" and state == "up") then if (source == buybtn) then takePlayerMoney ( 1000 ) setPedAnimation("BAR", "Barserve_glass") showCursor(true) end end end addEventHandler("onClientGUIClick", getRootElement(), buy) function showgui (hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then addEventHandler("onClientRender", resourceRoot, dx) addEventHandler("onResourceStart", root, button) end end addEventHandler("onClientMarkerHit", marker, showgui) function showguil (leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then removeEventHandler("onClientRender", resourceRoot, dx) removeEventHandler("onClientResourceStart", resourceRoot, button) end end addEventHandler("onClientMarkerLeave", marker, showguil)
-
ok i have 3 problems 1) when i restart script dx panel open automatic. 2) when i click on buy button it will set animation but it doesn't work. 3) when i went to marker again panel doesn't show just cursor show local maxDistance = 12 -- the distance showing 3dtext local ped = createPed (2,-836.33, 2734.16, 45.67) addEventHandler ( "onClientRender", root, function ( ) local pX, pY, pZ = getElementPosition ( localPlayer ) local pedX, pedY, pedZ = getElementPosition ( ped ) local distance = getDistanceBetweenPoints3D ( pX, pY, pZ, pedX, pedY, pedZ ) if ( distance <= 12 ) then local x, y = getScreenFromWorldPosition ( pedX, pedY, pedZ ) if ( x and y ) then dxDrawText("Barman", x, y+1, _, _, tocolor(248, 251, 3, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) -- dxDrawText( "Barman", x, y+1.5, _, _, tocolor( 255, 0, 0, 255 ), 1, "center", "center" ) end end end ) function dx () dxDrawRectangle(405, 301, 408, 304, tocolor(17, 16, 16, 220), false) dxDrawText("Barman", 433, 291, 775, 392, tocolor(255, 255, 255, 255), 4.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(404, 394, 810, 394, tocolor(255, 255, 255, 255), 2, false) dxDrawLine(404, 398, 812, 398, tocolor(255, 255, 255, 255), 1, false) dxDrawText("Do you want to buy Beer?", 405, 421, 799, 452, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Price : 1000", 406, 459, 677, 499, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawRectangle(407, 537, 151, 58, tocolor(16, 16, 16, 220), false) dxDrawRectangle(638, 537, 151, 58, tocolor(16, 16, 16, 220), false) dxDrawText("Buy", 404, 538, 558, 595, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Close", 638, 538, 789, 595, tocolor(255, 255, 255, 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false) end addEventHandler("onClientRender", root, dx) function button() buybtn = guiCreateButton(404, 539, 154, 56, "", false) guiSetAlpha(buybtn, 0.00) closebtn = guiCreateButton(638, 540, 151, 55, "", false) guiSetAlpha(closebtn, 0.00) end addEventHandler("onClientResourceStart", resourceRoot, button) marker = createMarker( -836.33, 2734.87, 45.68, "cylinder", 2, 255, 255, 255, 150 ) function close(button,state) if (button == "left" and state == "up") then if (source == closebtn) then removeEventHandler("onClientRender", root, dx) showCursor(false) end end end addEventHandler("onClientGUIClick", getRootElement(), close) function buy(button,state) if (button == "left" and state == "up") then if (source == buybtn) then takePlayerMoney ( 1000 ) setPedAnimation( source, "BAR", "Barserve_glass") showCursor(true) end end end addEventHandler("onClientGUIClick", getRootElement(), buy) function showgui (hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then addEventHandler("onClientRender", resourceRoot, dx) addEventHandler("onResourceStart", root, button) showCursor(true) end end addEventHandler("onClientMarkerHit", marker, showgui) function showguil (leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then removeEventHandler("onClientRender", resourceRoot, dx) removeEventHandler("onClientResourceStart", resourceRoot, button) showCursor(false) end end addEventHandler("onClientMarkerLeave", marker, showguil) tell me where is problem?
-
wait wait one thing left now how i can make it when player hit the marker dx and button will show? function showgui (hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then -----what now? showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, showgui)
-
local maxDistance = 12 -- the distance showing 3dtext local ped = createPed (2,-836.33, 2734.16, 45.67) addEventHandler ( "onClientRender", root, function ( ) local pX, pY, pZ = getElementPosition ( localPlayer ) local pedX, pedY, pedZ = getElementPosition ( ped ) local distance = getDistanceBetweenPoints3D ( pX, pY, pZ, pedX, pedY, pedZ ) if ( distance <= 12 ) then local x, y = getScreenFromWorldPosition ( pedX, pedY, pedZ ) if ( x and y ) then dxDrawText("Barman", x, y+1, _, _, tocolor(248, 251, 3, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) -- dxDrawText( "Barman", x, y+1.5, _, _, tocolor( 255, 0, 0, 255 ), 1, "center", "center" ) end end end ) function dx () dxDrawRectangle(405, 301, 408, 304, tocolor(17, 16, 16, 220), false) dxDrawText("Barman", 433, 291, 775, 392, tocolor(255, 255, 255, 255), 4.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(404, 394, 810, 394, tocolor(255, 255, 255, 255), 2, false) dxDrawLine(404, 398, 812, 398, tocolor(255, 255, 255, 255), 1, false) dxDrawText("Do you want to buy Beer?", 405, 421, 799, 452, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Price : 1000", 406, 459, 677, 499, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawRectangle(407, 537, 151, 58, tocolor(16, 16, 16, 220), false) dxDrawRectangle(638, 537, 151, 58, tocolor(16, 16, 16, 220), false) dxDrawText("Buy", 404, 538, 558, 595, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Close", 638, 538, 789, 595, tocolor(255, 255, 255, 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false) end addEventHandler("onClientRender", root, dx) function button() acceptbtn = guiCreateButton(404, 539, 154, 56, "", false) guiSetAlpha(acceptbtn, 0.00) closebtn = guiCreateButton(638, 540, 151, 55, "", false) guiSetAlpha(closebtn, 0.00) end addEventHandler("onClientResourceStart", resourceRoot, button) marker = createMarker( -836.33, 2734.87, 45.68, "cylinder", 2, 255, 255, 255, 150 ) function close(button,state) if (button == "left" and state == "up") then if (source == closebtn) then removeEventHandler("onClientRender", root, dx) removeEventHandler("onClientResourceStart",resourceRoot, button) end end addEventHandler("onClientGUIClick", getRootElement(), close) end
-
doesn't work function close(button,state) if (button == "left" and state == "up") then if (source == closebtn) then removeEventHandler("onClientRender", root, dx) removeEventHandler("onClientResourceStart", root, button) end end addEventHandler("onClientGUIClick", getRootElement(), close)
-
well i complete it now idk how i did that when player click on close button dx and defualt gui button will remove function dx () dxDrawRectangle(405, 301, 408, 304, tocolor(17, 16, 16, 220), false) dxDrawText("Barman", 433, 291, 775, 392, tocolor(255, 255, 255, 255), 4.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(404, 394, 810, 394, tocolor(255, 255, 255, 255), 2, false) dxDrawLine(404, 398, 812, 398, tocolor(255, 255, 255, 255), 1, false) dxDrawText("Do you want to buy Beer?", 405, 421, 799, 452, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Price : 1000", 406, 459, 677, 499, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawRectangle(407, 537, 151, 58, tocolor(16, 16, 16, 220), false) dxDrawRectangle(638, 537, 151, 58, tocolor(16, 16, 16, 220), false) dxDrawText("Buy", 404, 538, 558, 595, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Close", 638, 538, 789, 595, tocolor(255, 255, 255, 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false) end addEventHandler("onClientRender", root, dx) function button() acceptbtn = guiCreateButton(404, 539, 154, 56, "", false) guiSetAlpha(accept, 0.00) closebtn = guiCreateButton(638, 540, 151, 55, "", false) guiSetAlpha(close, 0.00) end addEventHandler("onClientResourceStart", resourceRoot, button) marker = createMarker( -836.33, 2734.87, 45.68, "cylinder", 2, 255, 255, 255, 150 ) function close(button,state) if (button == "left" and state == "up") then if (source == closebtn) then ---what to do nexT?
-
good job btw i like the music
-
everything work good but now i want to change it like meteor that video show you what i want give me example that how to make it?
-
why you posting double topic and comments?
-
nope doesn't work anyone can do it?