Jump to content

كود صغير :-!


Recommended Posts

مشكور والله وماقصرت

بس فيه نقطه . مهمه

الحين اسوي ترايقر صح ؟ عشان الكود

setElementVisibleTo

هههههه والله اني شفرت نسيت انه سيرفر

حولت لك الكود كله سيرفر

غيره بالميتا الى سيرفر وجربه

#

Link to comment
ماكس الحين لايعطي فلوس ولا شيء @_@

جرب الحين عدلته

+

لازم تكون بماركر 1

غير الاحداثيات لكل ماركر + احداثيات نقل الاعب والاعبين للي تبيه .

/deubgscript 3

اذا فيه اخطاء

Link to comment
marker1 = createMarker(x, y, z, "cylinder", 2, 255, 0, 0) 
marker2 = createMarker(x, y, z, "cylinder", 2, 0, 0, 255) 
  
addEventHandler("onMarkerHit", resourceRoot, function(Hit) 
    if getElementType(Hit) == "player" then 
        if source == marker1 then 
            outputChatBox("1", root, 255, 0, 0) 
        elseif source == marker2 then 
            outputChatBox("2", root, 0, 0, 255) 
        end 
    end 
end) 

هذا اذ دخل الماركر الاول يكتب كلام بالشات

ونفس الشي مع الثاني تقدر تعدل عليه

Link to comment

مكس الغلط في كودك م حطيت الالمنت داخل الفكشن حقك

المفروض تخليه كذا

function ( element )

وتتحقق بـ

getElementType

انه لاعب

طيب انا ماسويت تحقق وضبط لاكن في الكلينت سايد

وتقدر ترجع للردود وتشوف . .

Link to comment
-- طيب جرب ذا

local mrr2 = createMarker ( -3332.5, -2513.099609375, -7.1999998092651, "cylinder", 50, 0, 0, 0, 1 ) 
local mrr1 = createMarker ( -3334.8994140625, -2608.3994140625, -7.1999998092651, "cylinder", 50, 0, 0, 0, 1 ) 
  
addEventHandler ('onClientMarkerHit', resourceRoot, 
function ( ) 
  if ( isElementWithinMarker ( localPlayer, mrr2 )) then 
  givePlayerMoney ( 1000 ) 
  outputChatBox(' * Your Correct ! and You have Won $ 1000 ! *', 255, 255, 0 ) 
  elseif ( isElementWithinMarker ( localPlayer, mrr1 )) then 
  outputChatBox ( ' * Worng ! Your Out ! *', 255, 255, 0 ) 
  setTimer(setElementPosition,20000, 1,localPlayer, -3322.3000488281, -2677.6000976563, 30.89999961853) 
  end 
end 
) 

هممممم على ما اظننن

الحدث كلينت !

وفنكشن

givePlayerMoney 

اذا حطيته كلينت بيعطيك فلوس وهمية !

يعني ما تقدر تشتري فيها !

Link to comment
لا الكود تعدل وحطيته سيرفر

onClientMarkerHit

خليتها زي ماقال ماكس

onMarkerHit

طيب جرب ذا - ---

كلينت ---

local mrr2 = createMarker ( -3332.5, -2513.099609375, -7.1999998092651, "cylinder", 50, 0, 0, 0, 1 ) 
local mrr1 = createMarker ( -3334.8994140625, -2608.3994140625, -7.1999998092651, "cylinder", 50, 0, 0, 0, 1 ) 
  
addEventHandler ('onClientMarkerHit', resourceRoot, 
function ( ) 
  if isElementWithinMarker ( localPlayer, mrr1 ) then 
  triggerServerEvent('OnHit', localPlayer ) 
  outputChatBox(' * Your Correct ! and You have Won $ 1000 ! *', 255, 255, 0 ) 
  setTimer(setElementPosition,20000, 1,localPlayer, -3322.3000488281, -2677.6000976563, 30.89999961853)--- نقل الفائز 
  elseif ( isElementWithinMarker ( localPlayer, mrr2 )) then 
  outputChatBox ( ' * Worng ! Your Out ! *', 255, 255, 0 ) 
  setTimer(setElementPosition,20000, 1,localPlayer, -3322.3000488281, -2677.6000976563, 30.89999961853)--- احداثيات الخاسر 
  end 
end 
) 

---- سيرفر

addEvent ( 'OnHit', true ) 
  
addEventHandler ( 'OnHit' , root, 
function ( ) 
   givePlayerMoney ( source, 1000 ) 
  end 
) 

طبعا mrr1

ذي للفائز

mrr2

للخاسر تأكد انك بالماركر الصحيح

+

/debugscript 3

Link to comment
بكذا

راح يطلع كل اللاعبين الي يروحون للماركر

mrr2

حتى لو هو صح

يابن الحلال انا مسوي لك ماركر 1 تغير الاحداثيات للاحداثيات الفائز وين تبي توديه . .

واذا فيه احد بماركر 2

تغير الاحداثيات للمكان اللي تبي تودي الخاسر له . .

Link to comment
ياخي لعبة

X O

السيرفر يعطي سؤال

اذا اللاعب عارف ان الاجابه صح يروح

O

و إذا السؤال معلومته غلط يروح

X

O = mrr1

X = mrr2

عرفت ,

طيب جرب الكود وغير الاحداثيات الماركارات + احداثيات النقل للخاسر والفائز ..

Link to comment
وكيف بتعرف انه اجابة السؤال هي غلط او صح ؟

يتحقق عن طريق

if ( isElementWithinMarker 

يطلع سؤال مثلا اسم صاحب السيرفر محمد

صح ام خطا

يروح لماركر 1 = يطلع له صح اذا هو فيه

واذا هو بماركر 2 يطلع له خطأ

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