Jump to content

x[مساعدة]x


Doffy

Recommended Posts

3 minutes ago, Master_MTA said:

اها اخي هل غيرت هذي؟

    guiSetText(lbl,getElementData(localPlayer,"health"))
وهذي

 guiSetText(lbl,"0")
 

غير

lbl

    if getElementData(localPlayer,"health") or 0 >0 and getElementData(localPlayer,"health") or 0 ~=0 then
 

وغير هذا السطر

ادري غيرت وبرضو -_- 

Link to comment
1 minute ago, Abu-Solo said:

تأكد من تغيير اسم الليبل بـ اسم الليبل حقك ^^

يخوي تأكدت ونفس القصة يعطيني وانا ما معي نقاط حتي -_-

+ كمان ما ينقص من اللابيل

Link to comment

طيب عطني الكود كامل عشان أساعدك زين ، وين كود زر الشراء؟

الحين فهمت اللي تبي تسويه ، تفضل

Client

healthPoint = 0

addEventHandler ( 'onClientGUIClick', root, 
	function ( )
		if ( source == GUIEditor.button[2] ) then 
			if ( healthPoint <= 10 ) then
				triggerServerEvent ( "buy:Health", localPlayer, localPlayer )
				guiAntiFlood(GUIEditor.button[2],900)
				healthPoint = healthPoint + 1
			end
		end 
	end 
) 

bindKey("h","down",
	function ( )
		if ( healthPoint >= 1 ) then
			setElementHealth(localPlayer,100)
			healthPoint = healthPoint - 1
			guiSetText(GUIEditor.label[5],healthPoint)
		else
			outputChatBox('# You dont have a health point.',255,255,255,true)
		end
    end
)

Server

addEvent("buy:Health",true)
addEventHandler("buy:Health", root,
	function ( aPlayer )
		if ( getPlayerMoney(aPlayer) >= 10000 ) then 
			takePlayerMoney(aPlayer, 10000)
			outputChatBox('# You bought a health point succesfully.',255,255,255,true)
		else
			outputChatBox('# You dont have enough money.',255,255,255,true)
		end
	end
)

 

Link to comment
1 hour ago, N3xT said:

طيب عطني الكود كامل عشان أساعدك زين ، وين كود زر الشراء؟

الحين فهمت اللي تبي تسويه ، تفضل

Client


healthPoint = 0

addEventHandler ( 'onClientGUIClick', root, 
	function ( )
		if ( source == GUIEditor.button[2] ) then 
			if ( healthPoint <= 10 ) then
				triggerServerEvent ( "buy:Health", localPlayer, localPlayer )
				guiAntiFlood(GUIEditor.button[2],900)
				healthPoint = healthPoint + 1
			end
		end 
	end 
) 

bindKey("h","down",
	function ( )
		if ( healthPoint >= 1 ) then
			setElementHealth(localPlayer,100)
			healthPoint = healthPoint - 1
			guiSetText(GUIEditor.label[5],healthPoint)
		else
			outputChatBox('# You dont have a health point.',255,255,255,true)
		end
    end
)

Server


addEvent("buy:Health",true)
addEventHandler("buy:Health", root,
	function ( aPlayer )
		if ( getPlayerMoney(aPlayer) >= 10000 ) then 
			takePlayerMoney(aPlayer, 10000)
			outputChatBox('# You bought a health point succesfully.',255,255,255,true)
		else
			outputChatBox('# You dont have enough money.',255,255,255,true)
		end
	end
)

 

هو يبيها محفوظه

+

اتوقع الكود حقي مافيه خطا؟

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