Jump to content

تصحيح كود اول ما لاعب يدخل سيرفر ادخلو تشوفوه


Recommended Posts

السلام عليكم

عملت كود ان اول ما لاعب يدخل سيرفر يعطيه الاشياء لي حطيتها ممكن تصححوه مو عم يشتغل صحيح الكود

addEventHandler ( "onPlayerJoin", 
function () 
outputChatBox ( "Welcome " .. joinedPlayerName .. " to ".. سيرفر .."!" , source, 255, 255, 255 ) 
setPlayerMoney (root,1000) 
ooutputChatBox( "تم اعطائك نقود" ) 
  setPlayerTeam ( source, NoTeam ) 
  outputChatBox( "لقد تم نقلك الى : " Team... ) 
  local armor = getPedArmor ( me ) 
  outputChatBox( "Your armor: " .. armor ) 
  getPedWeapon(id,38) 
            end 
        end 
    end 
) 

وطبعا ابي الكود مره واحد يعطي الاعب الفلوس وكذا مو كل ما يدخل فقط مره اعطوني الفنكش

Link to comment
  • Replies 65
  • Created
  • Last Reply

Top Posters In This Topic

givePlayerMoney 
setPedArmor 
giveWeapon 

اما بالنسبة للمرة وحدة يعطيه

عندك طريقتين وحدة

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

ووحدة عبر قواعد البيانات وتنحفظ على سرياله

الطريقة الثانية قد سويتها لو تبحث بالمنتدى تلقاها

Link to comment
السلام عليكم

عملت كود ان اول ما لاعب يدخل سيرفر يعطيه الاشياء لي حطيتها ممكن تصححوه مو عم يشتغل صحيح الكود

addEventHandler ( "onPlayerJoin", 
function () 
outputChatBox ( "Welcome " .. joinedPlayerName .. " to ".. سيرفر .."!" , source, 255, 255, 255 ) 
setPlayerMoney (root,1000) 
ooutputChatBox( "تم اعطائك نقود" ) 
  setPlayerTeam ( source, NoTeam ) 
  outputChatBox( "لقد تم نقلك الى : " Team... ) 
  local armor = getPedArmor ( me ) 
  outputChatBox( "Your armor: " .. armor ) 
  getPedWeapon(id,38) 
            end 
        end 
    end 
) 

وطبعا ابي الكود مره واحد يعطي الاعب الفلوس وكذا مو كل ما يدخل فقط مره اعطوني الفنكش

الكود هريس

لكن عندي لك اسئلة

سيرفر + joinedPlayerName هنا ليه حاط

و على اي اساس او من وين جات الفكرة براسك و ايش تضن انه الكلمة ذي تسوي؟

outputChatBox ( "Welcome " .. joinedPlayerName .. " to ".. سيرفر .."!" , source, 255, 255, 255 ) 

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

بالضبط؟ root هنا ليه حطيت

و ايش تضن ذا السطر راح يسوي؟

setPlayerMoney (root,1000) 

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

بالضبط؟ me هنا ليه حطيت

local armor = getPedArmor ( me ) 

بالضبط؟ وليه رقم 38 تحديداً؟ id هنا ليه حطيت

و ايش تضن ذا السطر راح يسوي؟

getPedWeapon(id,38) 

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

أنت حاط 3 اندات ممكن توضح السبب؟

            end 
        end 
    end 

Link to comment

كودك متهرس اكثر من متهرس مره وحده بالهريس -_-

local NoTeam =  createTeam('تيم المعاقين') 
  
addEventHandler ( "onPlayerSpawn",root, 
function () 
  outputChatBox ( "Welcome " .. getPlayerName(source) .. " to ".. getServerName() .."!" , source, 255, 255, 255 ) 
  givePlayerMoney (source,1000) 
  outputChatBox( "تم اعطائك نقود",source ) 
  setPlayerTeam ( source, NoTeam ) 
  outputChatBox( "لقد تم نقلك الى : تيم المعاقين",source ) 
  outputChatBox( "Your armor: " ..getPedArmor( source ).."",source ) 
  giveWeapon(source,38,9999) 
end ) 

Link to comment
كودك متهرس اكثر من متهرس مره وحده بالهريس -_-
local NoTeam =  createTeam('تيم المعاقين') 
  
addEventHandler ( "onPlayerSpawn",root, 
function () 
  outputChatBox ( "Welcome " .. getPlayerName(source) .. " to ".. getServerName() .."!" , source, 255, 255, 255 ) 
  givePlayerMoney (source,1000) 
  outputChatBox( "تم اعطائك نقود",source ) 
  setPlayerTeam ( source, NoTeam ) 
  outputChatBox( "لقد تم نقلك الى : تيم المعاقين",source ) 
  outputChatBox( "Your armor: " ..getPedArmor( source ).."",source ) 
  giveWeapon(source,38,9999) 
end ) 

المعاقين :lol:

Link to comment

هههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههه

والله ضحكت على كودكـ وتقفيط تابل .. بدايه جيدهـ + هذا الكود الصحيح

local team1 = createTeam( "No Team" ) 
  
addEventHandler("onPlayerJoin", root, function (    ) 
    outputChatBox("Welcome ".. getPlayerName(  source  ) .." to ".. getServerName(    ) .." !", source, 255, 255, 255 ) 
    givePlayerMoney (  source, 1000  ) 
    outputChatBox("تم اعطائك نقود", source, 255, 255, 255 ) 
    setPlayerTeam ( source, team1 ) 
    outputChatBox("No Team تم نقلك إلى فريق", source, 255, 255, 255 ) 
    giveWeapon(  source, 38, 9999  ) 
    outputChatBox("Minigun تم اعطائك سلاح", source, 255, 255, 255 ) 
    outputChatBox("Your Armor : ".. getPedArmor(  source  ) .."", source, 255, 255, 255 ) 
end ) 

الكود مجرب 100% تمام

Link to comment

طيب ممكن تقلي

الحين عملت كود ان مثلا فيني اوزع خلاطات لسيرفر شوفه

    function () 
       giveWeapon ( source, 38, 500 ) 
            outputConsole ( "تم اعطائك الخلاط ايها الاعب", thePlayer ) 
      addEventHandler ( "onPlayerDamage", getRootElement(), headshotKill ) 
            function() 
            utputConsole ( "تم سحب الخلاط منك بسبب موتك ايها الاعب", thePlayer ) 
       takeWeapon( thePlayer, 38 ) 
         end 
    end 
) 
    
   
  
  
  
  

صح ولا لا؟؟

Link to comment
طيب ممكن تقلي

الحين عملت كود ان مثلا فيني اوزع خلاطات لسيرفر شوفه

    function () 
       giveWeapon ( source, 38, 500 ) 
            outputConsole ( "تم اعطائك الخلاط ايها الاعب", thePlayer ) 
      addEventHandler ( "onPlayerDamage", getRootElement(), headshotKill ) 
            function() 
            utputConsole ( "تم سحب الخلاط منك بسبب موتك ايها الاعب", thePlayer ) 
       takeWeapon( thePlayer, 38 ) 
         end 
    end 
) 
  
    
   
  
  
  
  

صح ولا لا؟؟

أنششهد الويكي متعلم منك :roll:

Link to comment
    function () 
       giveWeapon ( source, 38, 500 ) 
            outputConsole ( "تم اعطائك الخلاط ايها الاعب", thePlayer ) 
      addEventHandler ( "onPlayerDamage", getRootElement(), headshotKill ) 
            function() 
            utputConsole ( "تم سحب الخلاط منك بسبب موتك ايها الاعب", thePlayer ) 
       takeWeapon( thePlayer, 38 ) 
         end 
    end 
) 

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

ولا كل مايخش يجيه ؟

او كلمة تكتبهآ في اف8 يجي للكل ؟

وبعدين ابسآلك !

function()

حاط اثنين وش الوضع !

Link to comment
    function () 
       giveWeapon ( source, 38, 500 ) 
            outputConsole ( "تم اعطائك الخلاط ايها الاعب", thePlayer ) 
      addEventHandler ( "onPlayerDamage", getRootElement(), headshotKill ) 
            function() 
            utputConsole ( "تم سحب الخلاط منك بسبب موتك ايها الاعب", thePlayer ) 
       takeWeapon( thePlayer, 38 ) 
         end 
    end 
) 

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

ولا كل مايخش يجيه ؟

او كلمة تكتبهآ في اف8 يجي للكل ؟

وبعدين ابسآلك !

function()

حاط اثنين وش الوضع !

لآ يرجال تارك كل ذي الهريسة ومنتبه على مرتين

function()

:lol::lol::lol::lol:

Link to comment
    function () 
       giveWeapon ( source, 38, 500 ) 
            outputConsole ( "تم اعطائك الخلاط ايها الاعب", thePlayer ) 
      addEventHandler ( "onPlayerDamage", getRootElement(), headshotKill ) 
            function() 
            utputConsole ( "تم سحب الخلاط منك بسبب موتك ايها الاعب", thePlayer ) 
       takeWeapon( thePlayer, 38 ) 
         end 
    end 
) 

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

ولا كل مايخش يجيه ؟

او كلمة تكتبهآ في اف8 يجي للكل ؟

وبعدين ابسآلك !

function()

حاط اثنين وش الوضع !

لآ يرجال تارك كل ذي الهريسة ومنتبه على مرتين

function()

ماعلي من الهريسهه خخ

انا شد انتباهي اكثر فنكشين ليه ؟ ض2

غير ذي الي شاطحه في النص

      addEventHandler ( "onPlayerDamage", getRootElement(), headshotKill ) 

خخخخخخخخخخخخخخخخخخخخ

واللاعب مو معرف خخ :lol::lol::lol::lol:

Link to comment
    function () 
       giveWeapon ( source, 38, 500 ) 
            outputConsole ( "تم اعطائك الخلاط ايها الاعب", thePlayer ) 
      addEventHandler ( "onPlayerDamage", getRootElement(), headshotKill ) 
            function() 
            utputConsole ( "تم سحب الخلاط منك بسبب موتك ايها الاعب", thePlayer ) 
       takeWeapon( thePlayer, 38 ) 
         end 
    end 
) 

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

ولا كل مايخش يجيه ؟

او كلمة تكتبهآ في اف8 يجي للكل ؟

وبعدين ابسآلك !

function()

حاط اثنين وش الوضع !

لآ يرجال تارك كل ذي الهريسة ومنتبه على مرتين

function()

ماعلي من الهريسهه خخ

انا شد انتباهي اكثر فنكشين ليه ؟ ض2

غير ذي الي شاطحه في النص

      addEventHandler ( "onPlayerDamage", getRootElement(), headshotKill ) 

خخخخخخخخخخخخخخخخخخخخ

واللاعب مو معرف خخ :lol::lol::lol::lol:

وانا مستغرب ليه فيه 2 ايند

طلع الرجال حاط 2 فنكشن حقه حقه :roll:

Link to comment

جـرب * .

إذا مات يـروح السـلاح takeWeapon مـلاحظة : مـافي فنكشن .

addEventHandler ('onPlayerJoin', root, 
function () 
  giveWeapon (source, 38, 5000) 
   outputChatBox ('تـم أعـطائك خـلاط *', source, 255, 255, 0, true) 
 end 
) 
  
addEventHandler ('onPlayerWasted', root, 
function () 
  outputChatBox ('لـقد ذهـب الخـلاط لأن تـم قـتـلك *', source, 255, 0, 0, true) 
 end 
) 
Link to comment

حبيبي وضح وش تبي بالضبط + كودكـ كله خطأ

thePlayer و

لازم تكون داخل الفنشكن .. انت شفتها في الكود الي طرحته وحطيتها تحسب لها تأثير :lol:

function( thePlayer ) لازم تكفون زي كذا

بعدين ليه الحدث شاطح في النص وحاط 2 فنكشن

المهم .. الكود كله خطأ ووضح اكثر وش تبي بالضبط : )

Link to comment

ومن قآل مافيه فنكشن سحب سلاح ؟

  
addEventHandler ('onPlayerJoin', root,function (player) 
  giveWeapon (player, 38, 5000) 
   outputChatBox ('تـم أعـطائك خـلاط *', player, 255, 255, 0, true) 
 end 
) 
  
addEventHandler ('onPlayerWasted', root,function (player) 
   takeWeapon( player, 38 ) 
  outputChatBox ('لـقد ذهـب الخـلاط لأن تـم قـتـلك *', player, 255, 0, 0, true) 
 end 
) 

Edited by Guest
Link to comment

ممكن تقلي شو مشكله ذا الكود هو انا حاطه مثل سفتي لشرطه ابيه انا حاطه يحط عند الاضاء قدام السياره لون احمر وازرق ابيه بس يشغل بحرف الاتش السفتي يصير يعمل احمر وازرق

الكود

bindKey ( "H") 
function ( thePlayer, command, red, green, blue ) 
red = tonumber ( red ) 
    blue = tonumber ( blue ) 
    if(not color) then 
    setVehicleHeadLightColor(theVehicle,596) 
    setVehicleHeadLightColor(theVehicle,598) 
    setVehicleHeadLightColor(theVehicle,497) 
    setVehicleHeadLightColor(theVehicle,599) 
    setVehicleHeadLightColor(theVehicle,601) 
    setVehicleHeadLightColor(theVehicle,490) 
    setVehicleHeadLightColor(theVehicle,528) 
    setVehicleHeadLightColor(theVehicle,601) 
     end 
    end 
) 
     

لا تقولو خبيصه هه

Link to comment

طيب كذا يصير؟

function stats (player) 
local x, y, z = getElementPosition( player ) 
   veh = createVehicle ( 411, x, y, z ) 
   stats = setVehicleLightState ( veh, 0, 1 ) 
 warpPedIntoVehicle ( player, veh)  
end 
addCommandHandler("lights",stats) 

ممكن تعديل اخليه بس لسياره الشرطه وبدون كلمه باف 8

Link to comment

شوفولي هنا انا حطات ان اول ما واحد يلق الماركر لي انا حطيتها يصير عنده 6 نجوم انا حطات الاحداثيات

function ( thePlayer ) 
 createMarker (x, z, y) 
setPlayerWantedLevel ( thePlayer, 6 ) 
outputChatBox ( getPlayerName ( thePlayer ) .. " لقد اصبح عندك 6 نجوم بسبب ..... " ) 
   end 
 end 
  

Link to comment
شوفولي هنا انا حطات ان اول ما واحد يلق الماركر لي انا حطيتها يصير عنده 6 نجوم انا حطات الاحداثيات
function ( thePlayer ) 
 createMarker (x, z, y) 
setPlayerWantedLevel ( thePlayer, 6 ) 
outputChatBox ( getPlayerName ( thePlayer ) .. " لقد اصبح عندك 6 نجوم بسبب ..... " ) 
   end 
 end 
  

هريسه

:lol::lol::lol::lol::lol::lol::lol::lol::lol::lol::lol::lol:

وين الحدث + ليه في 3 اند

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