SaedAmer Posted July 9, 2016 Share Posted July 9, 2016 السلام عليكم ورحمة الله وبركاته. الطلب الاول يحفظ التيم لو الاعب خرج و دخل يعني يحفظ انت الاب ده في التيم ده الطلب التاني يجيب الدولة في السكور بورد Link to comment
Adham Posted July 9, 2016 Share Posted July 9, 2016 حفظ التيم : #Server addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()),function() executeSQLQuery("CREATE TABLE IF NOT EXISTS Teams (Team,Account)") end) function setTeam() local account = getAccountName(getPlayerAccount(source)) local RowAccount = executeSQLQuery("SELECT * FROM Teams WHERE Account = '"..account.."'") if not ( #RowAccount == 0 ) then local RowTeam = RowAccount[1]["Team"] if getTeamFromName(RowTeam) then setPlayerTeam(source, getTeamFromName(RowTeam)) end end end addEventHandler("onPlayerLogin",getRootElement(),setTeam) function saveTeam() local team = getPlayerTeam(source) local account = getPlayerAccount(source) if (team) and not isGuestAccount(account) then local AccountName = getAccountName(account) local TeamName = getTeamName(team) local RowAccount = executeSQLQuery("SELECT * FROM Teams WHERE Account = '"..AccountName.."'") if not ( #RowAccount == 0 ) then executeSQLQuery("UPDATE Teams SET Team=? WHERE Account=?",TeamName,AccountName) else executeSQLQuery("INSERT INTO Teams (Account,Team) VALUES(?,?)",AccountName,TeamName) end end end addEventHandler("onPlayerQuit",getRootElement(),saveTeam) Link to comment
Me[Z]oO Posted July 9, 2016 Share Posted July 9, 2016 حفظ التيم :#Server addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()),function() executeSQLQuery("CREATE TABLE IF NOT EXISTS Teams (Team,Account)") end) function setTeam() local account = getAccountName(getPlayerAccount(source)) local RowAccount = executeSQLQuery("SELECT * FROM Teams WHERE Account = '"..account.."'") if not ( #RowAccount == 0 ) then local RowTeam = RowAccount[1]["Team"] if getTeamFromName(RowTeam) then setPlayerTeam(source, getTeamFromName(RowTeam)) end end end addEventHandler("onPlayerLogin",getRootElement(),setTeam) function saveTeam() local team = getPlayerTeam(source) local account = getPlayerAccount(source) if (team) and not isGuestAccount(account) then local AccountName = getAccountName(account) local TeamName = getTeamName(team) local RowAccount = executeSQLQuery("SELECT * FROM Teams WHERE Account = '"..AccountName.."'") if not ( #RowAccount == 0 ) then executeSQLQuery("UPDATE Teams SET Team=? WHERE Account=?",TeamName,AccountName) else executeSQLQuery("INSERT INTO Teams (Account,Team) VALUES(?,?)",AccountName,TeamName) end end end addEventHandler("onPlayerQuit",getRootElement(),saveTeam) مبدع ^ انت مسويه ؟ Link to comment
' A F . Posted July 9, 2016 Share Posted July 9, 2016 @Mr,[L]e3bA اذا انت بتحفظه ع الحساب ليه تستخدم executeSQLQuery احفظه ع الاكاونت داتا Link to comment
Adham Posted July 9, 2016 Share Posted July 9, 2016 ميزو من قال اني مسويه؟؟ الاخ سفاح معطيه لي في موضوع Link to comment
SaedAmer Posted July 10, 2016 Author Share Posted July 10, 2016 عاوز لو الاعب قعد 30 ثاية ما يتحرك تظهر فوقه صورة Link to comment
[KilleR] Posted July 10, 2016 Share Posted July 10, 2016 الصوره : dxDrawImageOnElement Link to comment
Anis Posted July 10, 2016 Share Posted July 10, 2016 (edited) الصوره :dxDrawImageOnElement + getPlayerIdleTimeServer Edited July 10, 2016 by Guest Link to comment
' A F . Posted July 10, 2016 Share Posted July 10, 2016 الصوره :dxDrawImageOnElement + setTimer X getPlayerIdleTime Link to comment
SaedAmer Posted July 10, 2016 Author Share Posted July 10, 2016 الصوره :dxDrawImageOnElement + setTimer X getPlayerIdleTime كده ؟ function checkAFKPlayers() for index, thePlayer in ipairs(getElementsByType("player"))do if (getPlayerIdleTime(thePlayer) > 300000) then AFK = dxDrawImageOnElement("afk.png") end end end setTimer(checkAFKPlayers, 30000, 0) Link to comment
#Soking Posted July 10, 2016 Share Posted July 10, 2016 AFK = dxDrawImageOnElement("afk.png") ناقص ارقمنتات + ناقص كود اليوزفل فنكشن مب موجود + ليه انت مسويه كمتغير باسم AFK ? Link to comment
' A F . Posted July 10, 2016 Share Posted July 10, 2016 @SaedAmer getPlayerIdleTime = server side dxDrawImageOnElement = client side استخدم الداتا واستقبل الداتا بجانب الكلنت Link to comment
Me[Z]oO Posted July 10, 2016 Share Posted July 10, 2016 getPlayerIdleTime Server Side dxDrawImageOnElement Client Side Link to comment
#Soking Posted July 10, 2016 Share Posted July 10, 2016 getPlayerIdleTime Server Side dxDrawImageOnElement Client Side +1 في الحاله دي استخدمم -- Server Side setTimer setElementData getPlayerIdleTime -- Client Side getElementData Link to comment
SaedAmer Posted July 10, 2016 Author Share Posted July 10, 2016 اوك طيب هنا المفرود يكنسل كلمة الاعب و يطلع الكلام في الشات ما يحصل كده ahanh = {"ورع" } sap = {"" } klt = {"" } kzfahl = {"" } addEventHandler("onPlayerChat", getRootElement(), function(msg) for k,v in ipairs (ahanh) do if string.find(msg,v) then cancelEvent() pName = getPlayerName(source) outputChatBox("#FF0000*[ نظام المخالفات ]x @ "..pName.." #FF0000, لقد اهان احد من اعضاء السيرفر ",getRootElement(),255,0,0,true) outputChatBox("#FF0000*[ نظام المخالفات ]x#FF0000 لقد حصلت علي مخالفة بسبب أهانت احد من اعضاء السيرفر ",source,255,0,0,true) end end end ) Link to comment
N3xT Posted July 10, 2016 Share Posted July 10, 2016 ahanh = {"ورع"} addEventHandler("onPlayerChat", getRootElement(), function(msg) for k,v in ipairs (ahanh) do if string.find(msg,v) then return cancelEvent() outputChatBox("#FF0000*[ نظام المخالفات ]x @ "..getPlayerName(source).." #FF0000, لقد اهان احد من اعضاء السيرفر ",root,255,0,0,true) outputChatBox("#FF0000*[ نظام المخالفات ]x#FF0000 لقد حصلت علي مخالفة بسبب أهانت احد من اعضاء السيرفر ",source,255,0,0,true) end end end ) Link to comment
SaedAmer Posted July 10, 2016 Author Share Posted July 10, 2016 ahanh = {"ورع"} addEventHandler("onPlayerChat", getRootElement(), function(msg) for k,v in ipairs (ahanh) do if string.find(msg,v) then return cancelEvent() outputChatBox("#FF0000*[ نظام المخالفات ]x @ "..getPlayerName(source).." #FF0000, لقد اهان احد من اعضاء السيرفر ",root,255,0,0,true) outputChatBox("#FF0000*[ نظام المخالفات ]x#FF0000 لقد حصلت علي مخالفة بسبب أهانت احد من اعضاء السيرفر ",source,255,0,0,true) end end end ) اخ نكست بس انا هسوي اكتر من 10 كلامات Link to comment
#Soking Posted July 10, 2016 Share Posted July 10, 2016 ahanh = {"ورع","Test","Test"} Link to comment
SaedAmer Posted July 11, 2016 Author Share Posted July 11, 2016 ahanh = {"ورع"} addEventHandler("onPlayerChat", getRootElement(), function(msg) for k,v in ipairs (ahanh) do if string.find(msg,v) then return cancelEvent() outputChatBox("#FF0000*[ نظام المخالفات ]x @ "..getPlayerName(source).." #FF0000, لقد اهان احد من اعضاء السيرفر ",root,255,0,0,true) outputChatBox("#FF0000*[ نظام المخالفات ]x#FF0000 لقد حصلت علي مخالفة بسبب أهانت احد من اعضاء السيرفر ",source,255,0,0,true) end end end ) Link to comment
AboShanab Posted July 11, 2016 Share Posted July 11, 2016 @ SaedAmer : قم بحذف return من الكود Link to comment
SaedAmer Posted July 11, 2016 Author Share Posted July 11, 2016 @ SaedAmer : قم بحذف return من الكود [url=http://store1.up]http://store1.up[/url]-00.com/2016-07/1468216600561.jpg Link to comment
Me[Z]oO Posted July 11, 2016 Share Posted July 11, 2016 ahanh = {"ورع"} addEventHandler("onPlayerChat", getRootElement(), function(msg) for k,v in pairs (ahanh) do if string.find(msg,v) then outputChatBox("#FF0000*[ نظام المخالفات ]x @ "..getPlayerName(source).." #FF0000, لقد اهان احد من اعضاء السيرفر ",root,255,0,0,true) outputChatBox("#FF0000*[ نظام المخالفات ]x#FF0000 لقد حصلت علي مخالفة بسبب أهانت احد من اعضاء السيرفر ",source,255,0,0,true) return cancelEvent() end end end ) Link to comment
SaedAmer Posted July 11, 2016 Author Share Posted July 11, 2016 ahanh = {"ورع"} addEventHandler("onPlayerChat", getRootElement(), function(msg) for k,v in pairs (ahanh) do if string.find(msg,v) then outputChatBox("#FF0000*[ نظام المخالفات ]x @ "..getPlayerName(source).." #FF0000, لقد اهان احد من اعضاء السيرفر ",root,255,0,0,true) outputChatBox("#FF0000*[ نظام المخالفات ]x#FF0000 لقد حصلت علي مخالفة بسبب أهانت احد من اعضاء السيرفر ",source,255,0,0,true) return cancelEvent() end end end ) نفس المشكلة Link to comment
MR.GRAND Posted July 11, 2016 Share Posted July 11, 2016 badWordsTable = { { 'ورع' }, { 'Word' } } addEventHandler( 'onPlayerChat', root, function( message ) for _, Word in pairs ( badWordsTable ) do if ( string.find( message, Word[1] ) ) then cancelEvent( ) outputChatBox( '#FF0000*[ نظام المخالفات ]x @ ' .. getPlayerName( source ) .. ' #FF0000, لقد اهان احد من اعضاء السيرفر ', root, 255, 0, 0, true ) outputChatBox( '#FF0000*[ نظام المخالفات ]x#FF0000 لقد حصلت علي مخالفة بسبب أهانت احد من اعضاء السيرفر ', source, 255, 0, 0, true ) else return end end end ) Link to comment
SaedAmer Posted July 11, 2016 Author Share Posted July 11, 2016 badWordsTable = { { 'ورع' }, { 'Word' } } addEventHandler( 'onPlayerChat', root, function( message ) for _, Word in pairs ( badWordsTable ) do if ( string.find( message, Word[1] ) ) then cancelEvent( ) outputChatBox( '#FF0000*[ نظام المخالفات ]x @ ' .. getPlayerName( source ) .. ' #FF0000, لقد اهان احد من اعضاء السيرفر ', root, 255, 0, 0, true ) outputChatBox( '#FF0000*[ نظام المخالفات ]x#FF0000 لقد حصلت علي مخالفة بسبب أهانت احد من اعضاء السيرفر ', source, 255, 0, 0, true ) else return end end end ) تمام بس الكلمة تظهر عاوزها ما تظهر 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