Jump to content

تحريك الاعب مثل البيد


Recommended Posts

الاسهل تستخدم ذذ

function walktheprisoner(thecop, theprisoner) 
        local copx, copy, copz = getElementPosition ( thecop ) 
        local prisonerx, prisonery, prisonerz = getElementPosition ( theprisoner ) 
        copangle = ( 360 - math.deg ( math.atan2 ( ( copx - prisonerx ), ( copy - prisonery ) ) ) ) % 360 
        setPedRotation ( theprisoner, copangle ) 
        setCameraTarget ( theprisoner, theprisoner ) 
        local dist = getDistanceBetweenPoints2D ( copx, copy, prisonerx, prisonery ) 
        if ( dist > 16 ) then 
            freetheguy ( theprisoner ) --FREES PRISONER IF HE GETS FAR AWAY 
        elseif ( dist > 12 ) then 
            setControlState ( theprisoner, "sprint", true ) 
            setControlState ( theprisoner, "walk", false ) 
            setControlState ( theprisoner, "forwards", true ) 
            local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) 
        elseif ( dist > 6 ) then 
            setControlState ( theprisoner, "sprint", false ) 
            setControlState ( theprisoner, "walk", false ) 
            setControlState ( theprisoner, "forwards", true ) 
            local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) 
        elseif ( dist > 1.5 ) then 
            setControlState ( theprisoner, "sprint", false ) 
            setControlState ( theprisoner, "walk", true ) 
            setControlState ( theprisoner, "forwards", true ) 
            local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) 
        elseif ( dist < 1.5 ) then 
            setControlState ( theprisoner, "sprint", false ) 
            setControlState ( theprisoner, "walk", false ) 
            setControlState ( theprisoner, "forwards", false ) 
            local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) 
    end 
end 

هذا من سكربت

legalsystem

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