-
Posts
347 -
Joined
-
Last visited
Everything posted by YourMind
-
انا بساعدك مش خدام عندك انا فاتح اللعبة و بجرب اللي انت مش عارف تعمله عشانك و عشان ردك دة شوفلك حد يساعدك غيري
-
خليه يشوف شغله و لو في خطأ نصلحه هو مش مبتدأ في البرمجة
-
استخدم لوب for i,ww in ipairs (aclGetGroupsName()) do الفنكشن دة يرجع لك اسماء الجروبات الموجودة في الاسل
-
والله براحتك اللي انت عايزه قدامك نفس الاكواد من رد اوسكار بموضوعي ض2 طلاما جابر سمح لك بأنك تاخد شغله عادي
-
لو مش عايز تجيب اسامي الجروبات في الاسل من غير لوب في الجريد ليست و تسميهم مع نفسك rows تقدر تصنع بس استخدم احسن -- by me function aclGetGroupsName() local wifi = { } for i , g in ipairs (aclGroupList()) do local theName = aclGroupGetName (g) table.insert (wifi,theName) end return wifi end و لطلبك التاني استخدم 'onClientGUIClick' guiGridListGetSelectedItem guiGridListGetItemText getPlayerFromName guiSetText
-
في موضوع جابر جهزتله اللوحة و جربتها بس اوسكار حط تجربته و سبقني --client chats = "" gg = "" local sx, sy = guiGetScreenSize() function centerTheGUI( guiElement ) local width, height = guiGetSize( guiElement, false ) local x, y = sx / 2 - width / 2, sy / 2 - height / 2 guiSetPosition( guiElement, x, y, false ) end GUIEditor = { checkbox = {}, progressbar = {}, edit = {}, button = {}, label = {}, memo = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() supportsystem = guiCreateWindow(55, 43, 693, 459, "[GTA-iV]-Support System", false) centerTheGUI( supportsystem ) guiWindowSetSizable(supportsystem, false) guiSetAlpha(supportsystem, 1.00) guiSetVisible(supportsystem,false) supportchat = guiCreateGridList(10, 41, 479, 317, false, supportsystem) guiSetFont(supportchat, "default-bold-small") guiGridListAddColumn(supportchat, "Player", 2.5) -- guiGridListAddColumn(supportchat, "Message", 0.5) progressbar1 = guiCreateProgressBar(499, 22, 15, 427, false, supportsystem) GUIEditor.label[1] = guiCreateLabel(20, 22, 213, 15, "Support Chat :", false, supportsystem) guiSetFont(GUIEditor.label[1], "default-bold-small") supportonline = guiCreateGridList(519, 58, 168, 344, false, supportsystem) guiSetFont(supportonline, "default-bold-small") guiGridListAddColumn(supportonline, "PlayerName", 1.9) GUIEditor.label[2] = guiCreateLabel(522, 31, 99, 20, "Support Online :", false, supportsystem) guiSetFont(GUIEditor.label[2], "default-bold-small") checkbox1 = guiCreateCheckBox(394, 368, 90, 18, "Show in chat", false, false, supportsystem) guiSetFont(checkbox1, "default-bold-small") edit1 = guiCreateEdit(9, 399, 380, 36, "", false, supportsystem) button1 = guiCreateButton(394, 401, 90, 34, "Send", false, supportsystem) guiSetFont(button1, "default-bold-small") button2 = guiCreateButton(557, 415, 90, 34, "القوانين", false, supportsystem) guiSetFont(button2, "default-bold-small") ruless = guiCreateWindow(183, 45, 453, 461, "قوانين السبورت|Support Rules", false) centerTheGUI( ruless ) guiWindowSetSizable(ruless, false) guiSetAlpha(ruless, 1.00) guiSetVisible(ruless,false) GUIEditor.memo[1] = guiCreateMemo(10, 23, 433, 379, "English : \n\n1-dont ask Admin\n\n2-dont ask Money\n\n3-dont bad talk\n\n\"This Chat For Help\"\n\n---------------------------------------\n\n: العربية\n\n\nعدم طلب ادمن-1\n\nعدم طلب فلوس-2\n\nعدم السب-3\n\n\n\"هذا الشات للمساعدة فقط\"", false, ruless) closeb = guiCreateButton(150, 412, 118, 38, "Close", false, ruless) guiSetFont(closeb, "default-bold-small") end ) addEventHandler("onClientGUIClick",root, function() if (source == button2) then guiSetVisible(ruless, true ) showCursor(true) guiSetInputEnabled( true ) guiBringToFront (ruless) end end ) addEvent ("RemoveNSupport",true) addEventHandler ("RemoveNSupport",root, function (plr) guiGridListRemoveRow (supportonline,getPlayerName(plr)) end ) addEventHandler("onClientGUIClick",root, function() if (source == closeb) then guiSetVisible(ruless,false) showCursor(true) guiSetInputEnabled (true) end end ) bindKey("F5","down", function() guiSetVisible(supportsystem, not guiGetVisible(supportsystem) ) showCursor( guiGetVisible(supportsystem) ) guiSetInputEnabled( guiGetVisible(ruless) ) end ) addEvent("online",true) addEventHandler("online",root, function(name,plr) guiGridListClear (supportonline) local g = guiGridListAddRow (supportonline) guiGridListSetItemText (supportonline,g,1,""..name.."",false, false ) guiGridListSetItemColor (supportonline,g,1,5,255,5) end ) addEventHandler("onClientGUIClick",root, function() chats = guiGetText(edit1) gg = guiGridListAddRow (supportchat) if source == button1 then triggerServerEvent("support",localPlayer) end end ) addEvent("sendmessage",true) addEventHandler("sendmessage",root, function(plr) guiGridListSetItemText (supportchat ,gg, 1,"[support] "..getPlayerName(localPlayer).." : "..chats.."",false, false ) -- guiGridListSetItemText (supportchat ,gg, 2,""..chats.."", false, false ) guiGridListSetItemColor (supportchat,gg,1,5,255,5) guiGridListSetItemColor (supportchat,gg,2,5,255,5) if ( guiCheckBoxGetSelected( checkbox1 ) == true ) then outputChatBox("[support-System] "..getPlayerName(plr).." : "..chats.."",5,255,5) end end ) addEvent("sendmessage2",true) addEventHandler("sendmessage2",root, function(plr) guiGridListSetItemText (supportchat ,gg, 1,"[Player] "..getPlayerName(localPlayer).." : "..chats.."",false, false ) -- guiGridListSetItemText (supportchat ,gg, 2,""..chats.."",false, false ) guiGridListSetItemColor (supportchat,gg,1,255,170,0) if ( guiCheckBoxGetSelected( checkbox1 ) == true ) then outputChatBox("[support-System] "..getPlayerName(plr).." : "..chats.."",255,170,0) end end ) -- server function getSupportPlayers() for i , k in ipairs (getElementsByType("player")) do if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount(k)),aclGetGroup ("Support") ) then return k , true else return false end end end function getNSupportPlayers () for i , k in ipairs (getElementsByType ("player")) do if not isObjectInACLGroup ("user."..getAccountName (getPlayerAccount(k)),aclGetGroup ("Support") ) then return k , true else return false end end end setTimer(function () if getSupportPlayers() then local supportPlayerName = getPlayerName (getSupportPlayers()) local supportPlayer = getPlayerFromName (supportPlayerName) triggerClientEvent(root,"online",root,supportPlayerName,supportPlayer,v) else return triggerClientEvent (root,"RemoveNSupport",root,getNSupportPlayers()) end end,1000,0) addEvent("support",true) addEventHandler("support",root, function() if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount(source)), aclGetGroup ( "Support" )) then triggerClientEvent("sendmessage",root,source) else triggerClientEvent("sendmessage2",root,source) end end )
-
ممكن تطرح ملف الكلينت عشان اجرب ؟
-
else يعني آخر او حاجة أُخري ifيعني لو حاجة مخالفة ال if او بأختصار هي تستخدم في حالة نفي الـ عشان من غيرها ماتعتبرش حاجة if لازم تكون مع addEvent ("dd",true) addEventHandler ("dd",root, function () if getElementHealth (source) < getPedMaxHealth(source) then -- لو دم الاعب اصغر من دمه الكامل setElementHealth (source, getElementHealth (source) + 20) -- نعمله حاجة else -- لو دم الاعب مش اصغر من دمه الكامل --يعني -- if getElementHealth (source) > getPedMaxHealth(source) then -- او -- if getElementHealth (source) >= getPedMaxHealth(source) then outputChatBox ("لا يمكنك اخذ المزيد من الصحة",source,255,5,5) end end )
-
لأ مش لازم ضيفه في مودك جهة السيرفر الموضوع مش مستاهل يعني 6 صفح
-
خليه زي ماهو انا بقول لازم تضيفه مش تشيله وصلنا 6 صفحات
-
دة يوسفل فنكشن لازم تضيفه مش موجود في الويكي و مش اساسي
-
--server function getPedMaxHealth(ped) assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") local stat = getPedStat(ped, 24) local maxhealth = 100 + (stat - 569) / 4.31 return math.max(1, maxhealth) end addEvent ("dd",true) addEventHandler ("dd",root, function () if getElementHealth (source) < getPedMaxHealth(source) then setElementHealth (source, getElementHealth (source) + 20) else return outputChatBox ("لا يمكنك اخذ المزيد من الصحة",source,255,5,5) end end )
-
معناها *لو if معناها ثم* then if دي تعتبر تحقق من اي شئ if تكون مع then و لازم getPedMaxHealth الوظيفة دي ترجعلك دم الاعب الكامل مش دمه العادي اي شخص لما يدخل السيرفر دمه الكامل يكون من 100 صح ؟ ممكن تغيير دمه الكامل تخليه اعلي من 100 عن طريق الخصائص في لوحة الادمن دة الدم الكامل فهمته ؟ getPedMaxHealth هي الوظيفة دي مفيدة في كدة احسن من انك تعمل if getElementHealth (source) <= 100 then لو دم الاعب اصغر من او يساوي 100 و دة العدد الطبييعي لما تيجي تتحقق بأن دمه كامل ولا لأ بس في الاحسن if getElementHealth (source) < getPedMaxHealth(source) then و في كودك اللي انت طرحته كلينت سطر 25 اعمل تحقق بأنه لاعب و ان الاعب دة هو الاعب المحلي كلينت سطر 37 و 38 و 39 امسحهم سيرفر سطر 4 شوف الصح و اتعلم منه if getElementHealth (source) < getPedMaxHealth(source) then بعدين تحت السطر دة ضيف يديله دم 20 علي دمه زي ماقولتلك else و تحت سطر الدم ضيف و بس
-
صح اربط بس آخر سطرين ماتحطهمش بالترتيب كدة زي ماهما في اول كودك لما تيجي تكمل في السيرفر اعمل كدة if getElementHealth (source) < getPedMaxHealth(source) then -- your code else outputChatBox ("لا يمكنك اخذ المزيد من الصحة",source,255,5,5) و الباقي زي الاغلاق و كدة و التكلمة عليك عشان تتعلم
-
امسح اللي عملته getElementHealth (localPlayer)>= 100 outputChatBox ("لا يمكنك اخذ المزيد من الصحة"255,1,1) و بدلهم ب triggerServerEvent و كمل طريقك في السيرفر سايد
-
لازم الكود يكون في سيرفر سايد و ريح نفسك استخدمه في اول الكود function getPedMaxHealth(ped) assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") local stat = getPedStat(ped, 24) local maxhealth = 100 + (stat - 569) / 4.31 return math.max(1, maxhealth) end ولما تيجي تتحقق في اول بداية كودك if getElementHealth (source) < getPedMaxHealth(source) then
-
باين عليه حلو و متعوب عليه بالتوفيق ليكم
-
ايوة صح اربط -- getElementHealth لو دمك مثلاً 54 ماشي ؟ و في الحظة دي جيت عملت كدة مثلاً local health = getElementHealth (localPlayer) outputChatBox ("Your health : "..health.."%") > Your health : 54% يرجع لك دم الشئ اللي انت محدده getElementHealth يعني الفنكشن مش بيزود ولا ينقص انت فاهم غلط و لو مثلاً حبيت تغيير setElementHealth (localPlayer, getElementHealth (localPlayer) + 20 ) > getElementHealth (localPlayer) = 54 > setElementHealth (localPlayer, 54 + 20 ) > 54 + 20 = 74 كدة دمه بقي 74 خلاص شوفها رقم ماتشوفهاش كتابة و في الآخر getElementHealth عشان تجيب دم الشئ اللي عنده دم زي مثلاً لاعب او مركبة او.. او .. او setElementHealth دي تقدر تتحكم فيها بدم الشئ او اللي انت مختاره بحيث تخلي الدم اللي انت عايزه يارب تكون فهمت @1XxCr{o}sS لو سمحت خليني اتكلم
-
مفيش ازعاج ولا حاجة @1XxCr{o}sS الراجل عايز يفهم لازم فنكشن الدم يكون في جهة السيرفر عشان مايكونش وهمي لو في كلينت انت بس اللي هاتشوفه كامل او زايد و باقي الاعبين هايشوفوا دمك زي ما هو و لو مش عايز سحب فلوس و تحقق امسح اند واحدة في السيرفر getPlayerMoney و امسح التحقق takePlayerMoney و setElementHealth (localPlayer, getElementHealth (localPlayer) + 20) و كدة يضيف علي دمه 20 بس هايكون وهمي طبعاً عشان كلينت هابسطهالك ركز الفنكشن الطبيعي setElementHealth صح ؟ و لما تيجي تستخدمه المفروض يكون مثلاً setElementHealth (localPlayer,100) هنا يديله دم 100 طيب لو عايز يديله دم علي دمه ؟ شغل مخك دم علي دمه دم يعني رقم الدم اللي انت عايز تضيفهوله علي دمه علي يعني + دمه يعني ايجاد دمه طيب لما تيجي تطبق ؟ اول خطوة كدة setElementHealth (localPlayer,getElementHealth (localPlayer) ) كدة جبنا دمه العادي تاني خطوة setElementHealth (localPlayer,getElementHealth (localPlayer) + ) نضيف علي دمه العادي تالت خطوة setElementHealth (localPlayer,getElementHealth (localPlayer) + 20 ) نضيف 20 دم علي دمه و خلاص الباقي تحققات و كدة عشان يتأكد ان دمه العادي مش كامل فهمت حاجة ؟
-
مش من اول مرة هاتتعلم بالتوفيق --client Marker = createMarker (-2396.31543,-594.40619,133.64844,"cylinder",1,255,255,225,255) GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} } window1 = guiCreateWindow(551, 271, 197, 312, "مطعم", false) guiWindowSetSizable(window1, false) guiSetVisible ( window1, false) images = guiCreateStaticImage(10, 58, 34, 34, "images/8.png", false, window1) GUIEditor.label[1] = guiCreateLabel(48, 57, 102, 25, "..", false, window1) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 100, 53, 35) GUIEditor.label[2] = guiCreateLabel(46, 77, 104, 15, "+20Health", false, window1) guiSetFont(GUIEditor.label[2], "default-small") GUIEditor.button[1] = guiCreateButton(131, 58, 56, 34, "شراء", false, window1) GUIEditor.button[2] = guiCreateButton(9, 279, 178, 23, "أغلاق", false, window1) addEventHandler('onClientMarkerHit',Marker, function (ss) if getElementType (ss) == "player" and ss == localPlayer then guiSetVisible (window1,true) showCursor (true) guiSetInputEnabled (true) end end ) addEventHandler("onClientGUIClick", root, function () if ( source == GUIEditor.button[1] ) then triggerServerEvent ("Health20",localPlayer) elseif ( source == GUIEditor.button[2] ) then guiSetVisible(window1,false) showCursor(false) guiSetInputEnabled (false) end end ) --server function getPedMaxHealth(ped) assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") local stat = getPedStat(ped, 24) local maxhealth = 100 + (stat - 569) / 4.31 return math.max(1, maxhealth) end addEvent ("Health20",true) addEventHandler ("Health20",root, function () if getPlayerMoney (source) >= 200 then if getElementHealth (source) < getPedMaxHealth(source) then takePlayerMoney (source,200) setElementHealth (source, getElementHealth (source) + 20) else outputChatBox ("Your health is full.",source,255,5,5) end else outputChatBox ("You don't have enough money.",source,255,5,5) end end )
-
setElementHealth (playerparameter*, getElementHealth (playerparameter*) + 20 )
-
طيب جرب النيوز بتاعك Groups = { "Console", } function check ( thePlayer, commandName, ... ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) local veve = { ... } local Msg = table.concat ( veve, " " ) for i, v in ipairs ( Groups ) do if isObjectInACLGroup ( "user."..accName, aclGetGroup ( v ) ) then setElementData ( resourceRoot, "News", Msg ) SaveMsg ( ) triggerClientEvent ( "error", getRootElement( ), getElementData ( resourceRoot, "News" ) ) end end end addCommandHandler( "News", check ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery("CREATE TABLE IF NOT EXISTS TTT (mes, ss)") end ) addEvent ( "SetMsg", true ) addEventHandler ( "SetMsg", root, function ( ) getMsg ( ) end ) SaveMsg = function ( ) local msg = executeSQLQuery ( "SELECT * FROM TTT WHERE ss = '" .. getServerName ( ) .."'" ) if ( #msg ~= 0 ) then return executeSQLQuery("UPDATE TTT SET mes=? WHERE ss=? ", tostring ( getElementData ( resourceRoot, "News" ) ), getServerName ( ) ) else return executeSQLQuery("INSERT INTO TTT (mes,ss) VALUES(?,?)", tostring ( getElementData ( resourceRoot, "News" ) ), getServerName ( ) ) end end getMsg = function ( ) local mess = executeSQLQuery ( "SELECT * FROM TTT" ) if ( #mess ~= 0 ) then setElementData ( resourceRoot, "News", mess[1]["mes"] ) return setTimer ( triggerClientEvent, 1000, 1, "ss", getRootElement( ), getElementData ( resourceRoot, "News" ) ) else return setTimer ( triggerClientEvent, 1000, 1, "ss", getRootElement( ), " " ) end end الادمن مسج Groups = { "Console", } function check ( thePlayer, commandName, ... ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) local veve = { ... } local MESA = table.concat ( veve, " " ) for i, v in ipairs ( Groups ) do if isObjectInACLGroup ( "user."..accName, aclGetGroup ( v ) ) then setElementData ( resourceRoot, "ADMINMSG", MESA ) SaveMsg ( ) triggerClientEvent ( "sora", getRootElement( ), getElementData ( resourceRoot, "ADMINMSG" ) ) end end end addCommandHandler( "Admin", check ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery("CREATE TABLE IF NOT EXISTS DST (mes, name)") end ) addEvent ( "SetMsg", true ) addEventHandler ( "SetMsg", root, function ( ) getMsg ( ) end ) SaveMsg = function ( ) local msg = executeSQLQuery ( "SELECT * FROM DST WHERE name = '" .. getServerName ( ) .."'" ) if ( #msg ~= 0 ) then return executeSQLQuery("UPDATE DST SET THEMESS=? WHERE name=? ", tostring ( getElementData ( resourceRoot, "ADMINMSG" ) ), getServerName ( ) ) else return executeSQLQuery("INSERT INTO DST (THEMESS,name) VALUES(?,?)", tostring ( getElementData ( resourceRoot, "ADMINMSG" ) ), getServerName ( ) ) end end getMsg = function ( ) local mes = executeSQLQuery ( "SELECT * FROM DST" ) if ( #mes ~= 0 ) then setElementData ( resourceRoot, "ADMINMSG", mes[1]["THEMESS"] ) return setTimer ( triggerClientEvent, 1000, 1, "sora", getRootElement( ), getElementData ( resourceRoot, "ADMINMSG" ) ) else return setTimer ( triggerClientEvent, 1000, 1, "sora", getRootElement( ), " " ) end end