#DRAGON!FIRE Posted June 26, 2015 Share Posted June 26, 2015 ورني يوم تضيف اسم اللاعب للستة . Link to comment
3NAD Posted June 26, 2015 Share Posted June 26, 2015 يب تمامم 100% كود 2014 اشتغل شكرا ممكن سؤال اخر مثلا ابي يوم اللاعب يضغط زر سلاب يقتل الاعب وش هي الفنكشنات احسن من م افتح موضوع جديد Client Side addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == SlapButton ) then -- نحدد الزر if ( guiGridListGetSelectedItem ( GridList ) ~= -1 ) then -- نتحقق انه اختار شيء من اللسته local pSlap = guiGridListGetItemText ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ) -- نجلب القيمه وهي اسم الاعب في الكولمن الاول عشان يقتله if ( pSlap ~= "" ) then -- نتحقق انها مو سترنق triggerServerEvent ( "pkill", localPlayer, getPlayerFromName ( pSlap ) ) -- نرسل ترايقر مع المعلومات end else outputChatBox ( "الرجاء اختيار اسم لاعب", 255, 255, 255, true ) -- اذا ماختار لاعب وضغط الزر ينبهه end end end ) Server Side addEvent ( "pkill" , true ) addEventHandler ( "pkill", root, function ( pSlap ) if ( pSlap ) then -- نتحقق ان المعلومات موجوده الي ارسلناها مع الترايقر killPed ( source ) -- نقتل الاعب outputChatBox ( "تم قتلك من قبل الادمن", source, 255, 255, 255, true ) -- مخرج شات end end ) No comment Link to comment
M7MD# Posted June 26, 2015 Author Share Posted June 26, 2015 الكود خطأ السورس هو الاعب الي يضغط الزر ف يوم اضغط الزر حتى لو اني ضغطت على لاعب اخر انا الي انقتل هو الي ينقتل لكن ما نفع معي .. pSlap وحاولت اسوي ان addEvent ( "pkill" , true ) addEventHandler ( "pkill", root, function ( pSlap ) local name = getPlayerName(source) if ( pSlap ) then -- نتحقق ان المعلومات موجوده الي ارسلناها مع الترايقر killPed ( pSlap ) -- الخطا هنا السورس outputChatBox ( pSlap.. " Has Been slapped By "..name, getRootElement(),255, 51, 153, false ) -- الخطا هنا السورس end end ) Link to comment
#DRAGON!FIRE Posted June 26, 2015 Share Posted June 26, 2015 حبيبي قلت لك ورني يوم تضيف اللاعب للستة ! Link to comment
M7MD# Posted June 26, 2015 Author Share Posted June 26, 2015 addEvent ( "pkill" , true ) addEventHandler ( "pkill", root, function ( pSlap ) local name = getPlayerName(source) local theKilled = getPlayerFromName ( pSlap ) if ( pSlap ) then -- نتحقق ان المعلومات موجوده الي ارسلناها مع الترايقر killPed ( theKilled ) -- الخطا هنا السورس outputChatBox ( pSlap.. " Has Been slapped By "..name, getRootElement(),255, 0, 255, false ) -- الخطا هنا السورس end end ) يصير كذا خلاص شفيك عصبت ._. Link to comment
#DRAGON!FIRE Posted June 26, 2015 Share Posted June 26, 2015 لا اله الا الله .. ما علي من هذا الكود !! ورني يوم تضيف اللاعب للستة ! Link to comment
M7MD# Posted June 26, 2015 Author Share Posted June 26, 2015 function players() guiGridListClear(playerList) for d,theplayer in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(playerList) local name = getPlayerName(theplayer) guiGridListSetItemText(playerList, row, 1, name, false, false ) guiGridListSetItemColor(playerList, row, 1, 250, 250, 250, 255 ) end end addEventHandler("onClientResourceStart",resourceRoot,players) Link to comment
#DRAGON!FIRE Posted June 26, 2015 Share Posted June 26, 2015 طبعا لا تنسى استبدل اسم الزر . addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == element ) then if ( guiGridListGetSelectedItem ( playerList ) ~= -1 ) then local Player = guiGridListGetItemText ( playerList, guiGridListGetSelectedItem ( playerList ), 1 ) if ( getPlayerFromName ( Player ) ) then triggerServerEvent ( "slapPlayer", getPlayerFromName ( Player ) ) end end end end ) addEvent ( "slapPlayer", true ) addEventHandler ( "slapPlayer", root, function ( ) killPed ( source ) outputChatBox ( "تم قتلك من قبل الادمن", source, 255, 255, 255, true ) end ) Link to comment
M7MD# Posted June 26, 2015 Author Share Posted June 26, 2015 (edited) تمام مشكور لكن قلت من قبل ان الكود اشتغل , وكودك تمام اشتغل شكراً .. عندي طلب ثاني اسف شباب مثلن بدي اسوي سحب سيارة سويت الكود لكن ما اشتغل ممكن تصحيح ؟ كلنت elseif source == destroy then if ( guiGridListGetSelectedItem ( playerList ) ~= -1 ) then local vd= guiGridListGetItemText ( playerList, guiGridListGetSelectedItem ( playerList ), 1 ) triggerServerEvent ( "VDestroy", localPlayer, vd ) end سيرفر addEvent( "VDestroy", true) ----destroy car addEventHandler( "VDestroy", getRootElement(), function ( PlayerNick ) local d = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) local theVehicle = getPedOccupiedVehicle ( d ) if ( isElement(theVehicle) ) then destroyElement ( theVehicle ) outputChatBox("#ff0000".. d .." Vehicle has Been destroyed", source, 255, 0, 0, true ) end end ) وين المُشكلة اعرف انه خطا لكن حاولت بنفسي وشكرن مقدمن Edited June 26, 2015 by Guest Link to comment
M7MD# Posted June 26, 2015 Author Share Posted June 26, 2015 تمام مشكور لكن قلت من قبل ان الكود اشتغل , وكودك تمام اشتغل شكراً .. عندي طلب ثاني اسف شباب مثلن بدي اسوي سحب سيارة سويت الكود لكن ما اشتغل ممكن تصحيح ؟ كلنت elseif source == destroy then if ( guiGridListGetSelectedItem ( playerList ) ~= -1 ) then local pd= guiGridListGetItemText ( playerList, guiGridListGetSelectedItem ( playerList ), 1 ) triggerServerEvent ( "VDestroy", localPlayer, vd ) end سيرفر addEvent( "VDestroy", true) ----destroy car addEventHandler( "VDestroy", getRootElement(), function ( PlayerNick ) local d = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) local theVehicle = getPedOccupiedVehicle ( d ) if ( isElement(theVehicle) ) then destroyElement ( theVehicle ) outputChatBox("#ff0000".. d .." Vehicle has Been destroyed", source, 255, 0, 0, true ) end end ) وين المُشكلة اعرف انه خطا لكن حاولت بنفسي وشكرن مقدمن Link to comment
Mr.R Posted June 26, 2015 Share Posted June 26, 2015 عموما صلحت الكود حقي كان الخطا زي ماقال الزاحف في السورس وجربتها في سيرفر مجاني طلعت شغاله تمام , مشكور ع المعلومه يالزاحف , انصحك ياصاحب الموضوع تسوي تحديث للقريد ليست من نفسه كل دقيقه مثلا او زر تحديث عشان الزوار الي يدخلون ماتطلع اساميهم بالقريد ليست الا اذا سويت للمود ريستارت او طلعت ودخلت هذي الفايدهـ Link to comment
Simple. Posted June 26, 2015 Share Posted June 26, 2015 يستخدم onPlayerJoin onPlayerQuit onPlayerChangeNick Link to comment
TAPL Posted June 26, 2015 Share Posted June 26, 2015 يستخدم onPlayerJoin onPlayerQuit onPlayerChangeNick on[color=#FF0000]Client[/color]PlayerJoin on[color=#FF0000]Client[/color]PlayerQuit on[color=#FF0000]Client[/color]PlayerChangeNick 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