Jump to content

Mann56

Members
  • Posts

    306
  • Joined

  • Last visited

Everything posted by Mann56

  1. Mann56

    Setting Money

    I tried that but did not work.... I've already set mass_money to 0 in the function starting so it'd every time start with a zero value still it's not working.
  2. no need to create a function for this, use the isCursorOnElement if in the very function dx if isCursorOnElement (botX+sizeX+417, 140, 150, 150) then playSound(click) else -- you can opt for it if you want to test stopSound(click) OBS: I have not tested, if not right tell me Mr.Dante's will work...
  3. OnClientMouseEnter only detects mouse over gui elements, not the dx ones, i myself tried it over dx, didn't work, make an invisible gui element behind the dx and then use the event... EDIT : Didn't see the above post while typing ^
  4. Mann56

    Setting Money

    Hey guys, i was working on a performance modshop where i encountered an issue when i try to get money of the item Here for example , i have a vehicle with mass 800 kg, i then set the mass value to 801, then it outputs 20$ in money, which is perfect but when i type 802 after typing 801, instead of showing 40$ it shows 80$(it does 20$ (previous money) + 20 +40 ) and i dont know why it happens... Any help? local mass_label = guiCreateLabel(sx*50,sy*150,sx*400,sy*25,"Mass",false,performanceWindow) local mass_button = guiCreateButton(sx*300,sy*150,sx*100,sy*25,car_handling["mass"],false,performanceWindow) local massprice_label = guiCreateLabel(sx*430,sy*150,sx*100,sy*25,"20$ / 1 kg",false,performanceWindow) addEventHandler("onClientGUIClick",mass_button,function(button,state) if button == "left" and state == "up" then guiSetVisible(mass_button,false) local mass_edit = guiCreateEdit(sx*300,sy*150,sx*100,sy*25,car_handling["mass"],false,performanceWindow) addEventHandler("onClientKey",root,function(button,release) if button == "enter" and tostring(release) == "false" then mass_money = 0 guiSetVisible(mass_edit,false) guiSetVisible(mass_button,true) local mass_value = guiGetText(mass_edit) guiSetText(mass_button,mass_value) mass_money = (mass_value - car_handling["mass"])*20 if mass_money < 0 then mass_money = 0 - mass_money end outputChatBox(mass_money) moneyToTake = mass_money + moneyToTake guiSetText(checkoutMoney_label,moneyToTake) end end) end end)
  5. Mann56

    Exhaust sound

    Great idea !! Thanks mate
  6. Mann56

    Exhaust sound

    Hey guys, Is there any way to change the exhaust sound of a vehicle?
  7. Mann56

    Lookat camera

    You mean set the camera to a fixed point? Yes you can use setCameraMatrix to set the camera and after your work is done, you can return your camera to your player by setCameraTarget
  8. Can you show us how you called onSpawnPoliceOfficerLS? Also, if you want you can just post your code in [lua] and [ / lua] tags instead of uploading photos to another website and showing, might save you some time.
  9. The forum is long dead. People instead prefer to directly post in scripting or resources forum if they need anything...
  10. Working great, thanks buddy!!
  11. Well obviously your code is incorrect, I will try to re script it for you A'ight , i just can't find the error since 2 hours
  12. It still doesn't work, after 2 secs the rectangle just gets somewhat lighter, doesn't go off.... i did that before too, after that i put the remove event handler out
  13. But dude, the function won't work if outside i have some args in it that won't work outside it's parent function. I already tried it.
  14. Hello guys, I've been making a script where i am outputting text on user's click, but it doesn't seem to fade away after timer does it's job. Any help? function addVehScreenInfo ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( clickedElement ) then local elementType = getElementType ( clickedElement ) if elementType == "vehicle" then local occupants = getVehicleOccupants(clickedElement) function drawtheScene() dxDrawRectangle(absoluteX-15,absoluteY-20,300,100,tocolor(0,0,0,75),false) dxDrawText(getVehicleName(clickedElement),absoluteX,absoluteY,300,20,tocolor(255,255,255,255),sx*0.7,"bankgothic") dxDrawText("Driver : " ..getPlayerName(occupants[0]).."",absoluteX,absoluteY+20,300,20,tocolor(255,255,255,255),sx*0.7,"bankgothic") end addEventHandler("onClientRender",root,drawtheScene) setTimer ( stopVehRender,2000, 1) end end end addEventHandler ( "onClientClick", getRootElement(), addVehScreenInfo ) function stopVehRender() removeEventHandler("onClientRender",root,drawtheScene) end
  15. Well , i think textures don't support videos, you must try shaders, and i have no knowledge of HLSL....
  16. Glad it helped Yes you can try texture , but i recommend a browser if you are going to play from internet(like most guys do).
  17. As i told you earlier, posX,posY,posZ Enter that cord there at which your Material Line will face. That will work.
  18. Well if you don't mention the faceto arguments the front will be faced to your camera so everytime you move your camera or move yourself it will rotate as well, give in the cords i showed you in the code above and the thing should just face it and not rotate. Rotation is due to movement of your camera.
  19. I'd suggest to make all the scripts again as MTA has way more functions and features than SA:MP , you must try them
  20. local img = dxCreateTexture( "images/bstatus.png" ) addEventHandler("onClientRender", root, function() -- x,y,z, targetx,targety,targetz,texture,width,color dxDrawMaterialLine3D (1757.3798828125, -1665.0810546875, 20.4108648300173,1756.3798828125, -1665.0810546875, 16,img, 2, tocolor(255,255,255,255),posX,posY,posZ )-- the camera will always face these cords end)
  21. You mean the resolution of the material line? Just set the start and end cords they are vertical though , starting x,y and z is the upper position and ending ones are at the bottom. If i got the question wrong, you can explain it once more. Also make sure the material you are drawing the line with exists, since you are getting that error. EDIT : Did you read this? set a cord where the screen will force at, if not specified it will move according to the camera.
  22. Yes you can use textures to create the video on the screen, if you are getting video from internet you can make a browser and put it in the Dx Material Line...
×
×
  • Create New...