Jump to content

YourMind

Members
  • Posts

    347
  • Joined

  • Last visited

Everything posted by YourMind

  1. -- client addEventHandler ("onClientGUIClick",clearButton, function () triggerServerEvent ("Cl",localPlayer,getPlayerName(localPlayer)) end ) addEvent ("CLEAR",true) addEventHandler ("CLEAR",root, function (name) guiGridListClear (gridName) rw = guiGridListAddRow (gridName) guiGridListSetItemText (gridName,rw,1,"**CLEARED BY "..name.."**",false,false) end -- server addEvent ("Cl",true) addEventHandler ("Cl",root, function (name) for i,k in ipairs (getElementsByType("player")) do triggerClientEvent (k,"CLEAR",k,name) end end )
  2. -- client addEventHandler ("onClientGUIClick",clearButton, function () triggerServerEvent ("Cl",localPlayer,getPlayerName(localPlayer)) end ) addEvent ("CLEAR",true) addEventHandler ("CLEAR",root, function (name) guiGridListClear (gridName) rw = guiGridListAddRow (gridName) guiGridListSetItemText (gridName,rw,1,"**CLEARED BY "..name.."**",false,false) end -- server addEvent ("Cl",true) addEventHandler ("Cl",root, function (name) for i,k in ipairs (getElementsByType("player")) do triggerClientEvent (k,"CLEAR",k,name) end end )
  3. guiGridListClear guiGridListAddRow getPlayerName guiGridListSetItemText
  4. guiGridListClear guiGridListAddRow getPlayerName guiGridListSetItemText
  5. YourMind

    سوال

    for k,v in ipairs ( places ) do local Row = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, Row, 1, v[1], false, false ) guiGridListSetItemData ( grid, Row, 1, { v[2], v[3], v[4] } ) guiGridListSetItemColor(grid,Row, 1, 255, 255, 0, 255,false,false) end
  6. YourMind

    سوال

    for k,v in ipairs ( places ) do local Row = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, Row, 1, v[1], false, false ) guiGridListSetItemData ( grid, Row, 1, { v[2], v[3], v[4] } ) guiGridListSetItemColor(grid,Row, 1, 255, 255, 0, 255,false,false) end
  7. -- Client GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow((screenW - 563) / 2, (screenH - 622) / 2, 563, 622, "لوحة استئجار السيارات", false) guiWindowSetMovable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "C80AB9D3") guiSetVisible(wnd,false) grid = guiCreateGridList(9, 21, 263, 591, false, wnd) guiGridListAddColumn(grid, "the car", 0.5) guiGridListAddColumn(grid, "the price", 0.5) photo = guiCreateStaticImage(275, 27, 278, 179, "11.png", false, wnd) buy = guiCreateButton(278, 225, 275, 51, "استئجار السيارة", false, wnd) guiSetFont(buy, "default-bold-small") guiSetProperty(buy, "NormalTextColour", "C80AB9D3") light = guiCreateButton(278, 330, 275, 51, "تشغيل - اطفاء ضوء السيارة", false, wnd) guiSetFont(light, "default-bold-small") guiSetProperty(light, "NormalTextColour", "C80AB9D3") lock = guiCreateButton(278, 430, 275, 51, "قفل - فتح السيارة", false, wnd) guiSetFont(lock, "default-bold-small") guiSetProperty(lock, "NormalTextColour", "C80AB9D3") close = guiCreateButton(488, 557, 65, 55, "✖", false, wnd) guiSetFont(close, "default-bold-small") guiSetProperty(close, "NormalTextColour", "C81DB8C1") GUIEditor.label[1] = guiCreateLabel(288, 576, 179, 15, "this mod made by :- 1XxCr[o]sS", false, wnd) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 29, 184, 193) bindKey("F9","down", function () guiSetVisible (wnd ,not guiGetVisible (wnd)) showCursor(guiGetVisible(wnd)) end ) addEventHandler("onClientGUIClick",root, function () if source == close then guiSetVisible(wnd,false) showCursor(false) end end ) -- name . id . price cars ={ {"Ferari",429,50000}, {"Nissan",411,50000}, } for k,v in ipairs(cars) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemText(grid,row,2,v[3],false,false) guiGridListSetItemData(grid,row,1,v[2]) end addEventHandler("onClientGUIClick",buy, function () local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local id = guiGridListGetItemData(grid,sel,1) local money = guiGridListGetItemText (grid,sel,2) triggerServerEvent("givecar",localPlayer,id,money) end end ,false) -- Server gv = {} addEvent("givecar",true) addEventHandler("givecar",root, function (id,money) if isElement (gv[source]) then destroyElement(gv[source]) end local hisMoney = getPlayerMoney (source) if hisMoney >= tonumber (money) then takePlayerMoney (source,tonumber(money)) local x, y, z = getElementPosition(source) gv[source] = createVehicle (id, x, y, z) warpPedIntoVehicle(source,gv[source]) end end )
  8. -- Client GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow((screenW - 563) / 2, (screenH - 622) / 2, 563, 622, "لوحة استئجار السيارات", false) guiWindowSetMovable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "C80AB9D3") guiSetVisible(wnd,false) grid = guiCreateGridList(9, 21, 263, 591, false, wnd) guiGridListAddColumn(grid, "the car", 0.5) guiGridListAddColumn(grid, "the price", 0.5) photo = guiCreateStaticImage(275, 27, 278, 179, "11.png", false, wnd) buy = guiCreateButton(278, 225, 275, 51, "استئجار السيارة", false, wnd) guiSetFont(buy, "default-bold-small") guiSetProperty(buy, "NormalTextColour", "C80AB9D3") light = guiCreateButton(278, 330, 275, 51, "تشغيل - اطفاء ضوء السيارة", false, wnd) guiSetFont(light, "default-bold-small") guiSetProperty(light, "NormalTextColour", "C80AB9D3") lock = guiCreateButton(278, 430, 275, 51, "قفل - فتح السيارة", false, wnd) guiSetFont(lock, "default-bold-small") guiSetProperty(lock, "NormalTextColour", "C80AB9D3") close = guiCreateButton(488, 557, 65, 55, "✖", false, wnd) guiSetFont(close, "default-bold-small") guiSetProperty(close, "NormalTextColour", "C81DB8C1") GUIEditor.label[1] = guiCreateLabel(288, 576, 179, 15, "this mod made by :- 1XxCr[o]sS", false, wnd) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 29, 184, 193) bindKey("F9","down", function () guiSetVisible (wnd ,not guiGetVisible (wnd)) showCursor(guiGetVisible(wnd)) end ) addEventHandler("onClientGUIClick",root, function () if source == close then guiSetVisible(wnd,false) showCursor(false) end end ) -- name . id . price cars ={ {"Ferari",429,50000}, {"Nissan",411,50000}, } for k,v in ipairs(cars) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemText(grid,row,2,v[3],false,false) guiGridListSetItemData(grid,row,1,v[2]) end addEventHandler("onClientGUIClick",buy, function () local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local id = guiGridListGetItemData(grid,sel,1) local money = guiGridListGetItemText (grid,sel,2) triggerServerEvent("givecar",localPlayer,id,money) end end ,false) -- Server gv = {} addEvent("givecar",true) addEventHandler("givecar",root, function (id,money) if isElement (gv[source]) then destroyElement(gv[source]) end local hisMoney = getPlayerMoney (source) if hisMoney >= tonumber (money) then takePlayerMoney (source,tonumber(money)) local x, y, z = getElementPosition(source) gv[source] = createVehicle (id, x, y, z) warpPedIntoVehicle(source,gv[source]) end end )
  9. مش عارف ليه صنعتلك المود كامل -- Client local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow((screenW - 465) / 2, (screenH - 561) / 2, 465, 561, "DTC12", false) guiWindowSetSizable(wnd, false) guiSetProperty(wnd, "CaptionColour", "FF00FBF9") guiSetVisible (wnd,false) grid = guiCreateGridList(9, 23, 178, 429, false, wnd) guiSetFont(grid, "default-bold-small") guiGridListAddColumn(grid, "#Players", 0.9) grid2 = guiCreateGridList(215, 23, 178, 429, false, wnd) guiSetFont(grid2, "default-bold-small") guiGridListAddColumn(grid2, "#Jail time", 0.9) k = guiCreateButton(400, 25, 55, 427, "Jail", false, wnd) guiSetFont(k, "default-bold-small") guiSetProperty(k, "NormalTextColour", "FFFB8302") dwe = guiCreateLabel(7, 447, 448, 15, "____________________________________________________________________", false, wnd) no = guiCreateButton(11, 470, 444, 27, "N-Jail", false, wnd) guiSetFont(no, "default-bold-small") guiSetProperty(no, "NormalTextColour", "FF00FC71") res = guiCreateEdit(177, 507, 113, 33, "", false, wnd) guiSetFont(res, "default-bold-small") rewr = guiCreateLabel(120, 517, 52, 15, "Reasson :", false, wnd) guiSetFont(rewr, "default-bold-small") bindKey ("F5","down", function () guiSetVisible(wnd,not guiGetVisible(wnd)) showCursor (guiGetVisible(wnd)) guiSetInputEnabled (guiGetVisible(wnd)) end ) function ref () guiGridListClear (grid) for i , v in ipairs (getElementsByType ("player")) do local row = guiGridListAddRow (grid) guiGridListSetItemText (grid,row,1,tostring(getPlayerName(v)),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,ref) addEventHandler ("onClientPlayerChangeNick",root,ref) addEventHandler ("onClientPlayerJoin",root,ref) addEventHandler ("onClientPlayerQuit",root,ref) tab = { {"1 Minute",60000}, {"2 Minutes",2*60000}, {"3 Minutes",3*60000}, {"5 Minutes",5*60000}, {"15 Minutes",15*60000}, {"30 Minutes",30*60000} } for i,k in ipairs (tab) do local rw = guiGridListAddRow (grid2) guiGridListSetItemText(grid2,rw,1,tostring(k[1]),false,false) guiGridListSetItemData (grid2,rw,1,tonumber(k[2])) end addEventHandler ("onClientGUIClick",k, function () local sel,sel2 = guiGridListGetSelectedItem (grid),guiGridListGetSelectedItem (grid2) if sel ~= -1 and sel2 ~= -1 then local plrName = guiGridListGetItemText (grid,sel,1) local plr = getPlayerFromName (plrName) local Time = guiGridListGetItemData (grid2,sel2,1) local ress = guiGetText (res) triggerServerEvent ("Pri",localPlayer,plr,plrName,Time,ress) end end ,false) addEventHandler ("onClientGUIClick",no, function () local sel,sel2 = guiGridListGetSelectedItem (grid) if sel ~= -1 then local plrName = guiGridListGetItemText (grid,sel,1) local plr = getPlayerFromName (plrName) local ress = guiGetText (res) triggerServerEvent ("NJail",localPlayer,plr,plrName,ress) end end,false) -- Server function JailPlayer(elem,x,y,z,int,Dim) -- من اوسكار setElementPosition(elem,x,y,z) setElementInterior (elem,int) setElementDimension (elem,Dim) end v = {} addEvent ("Pri",true) addEventHandler ("Pri",root, function (plr,name,time,ress) if isTimer (v[plr]) then return outputChatBox (""..name.." is already jailed.",source,255,5,5) end if isPedInVehicle (plr) then removePedFromVehicle (plr) end JailPlayer(plr,263,77,1001,6,600) outputChatBox (""..name.." is successfuly jailed.",source,5,255,5) outputChatBox ("You were imprisoned by "..getPlayerName(source).." - ("..ress..") ",plr,255,5,5) v[plr] = setTimer (function () setElementInterior (plr,0) setElementDimension (plr,0) setElementPosition (plr,1545.3995361328,-1675.6196289063,13.560287475586) outputChatBox ("You are free now.",plr,5,255,5) end,time,1) end) addEvent ("NJail",true) addEventHandler ("NJail",root, function (plr,name,ress) if isTimer (v[plr]) then setElementInterior (plr,0) setElementDimension (plr,0) setElementPosition (plr,1545.3995361328,-1675.6196289063,13.560287475586) outputChatBox (""..name.." is successfuly freed.",source,5,255,5) outputChatBox ("You were freed by "..getPlayerName(source).." - ("..ress..").",plr,5,255,5) else return outputChatBox (""..name.." is not jailed.",source,255,5,5) end killTimer (v[plr]) end ) بس مش خسارة فيك
  10. مش عارف ليه صنعتلك المود كامل -- Client local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow((screenW - 465) / 2, (screenH - 561) / 2, 465, 561, "DTC12", false) guiWindowSetSizable(wnd, false) guiSetProperty(wnd, "CaptionColour", "FF00FBF9") guiSetVisible (wnd,false) grid = guiCreateGridList(9, 23, 178, 429, false, wnd) guiSetFont(grid, "default-bold-small") guiGridListAddColumn(grid, "#Players", 0.9) grid2 = guiCreateGridList(215, 23, 178, 429, false, wnd) guiSetFont(grid2, "default-bold-small") guiGridListAddColumn(grid2, "#Jail time", 0.9) k = guiCreateButton(400, 25, 55, 427, "Jail", false, wnd) guiSetFont(k, "default-bold-small") guiSetProperty(k, "NormalTextColour", "FFFB8302") dwe = guiCreateLabel(7, 447, 448, 15, "____________________________________________________________________", false, wnd) no = guiCreateButton(11, 470, 444, 27, "N-Jail", false, wnd) guiSetFont(no, "default-bold-small") guiSetProperty(no, "NormalTextColour", "FF00FC71") res = guiCreateEdit(177, 507, 113, 33, "", false, wnd) guiSetFont(res, "default-bold-small") rewr = guiCreateLabel(120, 517, 52, 15, "Reasson :", false, wnd) guiSetFont(rewr, "default-bold-small") bindKey ("F5","down", function () guiSetVisible(wnd,not guiGetVisible(wnd)) showCursor (guiGetVisible(wnd)) guiSetInputEnabled (guiGetVisible(wnd)) end ) function ref () guiGridListClear (grid) for i , v in ipairs (getElementsByType ("player")) do local row = guiGridListAddRow (grid) guiGridListSetItemText (grid,row,1,tostring(getPlayerName(v)),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,ref) addEventHandler ("onClientPlayerChangeNick",root,ref) addEventHandler ("onClientPlayerJoin",root,ref) addEventHandler ("onClientPlayerQuit",root,ref) tab = { {"1 Minute",60000}, {"2 Minutes",2*60000}, {"3 Minutes",3*60000}, {"5 Minutes",5*60000}, {"15 Minutes",15*60000}, {"30 Minutes",30*60000} } for i,k in ipairs (tab) do local rw = guiGridListAddRow (grid2) guiGridListSetItemText(grid2,rw,1,tostring(k[1]),false,false) guiGridListSetItemData (grid2,rw,1,tonumber(k[2])) end addEventHandler ("onClientGUIClick",k, function () local sel,sel2 = guiGridListGetSelectedItem (grid),guiGridListGetSelectedItem (grid2) if sel ~= -1 and sel2 ~= -1 then local plrName = guiGridListGetItemText (grid,sel,1) local plr = getPlayerFromName (plrName) local Time = guiGridListGetItemData (grid2,sel2,1) local ress = guiGetText (res) triggerServerEvent ("Pri",localPlayer,plr,plrName,Time,ress) end end ,false) addEventHandler ("onClientGUIClick",no, function () local sel,sel2 = guiGridListGetSelectedItem (grid) if sel ~= -1 then local plrName = guiGridListGetItemText (grid,sel,1) local plr = getPlayerFromName (plrName) local ress = guiGetText (res) triggerServerEvent ("NJail",localPlayer,plr,plrName,ress) end end,false) -- Server function JailPlayer(elem,x,y,z,int,Dim) -- من اوسكار setElementPosition(elem,x,y,z) setElementInterior (elem,int) setElementDimension (elem,Dim) end v = {} addEvent ("Pri",true) addEventHandler ("Pri",root, function (plr,name,time,ress) if isTimer (v[plr]) then return outputChatBox (""..name.." is already jailed.",source,255,5,5) end if isPedInVehicle (plr) then removePedFromVehicle (plr) end JailPlayer(plr,263,77,1001,6,600) outputChatBox (""..name.." is successfuly jailed.",source,5,255,5) outputChatBox ("You were imprisoned by "..getPlayerName(source).." - ("..ress..") ",plr,255,5,5) v[plr] = setTimer (function () setElementInterior (plr,0) setElementDimension (plr,0) setElementPosition (plr,1545.3995361328,-1675.6196289063,13.560287475586) outputChatBox ("You are free now.",plr,5,255,5) end,time,1) end) addEvent ("NJail",true) addEventHandler ("NJail",root, function (plr,name,ress) if isTimer (v[plr]) then setElementInterior (plr,0) setElementDimension (plr,0) setElementPosition (plr,1545.3995361328,-1675.6196289063,13.560287475586) outputChatBox (""..name.." is successfuly freed.",source,5,255,5) outputChatBox ("You were freed by "..getPlayerName(source).." - ("..ress..").",plr,5,255,5) else return outputChatBox (""..name.." is not jailed.",source,255,5,5) end killTimer (v[plr]) end ) بس مش خسارة فيك
  11. مش فاهم اي شئ انت قلته
  12. function getFixedName(player) if isElement(player) then local hisName = getPlayerName(player) if hisName then result = string.gsub(hisName, '#%x%x%x%x%x%x', '') if result then return result end end end end function update () guiGridListClear(GUIEditor.gridlist[2]) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (GUIEditor.gridlist[2]) guiGridListSetItemText (GUIEditor.gridlist[2],rp,1,getFixedName(v),false,false) guiGridListSetItemColor(GUIEditor.gridlist[2],rp,1, 35, 254, 0, 255,false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update) عايزه من غير اللوان
  13. guiGridListSetItemColor(GUIEditor.gridlist[2],rp, 1, 35, 254, 0, 255,false,false)
  14. عشان من غير السيريال اي لاعب هايقدر يتحكم في القاعدة يعني اكنها قاعدة واحدة بس و كل الاعبين بيتحكموا فيها عشان كدة لازم القاعدة تكون علي حسب كل سيريال لاعب عشان بأختصار يكون ليك قاعدة خاصة بسيريالك تقدر تتحكم فيها زي ما انت عايز
  15. شوف الفرق و هاتتعلم اكتر ان شاء الله -- Client addEventHandler ("onClientResourceStart",resourceRoot, -- لاحظ اني خليت الحدث كلينت function () -- عشان القاعدة تكون عند الاعب المحلي triggerServerEvent ("createSQLTable",localPlayer) triggerServerEvent ("onStart",localPlayer) end ) -- Server addEvent ("createSQLTable",true) addEventHandler('createSQLTable', root, function () local CreateNewTable = executeSQLQuery ('CREATE TABLE IF NOT EXISTS `SaveObj` ( serial,ObjModel,objX,objY,objZ ) ') if ( CreateNewTable ) then outputDebugString('Create Save Object Table') end end ) function createNewObject(player) local x, y, z = getElementPosition(player) newObject = createObject(8661, x, y, z) local ox,oy,oz = getElementPosition (newObject) local Results = executeSQLQuery("SELECT * FROM `SaveObj` WHERE serial=?",getPlayerSerial(player) ) if #Results == 0 or not Results then executeSQLQuery ("INSERT INTO `SaveObj` (serial,ObjModel,objX,objY,objZ) VALUES (?,?,?,?,?)",getPlayerSerial(player),getElementModel (newObject),ox,oy,oz) else executeSQLQuery ("UPDATE `SaveObj` SET ObjModel =?, objX =? , objY = ? , objZ = ? WHERE serial =?",getElementModel(newObject),ox,oy,oz,getPlayerSerial(player)) end end addCommandHandler("create", createNewObject) -- لاحظ اني مسحت حدث لما المود ينطفي عشان مالهوش لازمة addEvent ("onStart",true) addEventHandler ("onStart",root, function () local mhmd = executeSQLQuery ("SELECT * FROM SaveObj WHERE serial =?",getPlayerSerial (source)) if #mhmd ~= 0 then createObject (mhmd[1]["ObjModel"],mhmd[1]["objX"],mhmd[1]["objY"],mhmd[1]["objZ"]) else return end end )
  16. انت مش حاطت امر اصلاً اطرح كودك كامل
  17. وش بك انت ؟ حافظ SQL اكتر من اسمك ض امنور دة نورك
  18. ايه هي فكرة مودك ؟ يصنع مثلاً اوبجكت و يحط احداثياته و الايدي بتاعه في قاعدة ؟ انا شايفه ناقص ولا انت طرحت جزء بس ؟ شوف حدث لما المود ينطفي local x,y,z = getElementPosition ( newObject ) newObject ? مفيش اوبجكت معرف او مصنوع عشان معلوماته تتحط في القاعدة و حدث لما المود يشتغل local Results = executeSQLQuery("SELECT * FROM `Save Object` WHERE ObjModel=?, objX =?, objY =?, objZ =? ",model,x,y,z) المفروض تكون local Results = executeSQLQuery("SELECT * FROM `Save Object` WHERE ObjModel=? ",model) اللي انت عملته مالهوش هدف بأختصار
  19. اعمل موضوع جديد في قسم البرمجة و فيه مشكلتك يكون احسن
  20. في قوس زيادة في آخر كودك امسحه
  21. المفروض تسوي للأحداث تايمر ، لأن كذا بيسبب لاق للسيرفر كل م احد خرج ولا دخل يتحدث كدة هايكون في لاج اكتر لأن دايماً بعد فترة قليلة الجريد ليست تتمسح و لوب للاعبين و يحط اسمائهم في الجريد ليست اديتك اللي انت عايزه فوق
  22. function update () guiGridListClear(grid) for i,v in ipairs (getElementsByType("player")) do local rp = guiGridListAddRow (grid) guiGridListSetItemText (grid,rp,1,getPlayerName(v),false,false) end end addEventHandler ("onClientResourceStart",resourceRoot,update) addEventHandler ("onClientPlayerJoin",root,update) addEventHandler ("onClientPlayerChangeNick",root,update) addEventHandler ("onClientPlayerQuit",root,update)
  23. سمي الكولمن Update بأسم مختلف
  24. شوف كودي فوق ردك و اتعلم منه
×
×
  • Create New...