The moVer Posted May 8, 2015 Share Posted May 8, 2015 السلام عليكم ورحمة الله وبركاته في سؤال ولي هو في Parameters بدون حدث يعني يسوي فنكشن مثلا زي كذا OutPut = function (mta) outputchatbox ("Hello") end يعني هاي الفنكشن تستعمل في فنكشنات زي كذا function onjoin() playSound("join.mp3") OutPut () end addEventHandler("onClientPlayerJoin", getRootElement(), onJoin) [mta] ?? Parameters من وين جاء Link to comment
TAPL Posted May 8, 2015 Share Posted May 8, 2015 كودك فيه اخطاء outputChatBox يفترض تكتبها outputchatbox مثلا onjoin بينما اسم الفنكشن انت حاطه onJoin اسم الفنكشن الي رابط فيه الحدث غير موجود/nil بالكود الي انت حاطه ما ارسلت اي قيمة يعني البارتمر رح يكون mta بالنسبة للبارتمر Link to comment
The moVer Posted May 8, 2015 Author Share Posted May 8, 2015 لاني سويت الكود بدون ما اجربه يعني لازم من الفنكشن الي استدعاه يعطيه بارتمر؟ Link to comment
TAPL Posted May 8, 2015 Share Posted May 8, 2015 OutPut = function(mta) outputChatBox(mta) end function onJoin() playSound("join.mp3") OutPut("Hello") end addEventHandler("onClientPlayerJoin", root, onJoin) Link to comment
The moVer Posted May 8, 2015 Author Share Posted May 8, 2015 شكرا تابل بس ابي اسألك سؤال ما ابي افتح موضوع جديد اقدر اخذ اسم اللاعب من account ؟؟ صح اني طلبت كثير بس انت كريم وانا بستاهل Lol Link to comment
TAPL Posted May 8, 2015 Share Posted May 8, 2015 لما اللاعب يسجل دخول حط اسم اللاعب في الحساب حقة اكاونت داتا و لما يغير اللاعب اسمه حط الأسم الجديد في الحساب اكاونت داتا إذا تبي تجيب اسم اللاعب من الأكاونت تجيبه من الأكاونت داتا الي حطيته لما سجل الدخول/غير اسمه getPlayerName getPlayerAccount isGuestAccount setAccountData getAccountData 'onPlayerLogin' 'onPlayerChangeNick' Link to comment
The moVer Posted May 8, 2015 Author Share Posted May 8, 2015 addEventHandler("onPlayerWasted", root, function(_, killer) if killer and getElementType(killer) == "player" then local checkGuest = getPlayerAccount(killer) if checkGuest and not isGuestAccount(checkGuest) then local Tkill = tonumber(getAccountData(checkGuest, "kills") or 0) if (Tkill+1 >= 1) then setAccountData(checkGuest, "kills", 0) setAccountData(checkGuest, "Level", (getAccountData(checkGuest, "Level") or 0) + 1) local TopTable = {} for i, account in ipairs(getAccounts()) do table.insert(TopTable, {account, (getAccountData(account, "Level") or 0)}) end local accounta = getAccountName(TopTable[1][1]) table.sort(TopTable, function(a, b) return a[2] > b[2] end) outputChatBox("AccountName: "..getAccountData(accounta,"name").." | Level: "..TopTable[1][2], Player, 255, 255, 255) else setAccountData(checkGuest, "kills", Tkill+1) end end end end) addEventHandler("onPlayerLogin", root, function () local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playername = getPlayerName( Source ) setAccountData ( playeraccount, "name", playername ) end end) function nickChangeHandler() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playername = getPlayerName( Source ) setAccountData ( playeraccount, "name", playername ) end end addEventHandler("onPlayerChangeNick", getRootElement(), nickChangeHandler) طيب وش مشكلة ذا الاخ debug:Script\server.lua:16: attempt to concatenate a boolean value Link to comment
N3xT Posted May 9, 2015 Share Posted May 9, 2015 addEventHandler("onPlayerWasted", root, function(_, killer) if killer and getElementType(killer) == "player" then local checkGuest = getPlayerAccount(killer) if checkGuest and not isGuestAccount(checkGuest) then local Tkill = tonumber(getAccountData(checkGuest, "kills") or 0) if (Tkill+1 >= 1) then setAccountData(checkGuest, "kills", 0) setAccountData(checkGuest, "Level", (getAccountData(checkGuest, "Level") or 0) + 1) local TopTable = {} for i, account in ipairs(getAccounts()) do table.insert(TopTable, {account, (getAccountData(account, "Level") or 0)}) end local accounta = getAccountName(TopTable[1][1]) table.sort(TopTable, function(a, b) return a[2] > b[2] end) outputChatBox("AccountName: "..getAccountData(accounta,"name").." | Level: "..TopTable[1][2], Player, 255, 255, 255) else setAccountData(checkGuest, "kills", Tkill+1) end end end end) addEventHandler("onPlayerLogin", root, function () local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playername = getPlayerName( Source ) setAccountData ( playeraccount, "name", playername ) end end) function nickChangeHandler() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playername = getPlayerName( Source ) setAccountData ( playeraccount, "name", playername ) end end addEventHandler("onPlayerChangeNick", getRootElement(), nickChangeHandler) طيب وش مشكلة ذا الاخ debug:Script\server.lua:16: attempt to concatenate a boolean value م فهمت بالظبط أنت وش تبي يسوي الكود ذا ؟ outputChatBox("AccountName: "..getAccountData(accounta,"name").." | Level: "..TopTable[1][2], Player, 255, 255, 255) Link to comment
The Killer Posted May 10, 2015 Share Posted May 10, 2015 addEventHandler ("onPlayerWasted", root, function(_, killer) if killer and getElementType (killer) == "player" then local checkGuest = getPlayerAccount (killer) if not isGuestAccount (checkGuest) then local Tkill = tonumber (getAccountData (checkGuest, "kills") or 0) if (Tkill+1 >= 1) then setAccountData (checkGuest, "kills", 0) setAccountData (checkGuest, "Level", (getAccountData (checkGuest, "Level") or 0) + 1) local TopTable = {} for i, account in ipairs (getAccounts ()) do table.insert (TopTable, {account, (getAccountData (account, "Level") or 0)}) end local accounta = getAccountName (TopTable[1][1]) table.sort (TopTable, function(a, b) return a[2] > b[2] end) outputChatBox ("AccountName: " .. getAccountData (accounta, "name") .. " | Level: " .. TopTable[1][2], killer, 255, 255, 255) else setAccountData (checkGuest, "kills", Tkill+1) end end end end ) addEventHandler("onPlayerLogin", root, function () local playeraccount = getPlayerAccount (source) if not isGuestAccount (playeraccount) then local playername = getPlayerName (source) setAccountData (playeraccount, "name", playername) end end ) addEventHandler ("onPlayerChangeNick", root, function (_, new) local playeraccount = getPlayerAccount (source) if not isGuestAccount (playeraccount) then setAccountData (playeraccount, "name", new) end end ) Link to comment
The Killer Posted May 10, 2015 Share Posted May 10, 2015 addEventHandler ("onPlayerWasted", root, function(_, killer) if killer and getElementType (killer) == "player" then local checkGuest = getPlayerAccount (killer) if not isGuestAccount (checkGuest) then local Tkill = tonumber (getAccountData (checkGuest, "kills") or 0) if (Tkill+1 >= 1) then setAccountData (checkGuest, "kills", 0) setAccountData (checkGuest, "Level", (getAccountData (checkGuest, "Level") or 0) + 1) local TopTable = {} for i, account in ipairs (getAccounts ()) do table.insert (TopTable, {account, (getAccountData (account, "Level") or 0)}) end local accounta = getAccountName (TopTable[1][1]) table.sort (TopTable, function(a, b) return a[2] > b[2] end) if not getAccountData (checkGuest, "name") then setAccountData (checkGuest, "name", getPlayerName (killer)) end outputChatBox ("AccountName: " .. getAccountData (checkGuest, "name") .. " | Level: " .. TopTable[1][2], killer, 255, 255, 255) else setAccountData (checkGuest, "kills", Tkill+1) end end end end ) addEventHandler("onPlayerLogin", root, function () local playeraccount = getPlayerAccount (source) if not isGuestAccount (playeraccount) then local playername = getPlayerName (source) setAccountData (playeraccount, "name", playername) end end ) addEventHandler ("onPlayerChangeNick", root, function (_, new) local playeraccount = getPlayerAccount (source) if not isGuestAccount (playeraccount) then setAccountData (playeraccount, "name", new) end end ) Link to comment
The moVer Posted May 10, 2015 Author Share Posted May 10, 2015 getAccountName (TopTable[1][1]) انا ابي اطلع الاسم حق ذا Link to comment
The Killer Posted May 10, 2015 Share Posted May 10, 2015 انت ما حددت وش تبي بالضبط قلت فوق ابيه يطلع الاسم وعطاك تابل الفنكشنات حقتها وجيت صححتها لك على انه يطلع الاسم حقه الحين تقول ابيه على اسم الحساب , حدد ,# جرب هذا: addEventHandler ("onPlayerWasted", root, function(_, killer) if killer and getElementType (killer) == "player" then local checkGuest = getPlayerAccount (killer) if not isGuestAccount (checkGuest) then local Tkill = tonumber (getAccountData (checkGuest, "kills") or 0) if (Tkill+1 >= 1) then setAccountData (checkGuest, "kills", 0) setAccountData (checkGuest, "Level", (getAccountData (checkGuest, "Level") or 0) + 1) local TopTable = {} for i, account in ipairs (getAccounts ()) do table.insert (TopTable, {getAccountName (account), (getAccountData (account, "Level") or 0)}) end table.sort (TopTable, function(a, b) return a[2] > b[2] end) if not getAccountData (checkGuest, "name") then setAccountData (checkGuest, "name", getPlayerName (killer)) end local level = getAccountData (killer, "Level") local acc = getAccountName (checkGuest) outputChatBox ("Account Name: " .. acc .. " | Level: " .. level, killer, 255, 255, 255) else setAccountData (checkGuest, "kills", Tkill+1) end end end end ) addEventHandler("onPlayerLogin", root, function () local playeraccount = getPlayerAccount (source) if not isGuestAccount (playeraccount) then local playername = getPlayerName (source) setAccountData (playeraccount, "name", playername) end end ) addEventHandler ("onPlayerChangeNick", root, function (_, new) local playeraccount = getPlayerAccount (source) if not isGuestAccount (playeraccount) then setAccountData (playeraccount, "name", new) end end ) Link to comment
The moVer Posted May 10, 2015 Author Share Posted May 10, 2015 شوف ياخي انا عندي كود الكود يطلع حساب الي لفله اكثر لفل انا ما ابي لحساب ابي الاسم Link to comment
Simple. Posted May 10, 2015 Share Posted May 10, 2015 شوف ياخي انا عندي كود الكود يطلع حساب الي لفله اكثر لفل انا ما ابي لحساب ابي الاسم getAccountPlayer Link to comment
TAPL Posted May 10, 2015 Share Posted May 10, 2015 addEventHandler("onPlayerWasted", root, function(_, killer) if killer and getElementType(killer) == "player" and killer ~= source then local checkGuest = getPlayerAccount(killer) if not isGuestAccount(checkGuest) then local Tkill = tonumber(getAccountData(checkGuest, "kills") or 0) if (Tkill+1 >= 1) then setAccountData(checkGuest, "kills", 0) setAccountData(checkGuest, "Level", (getAccountData(checkGuest, "Level") or 0) + 1) local TopTable = {} for i, account in ipairs(getAccounts()) do table.insert(TopTable, {account, (getAccountData(account, "Level") or 0)}) end table.sort(TopTable, function(a, b) return a[2] > b[2] end) outputChatBox("Player Name: "..(getAccountData(TopTable[1][1], "name") or "N/A").." | Level: "..TopTable[1][2], killer, 255, 255, 255) else setAccountData(checkGuest, "kills", Tkill+1) end end end end) addEventHandler("onPlayerLogin", root, function(_, account) setAccountData(account, "name", getPlayerName(source)) end) addEventHandler("onPlayerChangeNick", root, function(_, new) local account = getPlayerAccount(source) if not isGuestAccount(account) then setAccountData(account, "name", new) end end) Link to comment
The moVer Posted May 10, 2015 Author Share Posted May 10, 2015 طيب اخر شي كيف اعطيه فلوس لانو يفلي انه مو المنت ؟؟ وجزاكم الله خير جميعا Link to comment
TAPL Posted May 10, 2015 Share Posted May 10, 2015 طيب اخر شي كيف اعطيه فلوس لانو يفلي انه مو المنت ؟؟وجزاكم الله خير جميعا شوف ياخي انا عندي كود الكود يطلع حساب الي لفله اكثر لفل انا ما ابي لحساب ابي الاسم getAccountPlayer Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now