Jump to content

حل مشكله


MA[S]RIY

Recommended Posts

Posted

السلام عليكم

addCommandHandler("test",
function ( source )
local _Data = getElementData( source, "Warning" )
if _Data then
if _Data == 3 then
outputChatBox( _Data, source, 255, 0, 0, true )
setElementData( source, "Warning", 0 )
else
setElementData( source, "Warning", _Data + 1 )
outputChatBox( _Data + 1, source, 255, 0, 0, true )
end
else
setElementData( source, "Warning", 1 )
outputChatBox( "1", source, 255, 0, 0, true )
end
end
)

ابي اعرف وين المشكله الي بالكود

م في اي اخطاء تطلع بالدي بق

 

الكود عبار عن لما تكتب باف 8 امر

يطلع لك رقم 1

ولما تكتبها مره ثانيه تجيب الداتا الي هي الواحد وتزود عليه واحد ويطلع بالشات 2

ولما يكتبها ثالث مره يطلع له بالشات 3 ويصفر الداتا

وين الخطاء ؟

مصري #

Posted (edited)
addCommandHandler("test",
  function( source )
local data = getElementData(source, "Warning")
if ( data == 3 ) then
setElementData(source, "Warning", 0)
outputChatBox(data, source, 255, 0, 0, true )
elseif ( data == 0 ) then
setElementData(source,"Warning", data+1)
outputChatBox("1", source, 255, 0, 0, true )
elseif ( data == 1 ) then
setElementData(source,"Warning", data+1)
outputChatBox("2", source, 255, 0, 0, true )
end
end)

 

Edited by #Himoo
Posted
addCommandHandler( 'test',
function( Player )
	local Data = ( getElementData( Player, 'Warning' ) or 0 ) + 1
	if ( Data < 3 ) then 
		return outputChatBox( Data, Player, 0, 0, 0, true ), setElementData( Player, 'Warning', Data )
	else
		outputChatBox( 'Error', Player, 0, 0, 0, true )
	end
end )

* جوال *

Posted
2 hours ago, MARIY said:

^الكودين جربتهم وم نفعو^

م في اي اخطاْ بالدي بق

؟

اتوقع لاز تشيك على طريقة حطك للداتا على اللاعب

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted

مايجوز انك تستعمل الامر

'test'

غير اسم الامر وجرب

Wiki:

Note: You cannot use "check", "list" or "test" as a command name.

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