Jump to content

MamadHastam

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by MamadHastam

  1. oh right my bad... tnx i also had an anther question ! i want to teleport player to a pos and give him a car and after 2 minute destroy element car and teleport him to another position but i dont know how can you help me with that?
  2. hello please help me with it i used many ways to make it but it didn't work i want SetElementPostion player on somewhere and after 20 sec send him to another position function tel1() if isCursorOverRectangle() then setElementPosition ( ) settimer (function(), setElementPosition ( ) end, 5000, 1 ) end
  3. hello so i have TriggerServerEvent on client and my event in server side is : function() local money = getPlayerMoney(client) if money >= 000 then takePlayerMoney(client, 000) setElementPosition ( getLocalPlayer( ), 1552.8505859375, -1675.357421875, 16.1953125) elseif money < 000 then outputChatBox('', client, 255, 255, 255, true) end end addEvent('', true) addEventHandler('', getRootElement(), ) like code above i want to SetElementPostion with the if i write but GetLocalPlayer isnt work in server side can somebody help me with that?
  4. how can i use if in this : addCommandHandler("", function () graMode = not graMode if graMode then outputChatBox("", 255, 255, 255, true) else outputChatBox("", 255, 255, 255, true) end end )
  5. there is one thing i cant understand how can i give actions to the buttons in client for example when i write : addEventHandler ("onClientClick", root, function(btn, state) if btn ~= "left" or state ~= "down" then return end if isMouseInPosition (xx*594, yy*396, xx*235, yy*300) then -- click 1-st button elseif isMouseInPosition (xx*840, yy*396, xx*235, yy*300) then -- click 2-nd button end end) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end how give button 1 an action to do somthing please explain it to me
  6. hello im a new scripter and i want some help so i want made a panel with image that i have and add an action when i click on image [ example : spawncar ] i want change this : local entradaB = createMarker(1086.4340820313,-1803.6898193359,14.602746963501, "cylinder", 1, 255, 255, 255, 0) local myBlip = createBlip( 1085.6364746094,-1800.0280761719,13.626179695129, 44, 0, 0, 0, 255, myPlayer ) addEventHandler( "onClientRender", root, function() local x, y, z = getElementPosition( entradaB ) local Mx, My, Mz = getCameraMatrix( ) if ( getDistanceBetweenPoints3D( x, y, z, Mx, My, Mz ) <= 15 ) then local WorldPositionX, WorldPositionY = getScreenFromWorldPosition( x, y, z +1, 0.07 ) if ( WorldPositionX and WorldPositionY ) then dxDrawText("", WorldPositionX - 1, WorldPositionY + 1, WorldPositionX - 1, WorldPositionY + 1, tocolor(0, 0, 0, 255), 2.52, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("", WorldPositionX - 1, WorldPositionY + 1, WorldPositionX - 1, WorldPositionY + 1, tocolor(255, 255, 255, 255), 2.50, "default-bold", "center", "center", false, false, false, false, false) end end end ) --------------------------------------------- function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end wndArenda = guiCreateWindow(0,0,500,150,"",false) centerWindow(wndArenda) guiSetVisible(wndArenda,false) label1 = guiCreateLabel(0,30,490,480, "", false, wndArenda) guiSetFont(label1, "default-bold-small") guiLabelSetHorizontalAlign(label1, "center", false) local btn1 = guiCreateButton(20,100,200,35,"",false,wndArenda) local btn2 = guiCreateButton(280,100,200,35,"",false,wndArenda) addEventHandler('onClientGUIClick',wndArenda,function() if source == btn1 then triggerServerEvent("onPlayerUseCustomPickup", localPlayer) guiSetVisible(wndArenda,false) showCursor(false) elseif source == btn2 then guiSetVisible(wndArenda,false) showCursor(false) end end) function changeArendaMenuState() guiSetVisible(wndArenda,true) showCursor(true) end addEvent("changeArendaMenuState", true) addEventHandler("changeArendaMenuState", getRootElement(), changeArendaMenuState) to this : local screenW,screenH = guiGetScreenSize() local px,py = 1920,1080 local xx,yy = (screenW/px), (screenH/py) local sum1 = 10000 local sum2 = 15000 local sum3 = 20000 local draw = false function gruz() dxDrawImage(xx*550, yy*260, xx*825, yy*500, "images/fon.png") if isCursorOverRectangle(xx*594, yy*396, xx*235, yy*300) then color = 180 else color = 255 end dxDrawImage(xx*594, yy*396, xx*235, yy*300, "images/1.png", 0, 0, 0, tocolor(255, 255, 255, color), false) if isCursorOverRectangle(xx*840, yy*396, xx*235, yy*300) then color = 180 else color = 255 end dxDrawImage(xx*840, yy*396, xx*235, yy*300, "images/2.png", 0, 0, 0, tocolor(255, 255, 255, color), false) if isCursorOverRectangle(xx*1092, yy*396, xx*235, yy*300) then color = 180 else color = 255 end dxDrawImage(xx*1092, yy*396, xx*235, yy*300, "images/3.png", 0, 0, 0, tocolor(255, 255, 255, color), false) if isCursorOverRectangle(xx*1330, yy*275, xx*36, yy*36) then color = 180 else color = 255 end dxDrawImage(xx*1330, yy*275, xx*36, yy*36, "images/exit.png", 0, 0, 0, tocolor(255, 255, 255, color), false) dxDrawText("", xx*900, yy*280, xx*1035, yy*300, tocolor(255, 255, 255, 255), xx*1.5, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("", xx*900, yy*350, xx*1080, yy*345, tocolor(255, 255, 255, 255), xx*1.2, "sans", "left", "top", false, false, false, false, false) dxDrawText("", xx*675, yy*415, xx*870, yy*435, tocolor(255, 255, 255, 150), xx*1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("", xx*920, yy*415, xx*870, yy*435, tocolor(255, 255, 255, 150), xx*1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("", xx*1175, yy*415, xx*870, yy*435, tocolor(255, 255, 255, 150), xx*1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("", xx*620, yy*455, xx*750, yy*475, tocolor(255, 255, 255, 255), xx*1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("", xx*868, yy*455, xx*750, yy*475, tocolor(255, 255, 255, 255), xx*1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText("", xx*1120, yy*455, xx*750, yy*475, tocolor(255, 255, 255, 255), xx*1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(""..sum1, xx*620, yy*480, xx*770, yy*500, tocolor(255, 255, 255, 255), xx*1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(""..sum2, xx*868, yy*480, xx*770, yy*500, tocolor(255, 255, 255, 255), xx*1.00, "sans", "left", "top", false, false, false, false, false) dxDrawText(""..sum3, xx*1120, yy*480, xx*770, yy*500, tocolor(255, 255, 255, 255), xx*1.00, "sans", "left", "top", false, false, false, false, false) end not exacly this but i want to turn theme from guiCreateButton to dxdraw
×
×
  • Create New...