Jump to content

عند دخول السيرفر


MhLoSs

Recommended Posts

السلام عليكم كيف الحال ؟؟

ما اابي اطول عليكم

هذا كودي

addEventHandler("onResourceStart", resourceRoot, 
    function() 
        resetMapInfo() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  
Team = createTeam ( "Team", 255, 255, 255) 
function spawn(player) 
    if not isElement(player) then return end 
    repeat until spawnPlayer (player, 1678.7719726563, -2242.5017089844, 13.550055503845, 180, 0, 0, 0) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
    showChat(player, true) 
end 
  
addEventHandler("onPlayerJoin", root, 
    function() 
        spawn(source) 
    end 
) 

انا ابي اضيف للكود شيء بسيط

اللي هو عند دخول ابي ع طول يروح تيم معين

طبعا هذا هو التيم

Team = createTeam ( "Team", 255, 255, 255)

اتمنى افادتي

Link to comment
addEventHandler("onPlayerJoin", root, 
    function() 
        spawn(source) 
        setPlayerTeam(source,Team) 
    end 
) 

اوك تمت الافااده الف الف شكر

بس اخوي

عندي استفسار ثاني

Team = createTeam("Police",0,0,255) 
function spawnOnLogin (prevA, curA, autoLogin) 
    spawnPlayer (source, 1568.5632324219, -1691.4493408203, 5.890625, 180, Team) -- spawns player with random skin 
    fadeCamera (source, true) 
    setCameraTarget (source, source) 
end 
addEventHandler("onPlayerWasted", getRootElement(), spawnOnLogin) 

ابي الشخصية تنحفظ

يعني اذا مات الشخصيه تنحفظ

+

ابي اسوي جدوله للرسباون ماعرفت ذذ

حاولت

يعني كل ما يموت يروح ماكن

Link to comment

يعني تبي سباون عشوائي ؟

Pos = { 
   [1] = { x,y,z }, 
   [2] = { x,y,z } 
} 
  
addEventHandler('onPlayerWasted',root, 
function() 
    local x,y,z = unpack(Pos[math.random(#Pos)])   
    spawnPlayer (source,x,y,z)  
    end 
) 

اذا تبي تضيف في الجدول حط فاصله مثال ,

Pos = { 
   [1] = { x,y,z }, 
   [2] = { x,y,z }, 
   [3] = { x,y,z } 
} 

بالنسبه للشخصيه كيف تبي تحفظها ؟ اقصد ليه يعني ؟ وكيف تبي الحفظ؟ ومتى تبيه يحفظ؟

+ بالنسبه لكودك الي فوق حق السباون خطأ,

Syntax :

bool spawnPlayer ( player thePlayer, float x, float y, float z, [ int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil ] ) 

انت الحين حطيت Team في ارقومنت الشخصيه

Link to comment

اول شيء اشكرك اخوي و بس الحين مو ليتم معين للكل صح ؟

-----------------

بالنسبه للشخصيه كيف تبي تحفظها ؟ اقصد ليه يعني ؟ وكيف تبي الحفظ؟

" skin " يعني الحين انا معي شخصيه

مثلا رقم 282

لما اموت ارجع سي جي "0" ليه

Link to comment
policeSpawn = { 
    [1] = {1568.5632324219, -1691.4493408203, 5.890625, 180}, 
    [2] = {1580.01660, -1634.68750, 13.56188, 90.0}, 
    [3] = {1552.56165, -1675.75244, 16.19531, 90,0}, 
} 
      
    addEventHandler('onPlayerWasted',root, 
    function() 
        local x,y,z = unpack(policeSpawn[math.random(#policeSpawn)])   
        spawnPlayer (source,x,y,z) 
        setCameraTarget (source, source) 
        end 
    ) 
  
  
Team = createTeam("Police",0,0,255) 

1- ابي يكون الرسباون لتيم معين اللي هو الشرطه

2-حفظ الشخصيه بعد الموت لأن اذا مات ترجع سي جي0

3- ابي احط التدويره ع الشخصيه يعني لما يجي بارسباون ما يجي مقلوب<<يعني مقفي ولا معطيني ظهره هههههههه

4- سلااااااامتكم

Link to comment

Team = createTeam("Police",0,0,255) 
  
policeSpawn = { 
    [1] = {1568.5632324219, -1691.4493408203, 5.890625, 180}, 
    [2] = {1580.01660, -1634.68750, 13.56188, 90.0}, 
    [3] = {1552.56165, -1675.75244, 16.19531, 90.0} 
} 
      
addEventHandler('onPlayerWasted',root, 
function() 
    local team = getPlayerTeam(source) 
        if team and getTeamName(team) == 'Police' then 
            local x,y,z,rot = unpack(policeSpawn[math.random(#policeSpawn)])   
            spawnPlayer (source,x,y,z,rot) 
            setCameraTarget (source, source) 
        end 
    end 
) 

[1] = {1568.5632324219, -1691.4493408203, 5.890625, 180},

180 = هو الاتجاه ,

+ كان لازم تضيف اضافه بسيطه,

spawnPlayer (source,x,y,z,rot) 

بالنسبه لحفظ الشخصيه,

addEventHandler('onPlayerWasted',root, 
function() 
    Model = getElementModel(source) 
    end 
) 
  
addEventHandler('onPlayerSpawn',root, 
function() 
    setTimer(setElementModel,1500,1,source,Model) 
    end 
) 
Link to comment
Team = createTeam("Police",0,0,255) 
  
policeSpawn = { 
    [1] = {1568.5632324219, -1691.4493408203, 5.890625, 180}, 
    [2] = {1580.01660, -1634.68750, 13.56188, 90.0}, 
    [3] = {1552.56165, -1675.75244, 16.19531, 90.0} 
} 
      
addEventHandler('onPlayerWasted',root, 
function() 
    local team = getPlayerTeam(source) 
        if team and getTeamName(team) == 'Police' then 
            local x,y,z,rot = unpack(policeSpawn[math.random(#policeSpawn)])   
            spawnPlayer (source,x,y,z,rot) 
            setCameraTarget (source, source) 
        end 
    end 
) 

[1] = {1568.5632324219, -1691.4493408203, 5.890625, 180},

180 = هو الاتجاه ,

+ كان لازم تضيف اضافه بسيطه,

spawnPlayer (source,x,y,z,rot) 

بالنسبه لحفظ الشخصيه,

addEventHandler('onPlayerWasted',root, 
function() 
    Model = getElementModel(source) 
    end 
) 
  
addEventHandler('onPlayerSpawn',root, 
function() 
    setTimer(setElementModel,1500,1,source,Model) 
    end 
) 

الف الف الف الف شكر

ما قصرت بس حق حفظ الشخصيه هذا جهاز ولا وش الساالفه

Link to comment
العفو حيآك الله,

حق حفظ الشخصيه , اذا مات يجيب شخصيته ,

واذا سوى سباون يرجع الشخصيه حقه بعد ثانيه ونص, ذذ

متأكد من اللي تقوله انا مجرب بس ما رجع نفس الشخصيه

Link to comment

توني جربته وشغال ذذ

بعد ثانيه ونص ذذ يعني تقدر تشيل التايمر,

addEventHandler('onPlayerWasted',root, 
function() 
    Model = getElementModel(source) 
    end 
) 
  
addEventHandler('onPlayerSpawn',root, 
function() 
    setElementModel(source,Model) 
    end 
) 
Link to comment
توني جربته وشغال ذذ

بعد ثانيه ونص ذذ يعني تقدر تشيل التايمر,

addEventHandler('onPlayerWasted',root, 
function() 
    Model = getElementModel(source) 
    end 
) 
  
addEventHandler('onPlayerSpawn',root, 
function() 
    setElementModel(source,Model) 
    end 
) 

كودكك مو كويس

لو مات واحد و انحفظت شخصيته

و جا واحد ثاني بعده و مات تتغير شخصيه الاول لو سار له سباون الى شخصيت الثاني

خليها جداول تزبط

Link to comment
توني جربته وشغال ذذ

بعد ثانيه ونص ذذ يعني تقدر تشيل التايمر,

addEventHandler('onPlayerWasted',root, 
function() 
    Model = getElementModel(source) 
    end 
) 
  
addEventHandler('onPlayerSpawn',root, 
function() 
    setElementModel(source,Model) 
    end 
) 

لا ظبط الف الف الف الف الف الف الف الف شكر

طيب عندي طلب ثاني اللي هو

سحب سلاح معين من تيم "فريق" معين

اذا خرج من التيم "الفريق" ينسحب سلاح معين

Link to comment
اعذرني ما شفت ردك ذذ

isPlayerInTeam -- not

takeWeapon 
setTimer 

سوي تايمر يتحقق من ان الشخص مو في التيم,

if not isPlayerInTeam(source,team) then 

وسوي سحب للسلاح,

takeWeapon (source, id) 

مشكووووووور

بس متأكد من هذي

انا طلبي يسحب سلاح معين عند خروجه من التيم

التايمر وش دخله ؟؟

------------

توني جربته وشغال ذذ

بعد ثانيه ونص ذذ يعني تقدر تشيل التايمر,

addEventHandler('onPlayerWasted',root, 
function() 
    Model = getElementModel(source) 
    end 
) 
  
addEventHandler('onPlayerSpawn',root, 
function() 
    setElementModel(source,Model) 
    end 
) 

كودكك مو كويس

لو مات واحد و انحفظت شخصيته

و جا واحد ثاني بعده و مات تتغير شخصيه الاول لو سار له سباون الى شخصيت الثاني

خليها جداول تزبط

والله الجدوله حلوه انا مسوي جدوله لكن ما ظبطت مدري ليه

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