Jump to content

تصحيح كود اذا لمس الماركر يعطي سلاح


Recommended Posts

local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler( "onMarkerHit",root, 
    function ( ) 
     giveWeapon ( source, 30, 200 )  
  
    if ( weapon ==  30) then 
            createProjectile(getLocalPlayer(),17,hitX, hitY, hitZ) 
            end 
end 
) 
  

ابغيه اذا لمس الماركر يجيه سلاح ويصير السلاح يطلق قنابل مدة دقيقتن

Link to comment
local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler( "onMarkerHit",root, 
    function ( ) 
     giveWeapon ( source, 30, 200 ) 
    if ( weapon ==  30) then 
        createProjectile ( localPlayer, 17 ) 
            end 
end 
) 

Link to comment
local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler( "onMarkerHit",root, 
    function ( ) 
     giveWeapon ( source, 30, 200 ) 
    if ( weapon ==  30) then 
        createProjectile ( localPlayer, 17 ) 
            end 
end 
) 

كلنت وسيرفر في كود واحد ؟

لازم يسوي ترقر .

Link to comment
local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler( "onMarkerHit",root, 
    function ( ) 
     giveWeapon ( source, 30, 200 ) 
    if ( weapon ==  30) then 
        createProjectile ( localPlayer, 17 ) 
            end 
end 
) 

root ?? weapon ?? localPlayer ??

Link to comment
local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler( "onMarkerHit",root, 
    function ( ) 
     giveWeapon ( source, 30, 200 ) 
    if ( weapon ==  30) then 
        createProjectile ( localPlayer, 17 ) 
            end 
end 
) 

root ?? weapon ?? localPlayer ??

local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
    function MarkerHit (weapon ) 
     giveWeapon ( source, 30, 200 ) 
    if ( weapon ==  30) then 
        createProjectile ( getLocalPlayer, 17 ) -- i think... 
            end 
end 
addEventHandler( "onMarkerHit",marker,MarkerHit) 
  

Link to comment
local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler( "onMarkerHit",root, 
    function ( ) 
     giveWeapon ( source, 30, 200 ) 
    if ( weapon ==  30) then 
        createProjectile ( localPlayer, 17 ) 
            end 
end 
) 

root ?? weapon ?? localPlayer ??

local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
    function MarkerHit (weapon ) 
     giveWeapon ( source, 30, 200 ) 
    if ( weapon ==  30) then 
        createProjectile ( getLocalPlayer, 17 ) -- i think... 
            end 
end 
addEventHandler( "onMarkerHit",marker,MarkerHit) 
  

Weapon? Client And Server Functions ? lol and source?

Link to comment

كلنت

local marker = createMarker( 1707.98828125, -450.6650390625, 33.507831573486,"cylinder", 1.5, 255, 255, 0, 170 ) 
  
  
    function h ()    
            triggerServerEvent("give",localPlayer) 
            end 
             
function hh(weapon,ammo,ammoInClip,hitX,hitY,hitZ,hitElement) 
           if ( weapon ==  30) then 
            createProjectile(getLocalPlayer(),17,hitX, hitY, hitZ) 
  
addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), hh) 
  
            end 
end 
             
  
addEventHandler( "onClientMarkerHit",marker,h) 
  

سيرفر

addEvent("give", true) 
addEventHandler("give", getRootElement(), 
function () 
giveWeapon (source, 30, 200 ) 
end) 

جرب :roll:

Link to comment
local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler( "onMarkerHit",root, 
    function ( ) 
     giveWeapon ( source, 30, 200 ) 
    if ( weapon ==  30) then 
        createProjectile ( localPlayer, 17 ) 
            end 
end 
) 

root ?? weapon ?? localPlayer ??

local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
    function MarkerHit (weapon ) 
     giveWeapon ( source, 30, 200 ) 
    if ( weapon ==  30) then 
        createProjectile ( getLocalPlayer, 17 ) -- i think... 
            end 
end 
addEventHandler( "onMarkerHit",marker,MarkerHit) 
  

يخوي قلت لك لازم تسوي ترقر .

Link to comment
local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler( "onMarkerHit",root, 
    function ( ) 
     giveWeapon ( source, 30, 200 )  
  
    if ( weapon ==  30) then 
            createProjectile(getLocalPlayer(),17,hitX, hitY, hitZ) 
            end 
end 
) 
  

ابغيه اذا لمس الماركر يجيه سلاح ويصير السلاح يطلق قنابل مدة دقيقتن

Link to comment
local marker = createMarker( 370.82556152344,-2047.6633300781,7.4,"cylinder", 1.5, 255, 255, 0, 170 ) 
  
addEventHandler( "onMarkerHit",root, 
    function ( ) 
     giveWeapon ( source, 30, 200 )  
  
    if ( weapon ==  30) then 
            createProjectile(getLocalPlayer(),17,hitX, hitY, hitZ) 
            end 
end 
) 
  

ابغيه اذا لمس الماركر يجيه سلاح ويصير السلاح يطلق قنابل مدة دقيقتن

setTimer 
cancelEvent ( ) 

:mrgreen:

Link to comment

-- Client Side

local marker = createMarker( 1707.98828125, -450.6650390625, 33.507831573486,"cylinder", 1.5, 255, 255, 0, 170 ) 
local timer 
  
function onHitMarker( player ) 
    if ( player == localPlayer ) and not ( isTimer(timer) ) then 
        timer = setTimer(function() end,120000,1) 
        triggerServerEvent("onGiveWeapon",localPlayer) 
    end  
end 
addEventHandler ( "onClientMarkerHit", marker, onHitMarker ) 
  
  
function onLocalPlayerFire( weapon, ammo, ammoInClip, hitX, hitY, hitZ ) 
    if ( weapon == 30 ) and ( isTimer(timer) ) then 
         createProjectile(localPlayer, 17, hitX, hitY, hitZ) 
    end 
end 
addEventHandler ( "onClientPlayerWeaponFire", localPlayer, onLocalPlayerFire ) 

-- Server Side

function giveTheWeapon() 
    giveWeapon(source,30,200) 
end 
addEvent("onGiveWeapon", true) 
addEventHandler("onGiveWeapon", getRootElement(), giveTheWeapon ) 

الكود غير مجرب، سويته سريع ذذ

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...