Jump to content

تصحيح كود الليزر


Recommended Posts

السلام انا سويت كود الليزر الي ابيه تصححون الكود او تعطوني افنت اذا كان يصوب

وهذا كود

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

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

بور كودك احسه كثير شوي لو فيه كود مختصر

وتابل اذا استخدمت الافنت الي عطيتني اذا صوبت يختفي

هذا كودي

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
بور كودك احسه كثير شوي لو فيه كود مختصر

وتابل اذا استخدمت الافنت الي عطيتني اذا صوبت يختفي

هذا كودي

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...