nxFairlywell Posted August 6, 2014 Share Posted August 6, 2014 السلآلآم عليكم ورحمة الله وبركاته Useful function رحلة العناء يحطون كود ومايشرحونه : ( ,, ابيكم تساعدوني في الكود هذا ., بس بعرف وين الخطأ function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end addEventHandler("onClientGUIClick", root, function (player, team) if ( source == Button ) then if isPlayerInTeam(player, "MyTeam") then setElementPosition guiSetVisible( showCursor else outputChatBox end end end ) Wiki -- isPlayerInTeam Link to comment
shwaeki Posted August 6, 2014 Share Posted August 6, 2014 addEventHandler("onClientGUIClick", root, function (player, team) if ( source == Button ) then if isPlayerInTeam(player, "MyTeam") then setElementPosition guiSetVisible( showCursor else outputChatBox end end end ) showCursor +guiSetVisible( + outputChatBox -- مش مكمل الوظيفة function (player, team) -- مالهم داعي if isPlayerInTeam(player, "MyTeam") then player = غير معرف يغني هاد كله غلط Link to comment
nxFairlywell Posted August 6, 2014 Author Share Posted August 6, 2014 حبيبي شوايكي ذذ انا مو غبي لدرجة اني ما اكمل الفنكشنات زي outputChatBox انا بس كتبتها عشان تعرف وش الي داخل الوظيفة في الحقيقه انا اصلا حاطها في النوت باد وكامله بس يطلعلي في الديبوق Bad argument 1 @ isPlayerInTeam [player expected, got left] Link to comment
nxFairlywell Posted August 6, 2014 Author Share Posted August 6, 2014 لا خلاص ضبط ض1 سويت طريقتك حذفت player, team وعدلت outputChatBox لأني كان حاطه كذا outputChatBox("Welcome", getLocalPlayer(), 255,255,0,true) ^^ Link to comment
xFace[B]ook Posted August 6, 2014 Share Posted August 6, 2014 لا خلاص ضبط ض1سويت طريقتك حذفت player, team وعدلت outputChatBox لأني كان حاطه كذا outputChatBox("Welcome", getLocalPlayer(), 255,255,0,true) ^^ Link to comment
nxFairlywell Posted August 6, 2014 Author Share Posted August 6, 2014 مافهمت تقصد اني كتبته بالموضوع outputChatBox بدون اضافات Link to comment
AboShanab Posted August 6, 2014 Share Posted August 6, 2014 -- # Client Side ! function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end addEventHandler("onClientGUIClick", root, function ( ) if ( source == Button ) then if ( isPlayerInTeam ( localPlayer, "MyTeam" ) ) then -- # Your Code else -- # Your Code end end end ) Link to comment
ahmedfef Posted August 6, 2014 Share Posted August 6, 2014 السلآلآم عليكم ورحمة الله وبركاتهUseful function رحلة العناء يحطون كود ومايشرحونه : ( ,, ابيكم تساعدوني في الكود هذا ., بس بعرف وين الخطأ function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end addEventHandler("onClientGUIClick", root, function (player, team) if ( source == Button ) then if isPlayerInTeam(player, "MyTeam") then setElementPosition guiSetVisible( showCursor else outputChatBox end end end ) Wiki -- isPlayerInTeam على اي اساس addEventHandler("onClientGUIClick", root, function (player, team) Link to comment
nxFairlywell Posted August 6, 2014 Author Share Posted August 6, 2014 من جد , ياخي متقروش :lol: 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