z24d Posted September 9, 2015 Posted September 9, 2015 السلام عليكم function adminchat ( thePlayer, _, ... ) addCommandHandler ( "AdminChat", adminchat ) bindKey( player,"O", "down", "chatbox", "AdminChat") الفنكش مو كامل ليش مايزبط
z24d Posted September 9, 2015 Author Posted September 9, 2015 الفنكش شغال كل شيء بس انا قاصه هنا ... ابي اعرف ليش مازبط
z24d Posted September 9, 2015 Author Posted September 9, 2015 function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then outputChatBox ( "#FF0000(ADMIN)#FFFF00 ".. getPlayerName ( thePlayer ) .." : #838b83".. message, player, 255, 255, 255, true ) end end else outputChatBox ( "#FF0000 You Must be Admin.", thePlayer, 255, 255, 255, true ) end end addCommandHandler ( "AdminChat", adminchat ) bindKey( "o", "down", "chatbox", adminchat) كذآ يصير ؟
</Mr.Tn6eL> Posted September 9, 2015 Posted September 9, 2015 طيب عطني الاشياء الي لازم اسويها عشان تخلي الزر لجميع الاعبين "onResourceStart" "onPlayerJoin" getElementsByType bindKey
z24d Posted September 9, 2015 Author Posted September 9, 2015 addEventHandler( "onPlayerLogin", root function () if getElementsByType( "player" ,root ) then bindKey ( player, "o", "down", "chatbox", "AdminChat") end end )
iMr.SFA7 Posted September 9, 2015 Posted September 9, 2015 ?root أبي أفهم ليه حاط وحاط اللوب تحقق؟ -.- وأنت مسوي حدث لما أي لاعب يسجل دخوله لوب للاعبين؟
iMr.SFA7 Posted September 9, 2015 Posted September 9, 2015 -- # Server Side : addEventHandler( "onPlayerJoin", root, function ( ) bindKey ( source, "o", "down", "chatbox", "AdminChat") end ) addEventHandler ("onResourceStart",resourceRoot, function ( ) for _,lol in ipairs (getElementsByType ("player")) do bindKey ( lol, "o", "down", "chatbox", "AdminChat") end end )
</Mr.Tn6eL> Posted September 9, 2015 Posted September 9, 2015 ?root أبي أفهم ليه حاطوحاط اللوب تحقق؟ -.- وأنت مسوي حدث لما أي لاعب يسجل دخوله لوب للاعبين؟ getElementsByType مو لوب اللوب هو for ... do و while ... do والخ... + حطيت root او ماحطيت ماراح يفرق شي table getElementsByType ( string theType, [ element startat=getRootElement() ] ) ياصاحب الموضوع addEventHandler( "onPlayerLogin", root function () if getElementsByType( "player" ,root ) then bindKey ( player, "o", "down", "chatbox", "AdminChat") end end ) الحين انا قلت لك استخدم onPlayerLogin يصير كذا addEventHandler("onPlayerJoin", root, function( ) bindKey(source, "o", "down", "chatbox", "AdminChat") end)
iMr.SFA7 Posted September 9, 2015 Posted September 9, 2015 getElementsByType مو لوب اللوب هو for ... do و while ... do والخ... + حطيت root او ماحطيت ماراح يفرق شي table getElementsByType ( string theType, [ element startat=getRootElement() ] ) ?root ع آي أساس يحطها دامها بدونها تلقائياً بتصير root الأرقمنت الأخير من الوظيفة حآط -_-" وهو قصده بـهالوظيفة لوب للاعبين بس حاطها تحقق
MR.GRAND Posted September 9, 2015 Posted September 9, 2015 getElementsByType مو لوب اللوب هو for ... do و while ... do والخ... + حطيت root او ماحطيت ماراح يفرق شي table getElementsByType ( string theType, [ element startat=getRootElement() ] ) ?root ع آي أساس يحطها دامها بدونها تلقائياً بتصير root الأرقمنت الأخير من الوظيفة حآط -_-" وهو قصده بـهالوظيفة لوب للاعبين بس حاطها تحقق ^ + 1 هو مسوي تحقق ان لو القيمة "player" تساوي root يكتمل الشرط طبعا استنادا للكود حقه ! اما الصحيح ... القيمة توضع بعدد الارقمنت الخاص بتحقق الاعبين
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