Jump to content

مساعدة في set + get ElementData


WTF_

Recommended Posts



addEvent ( 'lol' , true ) 
addEventHandler ( 'lol' , root , function ( ) 
if getPlayerMoney ( source )  >= 20000 then 
takePlayerMoney ( source , 20000 ) 
outputChatBox ( "لقد إشتريت تذكرة الدخول لألعاب الدراجات النارية",localPlayer, 0,255,0 )
setElementData ( source , "tick" ,  "true" ) 
else 
outputChatBox ( "انت لا تملك المال الكافي !!!",localPlayer, 255,0,0 )

end 
end 
)

m1 = createMarker ( 2792.90430, -1721.76599, 12.8,"arrow", 2, 255, 255, 100 )
addEventHandler ( "onMarkerHit" , m1 , 
function ( hitElement ) 
local data = getElementData ( source, "tick" ) 
if data == "true" then 
setElementPosition (source ,  2792, -1721, 12.8 )   
else
outputChatBox ( "انت لا تملك المال الكافي !!!",localPlayer, 255,0,0 )
end 
end ) 

ليش لما يتحقق الإيفنت lol 

وألمس الماركر m1 

ما يسحبني للمكان الي أبيه

بل بيضهر لي الكلام

وحتى إن لم يتحقق الإيفنت lol 

بيضهر لي الكلام

Link to comment
addEvent ( 'lol' , true ) 
addEventHandler ( 'lol' , root , function ( ) 
if getPlayerMoney ( source )  >= 20000 then 
takePlayerMoney ( source , 20000 ) 
outputChatBox ( "لقد إشتريت تذكرة الدخول لألعاب الدراجات النارية",source, 0,255,0 )
setElementData ( source , "tick" , true ) 
else 
outputChatBox ( "انت لا تملك المال الكافي !!!",source, 255,0,0 )

end 
end 
)

m1 = createMarker ( 2792.90430, -1721.76599, 12.8,"arrow", 2, 255, 255, 100 )
addEventHandler ( "onMarkerHit" , m1 , 
function ( hitElement ) 
if ( getElementType ( hitElement ) == 'player' ) then
if ( getElementData ( source , 'tick' ) == true ) then
setElementPosition (source ,  2792, -1721, 12.8 )   
else
outputChatBox ( "انت لا تملك المال الكافي !!!",source, 255,0,0 )
end 
end
end ) 

جرب هذا ,
وتأكد أنه سيرفر :] 

Edited by MR.StoRm
Link to comment
3 minutes ago, MR.StoRm said:

addEvent ( 'lol' , true ) 
addEventHandler ( 'lol' , root , function ( ) 
if getPlayerMoney ( source )  >= 20000 then 
takePlayerMoney ( source , 20000 ) 
outputChatBox ( "لقد إشتريت تذكرة الدخول لألعاب الدراجات النارية",source, 0,255,0 )
setElementData ( source , "tick" , true ) 
else 
outputChatBox ( "انت لا تملك المال الكافي !!!",source, 255,0,0 )

end 
end 
)

m1 = createMarker ( 2792.90430, -1721.76599, 12.8,"arrow", 2, 255, 255, 100 )
addEventHandler ( "onMarkerHit" , m1 , 
function ( hitElement ) 
if ( getElementData ( source , 'tick' ) == true ) then
setElementPosition (source ,  2792, -1721, 12.8 )   
else
outputChatBox ( "انت لا تملك المال الكافي !!!",source, 255,0,0 )
end 
end ) 

جرب هذا ,
وتأكد أنه سيرفر :] 

لا ما اشتغل 

Link to comment
GUIEditor = {
    label = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        w1 = guiCreateWindow(158, 120, 422, 366, "Ticket System", false)
        guiWindowSetSizable(w1, false)
        guiSetAlpha(w1, 1.00)
        guiSetProperty(w1, "CaptionColour", "FFCE3094")

        b1 = guiCreateButton(116, 84, 204, 62, "شراء التذكرة", false, w1)
        guiSetFont(b1, "default-bold-small")
        guiSetProperty(b1, "NormalTextColour", "FFDB00FB")
        b2 = guiCreateButton(116, 174, 204, 62, "لا أريد", false, w1)
        guiSetFont(b2, "default-bold-small")
        guiSetProperty(b2, "NormalTextColour", "FF00F2FA")
        b3 = guiCreateButton(354, 322, 58, 34, "خروج", false, w1)
        guiSetFont(b3, "default-bold-small")
        guiSetProperty(b3, "NormalTextColour", "FFF90000")
        GUIEditor.label[1] = guiCreateLabel(76, 24, 288, 60, "تذكرة الدراجات : سعر التذكرة 20 الف ", false, w1)
        guiSetFont(GUIEditor.label[1], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[1], 97, 58, 195)
        guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false)
        guiLabelSetVerticalAlign(GUIEditor.label[1], "center")
        GUIEditor.label[2] = guiCreateLabel(10, 329, 110, 37, "", false, w1)
        guiSetFont(GUIEditor.label[2], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[2], 64, 202, 50)
        GUIEditor.label[3] = guiCreateLabel(33, 235, 362, 87, "", false, w1)    
    end
)
addEventHandler("onClientResourceStart", root,
    function()
guiSetVisible ( w1 , false )	
end 
)


m1 = createMarker ( 2774.73999, -1704.48718, 10.84375,"cylinder", 1.5, 255, 50, 100 )
addEventHandler ( "onClientMarkerHit" , m1 , 
function ( ) 
guiSetVisible ( w1 , true )
 showCursor ( true) 
 end 
 )
 
 addEventHandler ( 'onClientGUIClick', root, function (    )
if ( source == b1 ) then 
triggerServerEvent ( "lol" , localPlayer ) 
guiSetVisible ( w1 , false ) 
showCursor ( false ) 
elseif ( source == b3 ) then 
 guiSetVisible ( w1 , false ) 
showCursor ( false ) 
 elseif ( source == b2 ) then 
 guiSetVisible ( w1 , false ) 
showCursor ( false ) 
end 
end 
)

 

1 minute ago, MR.StoRm said:

ورني كلنت 


 

5 minutes ago, MR.StoRm said:

ورني كلنت 

ها اخوي ؟

Link to comment
GUIEditor = {
    label = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        w1 = guiCreateWindow(158, 120, 422, 366, "Ticket System", false)
        guiWindowSetSizable(w1, false)
        guiSetAlpha(w1, 1.00)
        guiSetProperty(w1, "CaptionColour", "FFCE3094")
        guiSetVisible ( w1 , false )
        b1 = guiCreateButton(116, 84, 204, 62, "شراء التذكرة", false, w1)
        guiSetFont(b1, "default-bold-small")
        guiSetProperty(b1, "NormalTextColour", "FFDB00FB")
        b2 = guiCreateButton(116, 174, 204, 62, "لا أريد", false, w1)
        guiSetFont(b2, "default-bold-small")
        guiSetProperty(b2, "NormalTextColour", "FF00F2FA")
        b3 = guiCreateButton(354, 322, 58, 34, "خروج", false, w1)
        guiSetFont(b3, "default-bold-small")
        guiSetProperty(b3, "NormalTextColour", "FFF90000")
        GUIEditor.label[1] = guiCreateLabel(76, 24, 288, 60, "تذكرة الدراجات : سعر التذكرة 20 الف ", false, w1)
        guiSetFont(GUIEditor.label[1], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[1], 97, 58, 195)
        guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false)
        guiLabelSetVerticalAlign(GUIEditor.label[1], "center")
        GUIEditor.label[2] = guiCreateLabel(10, 329, 110, 37, "", false, w1)
        guiSetFont(GUIEditor.label[2], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[2], 64, 202, 50)
        GUIEditor.label[3] = guiCreateLabel(33, 235, 362, 87, "", false, w1)    
    end
)



m1 = createMarker ( 2774.73999, -1704.48718, 10.84375,"cylinder", 1.5, 255, 50, 100 )
addEventHandler ( "onClientMarkerHit" , m1 , 
function ( hitElement ) 
if ( hitElement == localPlayer ) and ( getElementType ( hitElement ) == 'player' ) then
guiSetVisible ( w1 , true )
showCursor ( true) 
end 
end
)
 
addEventHandler ( 'onClientGUIClick', root, function (    )
    if ( source == b1 ) then 
        triggerServerEvent ( "lol" , localPlayer ) 
        guiSetVisible ( w1 , false ) 
        showCursor ( false ) 
            if ( source == b3 ) then 
            guiSetVisible ( w1 , false ) 
            showCursor ( false ) 
                if ( source == b2 ) then 
                guiSetVisible ( w1 , false ) 
                showCursor ( false ) 
				end
			end
	end
end
)

 

Link to comment
addEvent ( 'lol' , true ) 
addEventHandler ( 'lol', root, function ( ) 
    if ( getPlayerMoney ( source ) >= 20000 ) then 
        takePlayerMoney ( source, 20000 ) 
            outputChatBox ( 'لقد إشتريت تذكرة الدخول لألعاب الدراجات النارية', source, 0, 255, 0 )
        setElementData ( source, 'tick', true ) 
    else 
        outputChatBox ( 'انت لا تملك المال الكافي !!!', source, 255, 0, 0 )
    end 
end )

m1 = createMarker ( 2792.90430, -1721.76599, 12.8, 'arrow', 2, 255, 255, 100 )
addEventHandler ( 'onMarkerHit', m1, function ( hitElement )
    if ( getElementType ( hitElement ) == 'player' ) then if ( getElementData ( hitElement, 'tick' ) ) then
            setElementPosition ( hitElement, 2792, -1721, 12.8 )   
        else
            outputChatBox ( 'انت لا تملك المال الكافي !!!', hitElement, 255, 0, 0, true )
        end
    end 
end )

 

Edited by #,+( _xiRoc[K]; >
  • Like 1
Link to comment
2 minutes ago, #,+( _xiRoc[K]; > said:

addEvent ( 'lol' , true ) 
addEventHandler ( 'lol', root, function ( ) 
    if ( getPlayerMoney ( source ) >= 20000 ) then 
        takePlayerMoney ( source, 20000 ) 
            outputChatBox ( 'لقد إشتريت تذكرة الدخول لألعاب الدراجات النارية', source, 0, 255, 0 )
        setElementData ( source, 'tick', true ) 
    else 
        outputChatBox ( 'انت لا تملك المال الكافي !!!', source, 255, 0, 0 )
    end 
end )

m1 = createMarker ( 2792.90430, -1721.76599, 12.8, 'arrow', 2, 255, 255, 100 )
addEventHandler ( 'onMarkerHit', m1, function ( hitElement )
    if ( getElementType ( hitElement ) == 'player' and getElementData ( hitElement, 'tick' ) ) then
        setElementPosition ( hitElement, 2792, -1721, 12.8 )   
    else
        outputChatBox ( 'انت لا تملك المال الكافي !!!', hitElement, 255, 0, 0, true )
    end 
end )

 

افا مدري كيف نسيتها ,
مشكور عالتصحيح

Link to comment
35 minutes ago, MR.StoRm said:

addEvent ( 'lol' , true ) 
addEventHandler ( 'lol' , root , function ( ) 
if getPlayerMoney ( source )  >= 20000 then 
takePlayerMoney ( source , 20000 ) 
outputChatBox ( "لقد إشتريت تذكرة الدخول لألعاب الدراجات النارية",source, 0,255,0 )
setElementData ( source , "tick" , true ) 
else 
outputChatBox ( "انت لا تملك المال الكافي !!!",source, 255,0,0 )

end 
end 
)

m1 = createMarker ( 2792.90430, -1721.76599, 12.8,"arrow", 2, 255, 255, 100 )
addEventHandler ( "onMarkerHit" , m1 , 
function ( hitElement ) 
if ( getElementType ( hitElement ) == 'player' ) then
if ( getElementData ( source , 'tick' ) == true ) then
setElementPosition (source ,  2792, -1721, 12.8 )   
else
outputChatBox ( "انت لا تملك المال الكافي !!!",source, 255,0,0 )
end 
end
end ) 

جرب هذا ,
وتأكد أنه سيرفر :] 

تدري هنا سورس ماذا تمثل ؟

Link to comment

تفضل جرب :

addEvent ( "lol", true )
addEventHandler ( "lol", root,
	function ( )
		local money = getPlayerMoney (source)
		if money >= 20000 then
			takePlayerMoney ( source, 20000 )
			outputChatBox ( "لقد إشتريت تذكرة الدخول لألعاب الدراجات النارية",source, 0,255,0, true )
			setElementData ( source, "data", true )
		else
			outputChatBox ( "You dont have money.", source, 255, 0, 0, true )
		end
	end
)

addEventHandler ( "onMarkerHit", m1,
	function (hitElement)
		if getElementType (hitElement) == "player" and getElementData ( hitElement, "data" ) then
			setElementPosition ( hitElement, 2792, -1721, 12.8 )
		else
			outputChatBox ( "لم يتم وجود داتا معك.", hitElement, 255, 255, 255, true )
		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...