marker = createMarker ( .... )
local table = {
[ "ما اسمي ؟" ] = true,
[ "ما اسمكـ ؟" ] = false,
}
local values = { "ما اسمي ؟", "ما اسمكـ ؟" }
local randomvalue = values[math.random(1,#values)]
local random = table[randomvalue]
setElementData ( marker, "data", random )
outputChatBox( "* السؤال : "..randomvalue, root )
addEventHandler ( "onMarkerHit", resourceRoot, function ( element )
if ( source == marker ) then
if ( getElementType ( element ) == "player" ) then
if ( getElementData ( marker, "data" ) == true ) then
outputChatBox ( "* الاجابة هي صحيحة .", element )
else
outputChatBox ( "* الاجابة هي خطا .", element )
end
end
end
end )