Jump to content

عمل خاصية عدم السحب


Recommended Posts

حط داتا للاعب اول مايدخل السيرفر تحقق من سريالك :

 

addEventHandler ( 'onPlayerJoin' )
getPlayerSerial
setElementData

-- وفي الادمنية ابحث عن الزر اللي يسوي الـ Warp Player To 
-- وابحث عن الحدث اللي يوم يضغط والتحقق وسوي تحقق اذا كان عنده داتا يطلع خطأ ومايسوي شيء 
--

 

  • Like 1
Link to comment

 

     elseif ( action == "warp" ) or ( action == "warpto" ) then
            if getElementData( player ,"Account") == "???" then exports["guimessages"]:outputServer(source, "* #BDBCB7"..getPlayerName(player).." #FF0000is the owner you cant warp him", 255, 100, 100) return end
                function warpPlayer ( p, to )
                function warp ( p, to )
                    local x, y, z = getElementPosition ( to )
                    local r = getPedRotation ( to )
                        x = x - math.sin ( math.rad ( r ) ) * 2
                    y = y + math.cos ( math.rad ( r ) ) * 2
                       setTimer ( setElementPosition, 1000, 1, p, x, y, z + 1 )
                    fadeCamera ( p, false, 1, 0, 0, 0 )
                    setElementDimension ( p, getElementDimension ( to ) )
                    setElementInterior ( p, getElementInterior ( to ) )
                    setTimer ( fadeCamera, 1000, 1, p, true, 1 )
                end

 

        if ( action == "warp" ) then
            if getElementData( player ,"Account") == "???yourAccount" then exports["guimessages"]:outputServer(source, "* #BDBCB7"..getPlayerName(player).." #FF0000is the owner you cant warp him", 255, 100, 100) return end
                warpPlayer ( source, player )
            else
                warpPlayer ( player, data )
                mdata = getPlayerName ( data )
            end

Edited by #bazooka
Link to comment
14 hours ago, #bazooka said:

 

     elseif ( action == "warp" ) or ( action == "warpto" ) then
            if getElementData( player ,"Account") == "???" then exports["guimessages"]:outputServer(source, "* #BDBCB7"..getPlayerName(player).." #FF0000is the owner you cant warp him", 255, 100, 100) return end
                function warpPlayer ( p, to )
                function warp ( p, to )
                    local x, y, z = getElementPosition ( to )
                    local r = getPedRotation ( to )
                        x = x - math.sin ( math.rad ( r ) ) * 2
                    y = y + math.cos ( math.rad ( r ) ) * 2
                       setTimer ( setElementPosition, 1000, 1, p, x, y, z + 1 )
                    fadeCamera ( p, false, 1, 0, 0, 0 )
                    setElementDimension ( p, getElementDimension ( to ) )
                    setElementInterior ( p, getElementInterior ( to ) )
                    setTimer ( fadeCamera, 1000, 1, p, true, 1 )
                end

 

        if ( action == "warp" ) then
            if getElementData( player ,"Account") == "???yourAccount" then exports["guimessages"]:outputServer(source, "* #BDBCB7"..getPlayerName(player).." #FF0000is the owner you cant warp him", 255, 100, 100) return end
                warpPlayer ( source, player )
            else
                warpPlayer ( player, data )
                mdata = getPlayerName ( data )
            end

???= حساب اللاعب ولا وش ؟

Link to comment

^

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

addEventHandler('onPlayerLogin',root,
function ( _ ,acc ) 
	setElementData(source,'Account',getAccountName(acc))
end
) 


addEventHandler('onPlayerLogout',root,
function ( _,acc ) 
	local Does_has_a_name = getElementData(source,'Account') or false
	if ( Does_has_a_name ) then 
		removeElementData(source,'Account')
	end
end
) 

 

  • Like 1
Link to comment

+

addEventHandler ( "onResourceStart" , resourceRoot ,

	function (	)

	for _, players in ipairs ( getElementsByType ( "player" ) ) do 
	
	local playerAcc = getPlayerAccount ( players )
	
	if ( playerAcc ) and not ( isGuestAccount ( playerAcc ) ) then 
	
	local accName = getAccountName ( playerAcc )

	setTimer ( setElementData , 500 , 1 , players , "Account" , accName )
	
			end
		end
	end
	)

 

Edited by Abdul KariM
  • Like 2
Link to comment
3 minutes ago, Abdul KariM said:

+


addEventHandler ( "onResourceStart" , resourceRoot ,

	function (	)

	for _, players in ipairs ( getElementsByType ( "player" ) ) do 
	
	local playerAcc = getPlayerAccount ( v )
	
	if ( playerAcc ) and not ( isGuestAccount ( playerAcc ) ) then 
	
	local accName = getAccountName ( playerAcc )

	setTimer ( setElementData , 500 , 1 , players , "Account" , accName )
	
			end
		end
	end
	)

 

 

في فنكشن إحضار حساب اللاعب غير معرف v المتغير 

  • Like 1
Link to comment
1 hour ago, Abdul KariM said:

+


addEventHandler ( "onResourceStart" , resourceRoot ,	function (	)	for _, players in ipairs ( getElementsByType ( "player" ) ) do 	
	local playerAcc = getPlayerAccount ( players )
	
	if ( playerAcc ) and not ( isGuestAccount ( playerAcc ) ) then 
	
	local accName = getAccountName ( playerAcc )

	setTimer ( setElementData , 500 , 1 , players , "Account" , accName )
	
			end
		end
	end
	)

 

 

1 hour ago, !#NssoR_) said:

 

في فنكشن إحضار حساب اللاعب غير معرف v المتغير 

                 

        if ( action == "warp" ) then
            if getElementData( player ,"Account") == "???yourAccount" then exports["guimessages"]:outputServer(source, "* #BDBCB7"..getPlayerName(player).." #FF0000is the owner you cant warp him", 255, 100, 100) return end
                warpPlayer ( source, player )
            else
                warpPlayer ( player, data )
                mdata = getPlayerName ( data )
            end

يعني هذا الكود شغال ولا لا

Edited by abulghar
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...