Jump to content

تصحيح كود ارجو الافاده


Recommended Posts

طلب تصحيح هذا الكود رسباون للمقرات

الكود

        addEventHandler('onPlayerSpawn', root,function() 
    if getTeamName(getPlayerTeam(source)) == "Police" and getElementData(source, 'gang') == '[sWAT]' then 
    setTimer(setElementPosition, 500, 1, source, 1893.33215,489.56143,36.00030) 
    setPedSkin ( player, 230 ) 
    setElementHealth ( player, 100 ) 
    setPedArmor ( player, 100 ) 
    end       
    end 
    ) 

Link to comment

أسمح لي اخوي اوضح أخطاءك

طبعآ جربت كودك اخوي وعرفت شنو الاخطاء

  
   addEventHandler('onPlayerSpawn', root,function() 
    if getTeamName(getPlayerTeam(source)) == "Police" and getElementData(source, 'gang') == '[sWAT]' then -- ElementData بما أنه تيم    ماله داعي  
    setTimer(setElementPosition, 500, 1, source, 1893.33215,489.56143,36.00030) -- الموقع فوق البحر  
    setPedSkin ( player, 230 ) -- لازم تستخدم تايمر هنا وحط المدة 50 جزء من الثانية , واستخدم امر  
-- setElementModel   
--    source مو معرفة , لازم تحط  player ثانيآ  
    setElementHealth ( player, 100 ) -- source نفس الكلام لازم تحط 
    setPedArmor ( player, 100 ) -- هنا ايضآ 
    end       
    end 
    ) 

 

وهذا كود شغال إذا حبيت تجربه

 

  
       addEventHandler('onPlayerSpawn', root, 
       function() 
    if getTeamName(getPlayerTeam(source)) == "Police"  then 
    setTimer(setElementPosition, 50, 1, source, 1893.33215,489.56143,36.00030) 
   setTimer(setElementModel , 50 , 1 , source , 230) 
    setElementHealth ( source, 30) 
    setPedArmor ( source, 100 ) 
    end       
    end 
     
    ) 
  

Link to comment

-- Server Side # 
addEventHandler('onPlayerSpawn', root,function() 
    if getPlayerTeam(source) and getTeamName( getPlayerTeam(source) ) == 'Police'  then 
        setTimer( function( source ) 
            setElementPosition( source, 1893.33215,489.56143,36.00030 ) 
                setElementModel( source , 230 ) 
                    setPedArmor( source, 1000 ) 
            end,1000,1,source) 
        end       
    end 
) 
Edited by Guest
Link to comment
-- Server Side # 
local Timer = {} 
  
addEventHandler('onPlayerSpawn', root,function() 
    if getPlayerTeam(source) and getTeamName( getPlayerTeam(source) ) == 'Police'  then 
        if isTimer( Timer[source] ) then destroyElement(Timer[source]) Timer[source] = nil end 
            Timer[source] = setTimer( function( ) 
                setElementPosition( source, 1893.33215,489.56143,36.00030 ) 
                    setElementModel( source , 230 ) 
                        setPedArmor( source, 1000 ) 
            end,1000,1,source) 
        end       
    end 
) 

https://wiki.multitheftauto.com/wiki/SetTimer

Once a timer has finished repeating, it no longer exists.
Link to comment
ممكن موت ورا بعض اكثر من مره ؟

يعني يمكن يسوي انتحار من الفري روم اكثر من مره .

واذا مات ورا بعض اكثر من مره وش راح يصير ؟

التايمر ثانية وينحذف مايحتاج تتحقق ولا جدول

وسطر 7 في كودك لازم تحط

source في الفنكشن

Link to comment
ممكن موت ورا بعض اكثر من مره ؟

يعني يمكن يسوي انتحار من الفري روم اكثر من مره .

واذا مات ورا بعض اكثر من مره وش راح يصير ؟

التايمر ثانية وينحذف مايحتاج تتحقق ولا جدول

وسطر 7 في كودك لازم تحط

source في الفنكشن

timesToExecute: The number of times you want the timer to execute, or 0 for infinite repetitions.

لازم يحط 0 علشان يتكرر إلى لانهاية

Link to comment

timesToExecute: The number of times you want the timer to execute, or 0 for infinite repetitions.

لازم يحط 0 علشان يتكرر إلى لانهاية

باللهي ماكان احد يعرف : ( ؟

اجل ليه ماقلتها من الاول -__- دامك تعرفها

Link to comment

اجل ليه ماقلتها من الاول -__- دامك تعرفها

ب مناسبة ايش اقولها ؟

بعدين النقاش بيني وبين ذابيست وهو فاهم وش اقصد وانت الظاهر فهمت غلط

@The Best

على العموم ياذبيست ممكن تحصل مشكلة اذا كان التايمر اكثر من ثانية والافضل التحقق

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