 
        TheSmart
Members- 
                Posts516
- 
                Joined
- 
                Last visited
Everything posted by TheSmart
- 
	that should work? but it not working no error in debugscript 3 function applyShader ( ) local shader = dxCreateShader ( "shader.fx" ); -- creating shader local texture = dxCreateTexture ( "test.png" ); -- creating texture from image if ( shader and texture ) then -- checking if everything is okay dxSetShaderValue ( shader, "Tex0", texture ); -- applying texture to shader setElementModel ( localPlayer, 1 ); -- setting skin to player engineApplyShaderToWorldTexture ( shader, "*", localPlayer ); -- applying shader for player who used command end end addCommandHandler ( "shader", applyShader ); -- creating command /shader to applyShader function.
- 
	now getting that error http://prntscr.com/7w6ohv and dxDrawRectangle won't show why?
- 
	any error in debugscript 3?
- 
	so i made this but it doesn't work addEventHandler("onClientResourceStart", resourceRoot, function (panel) label = guiCreateLabel(278, 325, 247, 49, "Test", false) memo = guiCreateMemo(606, 277, 466, 381, "", false) dxDrawRectangle(262, 243, 846, 464, tocolor(13, 13, 13, 227), false) dxDrawRectangle(279, 323, 246, 55, tocolor(14, 11, 11, 227), false) addEventHandler("onClientGUIClick", root, panel) end ) function onClickBtnTest(button,state) if(button == "left" and state == "up") then testtxt = fileOpen("test.txt", true) test1 = fileRead(rulestxt, 50000) guiSetText(memo, test1) end addEventHandler("onClientGUIClick", label, onClickBtnTest) end end function () bindKey ("F1", "down", panel) end that error http://prntscr.com/7w6964
- 
	addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function(player) if isPedInVehicle(source) then addVehicleUpgrade(getPedOccupiedVehicle(source),1010) takePlayerMoney ( player, 1000 ) outputChatBox ( "You Bought a Nitro", getRootElement(), 0, 0, 0, true ) else outputChatBox ( "You need 1000 to buy nitro", getRootElement(), 0, 0, 0, true ) end end )
- 
	really i didn't get you but i think you need to buy nitro by money? so then use it addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function(player) if isPedInVehicle(source) then addVehicleUpgrade(getPedOccupiedVehicle(source),1010) takePlayerMoney ( player, 1000 ) outputChatBox ( "You Bought a Nitro", getRootElement(), 0, 0, 0, true ) else outputChatBox ( "You need 1000 to buy nitro", getRootElement(), 0, 0, 0, true ) end end )
- 
	any error in debugscript 3?
- 
	try this local maxDistance = 12 -- the distance showing 3dtext local ped = createPed (ID,x,y,z) 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( "Text here", x, y+1.5, _, _, tocolor( 255, 0, 0, 255 ), 1, myFont, "center", "center" ) end end end )
- 
	Hey guys! i got the cinema script but it have some error i got some bug in video file idk how to fix it can anybody fix it? Client : Video -- PURPOSE: Playing videos on cinema room screens. local video = { shader = dxCreateShader("replaceTexture.fx"), browser, fullscreen, screenTextures = { -- should be loaded from xml? [7901] = "bobobillboard1", [2596] = "cj_tv_screen", [2296] = "cj_tv_screen", [16377] = "cj_tv_screen", [2700] = "cj_tv_screen" } } if not video.shader then outputChatBox("CRITICAL ERROR: #F2F2F2Can't create shader. You will not able to see videos properly. (Free memory for MTA: " .. dxGetStatus().VideoMemoryFreeForMTA .. " MB)", 255, 0, 0, true) end function playVideo(room, seconds) local vid, screens, url = getElementData(room, "video"), getElementData(room, "screens") if not screens then outputChatBox("ERROR: Room doesn't have assigned any screen.") return end if vid then if vid[1] == "yt" then url = "http://youtube.com/tv/#/watch?v=" .. vid[2] .. "&mode=transport" if seconds then outputChatBox("Passed seconds: " .. seconds) url = url .. "&t=" .. seconds .. "s" -- &t=120s (tv and normal link) end elseif vid[1] == "vimeo" then url = "http://player.vimeo.com/video/" .. vid[2] .. "?autoplay=1" if seconds then outputChatBox("Passed seconds: " .. seconds) url = url .. "t=0m" .. seconds .. "s" end elseif vid[1] == "dailymotion" then url = "http://dailymotion.com/embed/video/" .. vid[2] .. "?autoplay=1&html=1&info=0&related=0&quality=480" if seconds then outputChatBox("Passed seconds: " .. seconds) url = url .. "&start=" .. seconds end elseif vid[1] == "soundcloud" then --url = "http://w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks/" .. vid[2] .. "&auto_play=true&hide_related=true&visual=true&show_comments=false&buying=false&liking=false&download=false&sharing=false" --url = "http://w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks/146340923&auto_play=true&visual=true" -- no time parameter url = "http://soundcloud.com/" .. vid[2] -- time parameter but no autoplay .. wtf if seconds then outputChatBox("Passed seconds: " .. seconds) url = url .. "#t=" .. seconds .. "s" end elseif vid[1] == "twitch" then url = "http://twitch.tv/" .. vid[2] .. "/popout" end else url = "http://redknife.tk/mta/cinema/novideo.html" end if not isElement(video.browser) then video.browser = createBrowser(sX, sY, false) end outputDebugString("Trying to load url: " .. url) --[[if isBrowserURLBlocked(url) then -- and url ~= "html/novideo.html" -- bugged in outputChatBox("You don't allowed to view this site, please use /permissions (" .. url .. ")") else loadBrowserURL(video.browser, url) end]]-- loadBrowserURL(video.browser, url) dxSetShaderValue(video.shader, "Tex0", video.browser) for k, v in pairs(screens) do engineApplyShaderToWorldTexture(video.shader, video.screenTextures[getElementModel(v)], v) end end function stopVideo(room) if isElement(video.browser) then outputChatBox("stopVideo") if not room then room = getElementData(localPlayer, "colshape") end if isElement(room) then local screens = getElementData(room, "screens") if screens then for k, v in pairs(screens) do engineRemoveShaderFromWorldTexture(video.shader, video.screenTextures[getElementModel(v)], v) end end if video.fullscreen then removeEventHandler("onClientRender", root, renderVideoOnFullscreen) video.fullscreen = false end destroyElement(video.browser) end end end addEventHandler("onClientPlayerWasted", localPlayer, stopVideo) function renderVideoOnFullscreen() dxDrawImage(0, 0, sX, sY, video.browser) end function toggleFullscreen() if isElement(video.browser) then if video.fullscreen then removeEventHandler("onClientRender", root, renderVideoOnFullscreen) else addEventHandler("onClientRender", root, renderVideoOnFullscreen) end video.fullscreen = not video.fullscreen end end bindKey("O", "down", -- show video controls function() if isElement(video.browser) and not request.searchingVideo then injectBrowserMouseMove(video.browser, 1, 1) injectBrowserMouseMove(video.browser, 0, 0) end end ) this is error that i got http://prntscr.com/7vmkib
- 
	that would be better if u give me example to do that
- 
	Hey guys! today im trying to make dxbutton but i don't know why its not working function dxPanel() ourButton = guiCreateButton(499, 451, 290, 37, "", false) guiSetAlpha(ourButton, 0.00) guiSetProperty(ourButton, "NormalTextColour", "AA000000") dxDrawRectangle(369, 289, 525, 397, tocolor(0, 0, 0, 170), false) dxDrawText("Click The Button", 502, 450, 789, 488, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) showCursor(true) end addEventHandler ( "onClientGUIClick", ourButton, openOurMemo ) function bindTheKeys () bindKey ( "F1", "down", dxPanel ) end function Memo() ourMemo = guiCreateMemo(336, 332, 632, 382, "is Awesome", false) end function openOurMemo() if ( guiGetVisible ( ourMemo ) == false ) then guiSetVisible ( ourMemo, true ) local currentState = isCursorShowing () local oppositeState = not currentState showCursor ( oppositeState ) end end that error i got http://prntscr.com/7vdsea
- 
	Im too stupid to understard this, and Im not good understand english language. use this then : http://translate.google.com/
- 
	copy all of the code and remove all code from client file then put it
- 
	copy it and paste it to client file
- 
	function Superman.cmdSuperman() if ( not getPlayerTeam ( localPlayer ) or getTeamName ( getPlayerTeam ( localPlayer ) ) ~= 'Staff' ) then return end local self = Superman if isPedInVehicle(localPlayer) or isPlayerFlying(localPlayer) then return end setElementVelocity(localPlayer, 0, 0, TAKEOFF_VELOCITY) setTimer(Superman.startFlight, TAKEOFF_FLIGHT_DELAY, 1) end function Superman.startFlight() local self = Superman if isPlayerFlying(localPlayer) then return end triggerServerEvent("superman:start", rootElement) setPlayerFlying(localPlayer, true) setElementVelocity(localPlayer, 0, 0, 0) self.currentSpeed = 0 self.extraVelocity = { x = 0, y = 0, z = 0 } end
- 
	hey guys! i made it from *** but it not working here is it code local webBrowser = createBrowser(1200, 675) addCommandHandler("youtube", function() loadBrowserURL(webBrowser, "https://www.youtube.com/watch?v=kdemFfbS5H0") addEventHandler("onClientRender", root, function() -- Update texture data updateBrowser(webBrowser) -- We can simply draw the webbrowser now since it is a standard DirectX texture local x, y = 110.7, 1024.15 dxDrawMaterialLine3D(x, y, 23.25, x, y, 14.75, webBrowser, 18.2, tocolor(255, 255, 255, 255), x, y+1, 19) end ) end )
