Jump to content

[Solved] Event Player - By Nssor


Recommended Posts

سلام عليكم ورحمة الله وبركاته

هل يوجد حدث عند اللاعب يتحرك ؟

او في طريقة اسوي يوم اللاعب يتحرك يصير شيء ؟؟

Edited by Guest
Link to comment

function isElementMoving ( theElement ) 
    if isElement ( theElement ) then  
        local x, y, z = getElementVelocity( theElement )  
        return x ~= 0 or y ~= 0 or z ~= 0  
    end 
  
    return false 
end 

مثال من الويكي

  
local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution (width and height) 
  
function idleCheck () 
    local state   = "Unknown" 
    local element = getPedOccupiedVehicle ( localPlayer ) or localPlayer 
  
    -- Check whether the player is moving or not. 
    if isElementMoving ( element ) then 
        state = "moving" 
    else 
        state = "idling" 
    end 
  
    -- Write our state string to the lower left corner of the screen 
    dxDrawText ( "You are " .. state .. "!", 40, screenHeight - 40, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "default" ) 
end 
  
-- Keep the text visible with onClientRender. 
addEventHandler ( "onClientRender", root, idleCheck ) 

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