==>ҭᾄlᾄl Posted September 21, 2012 Share Posted September 21, 2012 السلام انا سويت كود الليزر الي ابيه تصححون الكود او تعطوني افنت اذا كان يصوب وهذا كود client: function onGuiClick (button, state, absoluteX, absoluteY) if ( source == Button ) then x,y,z = getPedTargetStart( getLocalPlayer () ) x2,y2,z2 = getPedTargetEnd( getLocalPlayer () ) dxDrawLine3D(x,y,z, x2,y2,z2, tocolor(255,0,0), 2) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) الكود شغال لكن اذا صوبت ما يشتغل يشتغل اذا ظغطت الزر يشتغل ويطفى Link to comment
TAPL Posted September 21, 2012 Share Posted September 21, 2012 https://wiki.multitheftauto.com/wiki/DxDrawLine3D This function draws a 3D line between two points in the 3D world - rendered for one frame. This should be used in conjunction with onClientRender in order to display continuously. Link to comment
POWR Posted September 21, 2012 Share Posted September 21, 2012 client-side function onGuiClick (button, state, absoluteX, absoluteY) if ( source == shop99 ) then local PlayerMoney = getPlayerMoney() if ( PlayerMoney > 100 ) then takePlayerMoney(100) guiSetVisible ( Window ,false ) showCursor (false ) guiSetInputEnabled(false) triggerServerEvent ("aLaser", getLocalPlayer()) triggerEvent ("laaser", getLocalPlayer()) SetLaserEnabled(getLocalPlayer(), true) bindKey ( "l", "up", ToggleLaserEnabled ) setTimer(function () outputChatBox("*** [ Laser ] HAS END ***",255,255,0) triggerEvent("ChangeLaserState",getLocalPlayer(),false) triggerEvent("ublth",getLocalPlayer()) end,80000,1) else outputChatBox("Error #ffff00You don't have #00ff00[ $100 ] #ff0000 to buy laser #ffffff| #ffff00u have money #00ff00[ $".. PlayerMoney.. " ]",255,0,0,true) end end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) server-side addEvent("aLaser", true) addEventHandler("aLaser", getRootElement(), function() local name = getPlayerName(source) local r, g, b = getPlayerNametagColor ( source ) local color = string.format("#%02X%02X%02X", r, g, b) local playerTeam = getTeamName(getPlayerTeam(source)) or "N/A" outputChatBox ( "*** #ffffff[ #00ff00" .. name .. " #ffffff]#ffff00 Has Bought #ff0000laser#ffffff [ ".. color.. ""..playerTeam.."#ffffff ]", getRootElement(), 255, 0, 0, true ) outputChatBox ( "You Will Have Laser For 2 Minutes",source, 0, 255, 0, true ) outputChatBox ( "Press #ffffff[#00ff00 L #ffffff ]#ff0000 to open or close",source, 255, 255, 0, true ) triggerClientEvent(source,"LaserWin",source) triggerClientEvent(source,"blth",source) end ) Link to comment
==>ҭᾄlᾄl Posted September 21, 2012 Author Share Posted September 21, 2012 بور كودك احسه كثير شوي لو فيه كود مختصر وتابل اذا استخدمت الافنت الي عطيتني اذا صوبت يختفي هذا كودي function onGuiClick (button, state, absoluteX, absoluteY) if ( source == Button ) then function narBullets() x,y,z = getPedTargetStart( getLocalPlayer () ) x2,y2,z2 = getPedTargetEnd( getLocalPlayer () ) dxDrawLine3D(x,y,z, x2,y2,z2, tocolor(255,0,0), 2) end addEventHandler("onClientRender", getRootElement(), narBullets) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) Link to comment
TAPL Posted September 21, 2012 Share Posted September 21, 2012 بور كودك احسه كثير شوي لو فيه كود مختصر وتابل اذا استخدمت الافنت الي عطيتني اذا صوبت يختفي هذا كودي function onGuiClick (button, state, absoluteX, absoluteY) if ( source == Button ) then function narBullets() x,y,z = getPedTargetStart( getLocalPlayer () ) x2,y2,z2 = getPedTargetEnd( getLocalPlayer () ) dxDrawLine3D(x,y,z, x2,y2,z2, tocolor(255,0,0), 2) end addEventHandler("onClientRender", getRootElement(), narBullets) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) function onGuiClick (button, state, absoluteX, absoluteY) if ( source == Button ) then function narBullets() local x,y,z = getPedWeaponMuzzlePosition(localPlayer) x2,y2,z2 = getPedTargetCollision(localPlayer) if not x2 then x2,y2,z2 = getPedTargetEnd(localPlayer) end dxDrawLine3D(x,y,z, x2,y2,z2, tocolor(255,0,0), 2) end addEventHandler("onClientRender", root, narBullets) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) Link to comment
==>ҭᾄlᾄl Posted September 21, 2012 Author Share Posted September 21, 2012 مشكور تابل وماتقصر واحسن شي في اذا ما معك سلاح يطلع من يدك ليزر كانه عصا لكن يله اهم شي ليزر Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now