Jump to content

طلب فنكشات --m


Simba

Recommended Posts

createMarker------- تسوي ماركر 
  
onMarkerHit------ عند لمس الماركر 
givePlayerMoney  --------اعطاء فلوس 
  
onMarkerLeave------- عند الخروج من الماركر 
takePlayerMoney------ سحب فلوس 

ما بعرف اذا في كمان بس اعتقد هاد كلشي

Link to comment
local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) 
  
addEventHandler ("onMarkerHit", myMarker, 
function () 
givePlayerMoney (player, 100000 ) 
end) 
  
local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) 
  
addEventHandler ("onMarkerLeave", myMarker 
function () 
takePlayerMoney (player, 100000 ) 
end) 

صح كذا ؟؟

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

مع اني مااا اعرف اسويها :oops:

Link to comment

local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) 
  
addEventHandler ( "onMarkerHit", myMarker, function ( element ) 
    if getElementType ( element ) == "player" then  
      givePlayerMoney ( element, 100000 ) 
      end 
end ) 
  
addEventHandler ( "onMarkerLeave", myMarker, function ( element ) 
    if getElementType ( element ) == "player" then  
      takePlayerMoney ( element, 100000 ) 
      end 
end ) 
  
Link to comment
local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) 
  
addEventHandler ( "onMarkerHit", myMarker, function ( element ) 
    if getElementType ( element ) == "player" then  
      givePlayerMoney ( element, 100000 ) 
      end 
end ) 
  
addEventHandler ( "onMarkerLeave", myMarker, function ( element ) 
    if getElementType ( element ) == "player" then  
      takePlayerMoney ( element, 100000 ) 
      end 
end ) 
  

شكرا لك اشتغل

وشكرا لانك علمتني كيف اسوي تحقق للالمنت

هذا الي كنت احتاجه :D

Link to comment
local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) 
  
addEventHandler ( "onMarkerHit", myMarker, function ( element ) 
    if getElementType ( element ) == "player" then  
      givePlayerMoney ( element, 100000 ) 
      end 
end ) 
  
addEventHandler ( "onMarkerLeave", myMarker, function ( element ) 
    if getElementType ( element ) == "player" then  
      takePlayerMoney ( element, 100000 ) 
      end 
end ) 
  

شكرا لك اشتغل

وشكرا لانك علمتني كيف اسوي تحقق للالمنت

هذا الي كنت احتاجه :D

حياك الله

Link to comment
local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) 
  
addEventHandler ( "onMarkerHit", myMarker, function ( element ) 
    if getElementType ( element ) == "player" then 
      setTimer(givePlayerMoney,10000,1,element, 100000) 
      end 
end ) 
  
addEventHandler ( "onMarkerLeave", myMarker, function ( element ) 
    if getElementType ( element ) == "player" then 
      takePlayerMoney ( element, 100000 ) 
      end 
end ) 

Link to comment

انا سويت هيك بس لما ادخل الماركر ما يصير شي

و انا ما بعرف استحدم و ايش فايدتة

isTimer 

addEventHandler ( "onMarkerHit", myMarker, 
 setTimer( 
function ( element ) 
    if getElementType ( element ) == "player" then 
      givePlayerMoney ( element, 100000 ) 
      end 
end ) 
,1000,0) 

Link to comment

بالنسبة لـ isTimer

التاكد من التايمر شغال ولا لا

------------------------

  
addEventHandler ( "onMarkerHit", myMarker,function ( element ) 
if ( getElementType(element) == "player" and not isPedInVehicle(element) ) then 
setTimer(function ( element ) givePlayerMoney ( element, 100000 ) end,1000,0,element) 
end 
end) 
Link to comment
local myMarker     = createMarker ( x, y, z, "cylinder", 2, 255, 255, 255, 255 ); 
local Timer        = {  }; 
local Money        = 100000 
  
addEventHandler ( "onMarkerHit", myMarker,  
    function ( element ) 
        if getElementType ( element ) == "player" and not isPedInVehicle ( element ) then 
            if isTimer ( Timer [ element ] ) then killTimer ( Timer [ element ] ) end 
            Timer [ element ] = setTimer ( function ( ) givePlayerMoney ( element, Money ); end, 1000, 0 ); 
        end 
    end  
); 
  
addEventHandler ( "onMarkerLeave", myMarker,  
    function ( element ) 
        if getElementType ( element ) == "player" then 
            if isTimer ( Timer [ element ] ) then  
                killTimer ( Timer [ element ] ); 
            end 
        Timer [ element ] = nil 
        end 
    end  
); 

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