Jump to content

iMr.SFA7

Members
  • Posts

    2,013
  • Joined

  • Last visited

Everything posted by iMr.SFA7

  1. فقـط المفـروض تحط ارقمنتاتـها والارقمنت الوحيد وهـو اللاعب أنت حط اللاعب هو اللوكال بلايـر getPlayerName أنت حطيت الوظيفة
  2. نـزل موضـوع بقـسم البـرمجة وبنـساعدك مهـوب تطـلب هنـا cancelEvent with 'onPlayerChat' -- يكـنسل الايفنـت يعـني يمنعـه من الكتابـة بالشآت
  3. سوي زيـادة للشـهر بعد +1 local m = time.month +1
  4. getTime قـم بتعديـل الوظيفة: function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute local s = time.second return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m)..":"..s.." "..(h >= 12 and "PM" or "AM") end
  5. !بـس 'PM' آمم غـريبة أنا يجيني ع العمـوم جربـه كـذآ: function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 140, 40, "", false) guiSetFont(TIME, "sa-header") addEventHandler("onClientRender",root,function() local time = getTime() guiSetText(TIME,""..tostring(time).."") end)
  6. . أنسخـه مرة ثانـية
  7. function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 79, 33, "", false) guiSetFont(TIME, "sa-header") addEventHandler("onClientRender",root,function() local h,m = getTime() guiSetText(TIME,""..tostring(h)..":"..tostring(m).."") end)
  8. GUIEditor = { label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.label[1] = guiCreateLabel(711, 141, 79, 33, ""..hours..":"..minutes.."", false) guiSetFont(GUIEditor.label[1], "sa-header") end ) addEventHandler("onClientRender",root,function() local time = getRealTime() local hours = time.hour local minutes = time.minute guiSetText(GUIEditor.label[1],""..hours..":"..minutes.."") end) 'onClientRender' الخطأ عندكـ هو أنك جبت الوقت في بدايـة تشغـيل السكربت 'الكـلنت' والمـفروض تجيـبه دآخل الحـدث
  9. رح اقرب محـل بيتزا لك او عندك بيتزا هت
  10. function openChatpWindow() if (guiGetVisible(Chat.pWindow) == false) then if (getElementData(localPlayer, "Chatting") ~= nil) then guiSetInputEnabled(true) guiSetVisible(Chat.pWindow, true) if Wchat and type(Wchat) == 'table' then createChat(Wchat[2]) if TextSave and TextSave ~= '' then guiSetText(sfa7[Wchat].Memo,TextSave) end end showCursor(true) else guiSetVisible(Chat.pWindow, true) showCursor(true) guiSetInputEnabled(true) end else guiSetInputEnabled(false) guiSetVisible(Chat.pWindow, false) if Wchat and sfa7[Wchat] and isElement(sfa7[Wchat].ChattingWindow) then local text = guiGetText(sfa7[Wchat].Memo) if text and text ~= '' then TextSave = text end destroyElement(sfa7[Wchat].ChattingWindow) sfa7[Wchat] = nil Wchat = {true,Wchat} end showCursor(false) end end bindKey('F2', 'down', openChatpWindow)
  11. آمم مآ كـآن علـى بآلـي أنك تبيهـا كذآ ع العمـوم الكـود يصـير كذا لم تتـم التـجربة: function openChatpWindow() if (guiGetVisible(Chat.pWindow) == false) then if (getElementData(localPlayer, "Chatting") ~= nil) then guiSetInputEnabled(true) guiSetVisible(Chat.pWindow, true) if Wchat and type(Wchat) == 'table' then createChat(Wchat[2]) end showCursor(true) else guiSetVisible(Chat.pWindow, true) showCursor(true) guiSetInputEnabled(true) end else guiSetInputEnabled(false) guiSetVisible(Chat.pWindow, false) if Wchat and sfa7[Wchat] and isElement(sfa7[Wchat].ChattingWindow) then destroyElement(sfa7[Wchat].ChattingWindow) sfa7[Wchat] = nil Wchat = {true,Wchat} end showCursor(false) end end bindKey('F2', 'down', openChatpWindow)
  12. أطرح أكوادك بعد ما عدلـت عليهـا وحليـت المشـكلة
  13. Marker = createMarker ( -302.21, 1507.3, 75, "cylinder",4,0,0,0, 170 ) blip = createBlip (-302.21, 1507.3, 75, 56) window = guiCreateWindow(522, 239, 307, 180, "نظام فتح الباب المشفر", false) guiSetVisible (window , false ) edit = guiCreateEdit(82, 70, 150, 34, "", false, window ) button = guiCreateButton(118, 114, 78, 34, "فتح البوابة", false, window ) label = guiCreateLabel(82, 40, 155, 20, " ضع كلمة المرور هنا لفتح البوابة", false, window ) local Pass = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} addEventHandler("onClientMarkerHit",Marker, function (player) if player ~= localPlayer then return end Pass = math.random (#Pass) guiSetVisible ( window, true ) showCursor ( true ) end) addEventHandler('onClientGUIClick', button,function() if Pass and tonumber(guiGetText ( edit )) == Pass then triggerServerEvent('open', localPlayer) guiSetVisible ( window, false ) showCursor ( false ) outputChatBox('Welcome!',255,0,0,true) else --guiSetVisible ( window , false ) --showCursor ( false ) outputChatBox('Error!',255,0,0,true) end end, false )
  14. -- Client Side -- MoteInfo = {} SentMessage = { Button = {} } MoreInfo = { Button = {} } Chat = {} Message = { Edit = {} } X = { Button = {} } Search = { Edit = {} } PlayerStatus = { Button = {} } GUIEditor = { gridlist = {}, label = {} } sfa7 = {} Wchat = false setElementData(localPlayer, "Chatting", nil) setElementData(localPlayer, "Status", "Online") local screenW, screenH = guiGetScreenSize() Chat.pWindow = guiCreateWindow(screenW - 297 - 10, (screenH - 420) / 2, 297, 420, "# - | Chat system | - #", false) guiWindowSetSizable(Chat.pWindow, false) guiSetAlpha(Chat.pWindow, 1.00) guiSetProperty(Chat.pWindow, "CaptionColour", "FF00F5FE") guiSetVisible(Chat.pWindow, false) GUIEditor.gridlist[1] = guiCreateGridList(10, 57, 229, 319, false, Chat.pWindow) guiGridListSetSelectionMode(GUIEditor.gridlist[1], 0) guiSetFont(GUIEditor.gridlist[1], "default-bold-small") guiGridListAddColumn(GUIEditor.gridlist[1], "# Player", 0.6) guiGridListAddColumn(GUIEditor.gridlist[1], "# Status", 0.3) Search.Edit.pWindow = guiCreateEdit(10, 27, 229, 24, "Search", false, Chat.pWindow) GUIEditor.label[1] = guiCreateLabel(10, 383, 68, 27, "My status : ", false, Chat.pWindow) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 0, 239, 253) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") PlayerStatus.Button.pWindow = guiCreateButton(88, 383, 151, 27, "# Offline ~", false, Chat.pWindow) guiSetFont(PlayerStatus.Button.pWindow, "default-bold-small") guiSetProperty(PlayerStatus.Button.pWindow, "NormalTextColour", "FFFC0000") X.Button.pWindow = guiCreateButton(257, 383, 30, 27, "X", false, Chat.pWindow) guiSetFont(X.Button.pWindow, "default-bold-small") guiSetProperty(X.Button.pWindow, "NormalTextColour", "FFFC0000") MoreInfo.Button.pWindow = guiCreateButton(257, 27, 30, 27, "؟", false, Chat.pWindow) guiSetFont(MoreInfo.Button.pWindow, "default-bold-small") guiSetProperty(MoreInfo.Button.pWindow, "NormalTextColour", "FF2FFB00") GUIEditor.label[2] = guiCreateLabel(277, 57, 15, 319, "|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|", false, Chat.pWindow) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 245, 0, 0) guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") MoteInfo.MoreInfoWindow = guiCreateWindow(0.54, 0.07, 0.23, 0.17, "# - | More Info about | - #", true) guiWindowSetSizable(MoteInfo.MoreInfoWindow, false) guiSetAlpha(MoteInfo.MoreInfoWindow, 1.00) guiSetProperty(MoteInfo.MoreInfoWindow, "CaptionColour", "FF13FE1E") guiSetVisible(MoteInfo.MoreInfoWindow, false) GUIEditor.label[3] = guiCreateLabel(10, 21, 98, 23, "- Player status : ", false, MoteInfo.MoreInfoWindow) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 39, 120, 255) guiLabelSetVerticalAlign(GUIEditor.label[3], "center") GUIEditor.label[4] = guiCreateLabel(10, 44, 243, 46, "* If you set your status to \"Offline\", \n you can't send any message,\n and everyone can't send you a messages", false, MoteInfo.MoreInfoWindow) guiSetFont(GUIEditor.label[4], "default-bold-small") X.Button.MoreInfoWindow = guiCreateButton(269, 100, 33, 21, "X", false, MoteInfo.MoreInfoWindow) guiSetFont(X.Button.MoreInfoWindow, "default-bold-small") guiSetProperty(X.Button.MoreInfoWindow, "NormalTextColour", "FFF50000") function createChat(player) local screenW, screenH = guiGetScreenSize() sfa7[player] = {} sfa7[player].ChattingWindow = guiCreateWindow((screenW - 566) / 2, (screenH - 370) / 2, 566, 370, getPlayerName(player), false) guiWindowSetSizable(sfa7[player].ChattingWindow, false) guiSetAlpha(sfa7[player].ChattingWindow, 1.00) guiSetProperty(sfa7[player].ChattingWindow, "CaptionColour", "FF00E6F5") guiSetVisible(sfa7[player].ChattingWindow, false) sfa7[player].Memo = guiCreateMemo(9, 24, 547, 304, "", false, sfa7[player].ChattingWindow) guiMemoSetReadOnly(sfa7[player].Memo, true) sfa7[player].Edit = guiCreateEdit(10, 332, 399, 28, "", false, sfa7[player].ChattingWindow) sfa7[player].SentMessage = guiCreateButton(413, 332, 93, 28, "# Send ~", false, sfa7[player].ChattingWindow) guiSetFont(sfa7[player].SentMessage, "default-bold-small") guiSetProperty(sfa7[player].SentMessage, "NormalTextColour", "FF0BF500") sfa7[player].X = guiCreateButton(522, 332, 34, 28, "X", false, sfa7[player].ChattingWindow) guiSetFont(sfa7[player].X, "default-bold-small") guiSetProperty(sfa7[player].X, "NormalTextColour", "FFF50000") Wchat = player if guiGetVisible(Chat.pWindow) == true then guiSetVisible(sfa7[player].ChattingWindow,true) else guiSetVisible(sfa7[player].ChattingWindow,false) end end function refreshList_() guiGridListClear(GUIEditor.gridlist[1]) for _, player_ in ipairs(getElementsByType('player')) do local itemPlayer = guiGridListAddRow(GUIEditor.gridlist[1]) local itemText = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 1, getPlayerName(player_), false, false) local itemStatus = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 2, getElementData(player_, "Status"), false, false) if (getElementData(player_, "Status") == "Online") then guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 0, 255, 0) else guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 255, 0, 0) end end end addEvent( 'RefreshList', true ) addEventHandler( 'RefreshList', root, function() setTimer(function() refreshList_() end, 50, 1) guiGridListClear(GUIEditor.gridlist[1]) for _, player_ in ipairs(getElementsByType('player')) do local itemPlayer = guiGridListAddRow(GUIEditor.gridlist[1]) local itemText = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 1, getPlayerName(player_), false, false) local itemStatus = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 2, getElementData(player_, "Status"), false, false) if (getElementData(player_, "Status") == "Online") then guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 0, 255, 0) else guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 255, 0, 0) end end end ) guiGridListClear(GUIEditor.gridlist[1]) for _, player_ in ipairs(getElementsByType('player')) do local itemPlayer = guiGridListAddRow(GUIEditor.gridlist[1]) local itemText = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 1, getPlayerName(player_), false, false) local itemStatus = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 2, getElementData(player_, "Status"), false, false) if (getElementData(player_, "Status") == "Online") then guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 0, 255, 0) else guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 255, 0, 0) end end addEventHandler( 'onClientGUIClick', resourceRoot, function() local parent = getElementParent(source) if getElementType(source) ~= 'gui-button' then return end; if parent and guiGetText(parent) ~= '# - | Chat system | - #' then local playerSource = getPlayerFromName(guiGetText(parent)) if playerSource then if (source == sfa7[playerSource].SentMessage) then if sfa7[playerSource] and isElement(sfa7[playerSource].ChattingWindow) then local getMessage = guiGetText(sfa7[playerSource].Edit) if (getMessage == "") then outputChatBox('* ERROR : #FFFFFF Please write a message !', 255, 0, 0, true) return end --guiSetText (sfa7[playerSource].Memo, "" ..guiGetText(sfa7[playerSource].Memo).. ""..getPlayerName(localPlayer).." : "..guiGetText (sfa7[playerSource].Edit).."") local MemoMessages = guiGetText(sfa7[playerSource].Memo) if not MemoMessages then MemoMessages = "" end MemoMessages = MemoMessages.. getPlayerName(localPlayer) ..' : '.. getMessage ..'\n' guiSetText(sfa7[playerSource].Memo, MemoMessages) guiSetText(sfa7[playerSource].Edit, '') guiMemoSetCaretIndex(sfa7[playerSource].Memo, string.len(MemoMessages)) triggerServerEvent ( "SentMessageToPlayer", localPlayer, playerSource, getMessage) end elseif (source == sfa7[playerSource].X) then if sfa7[playerSource] and isElement(sfa7[playerSource].ChattingWindow) then destroyElement(sfa7[playerSource].ChattingWindow) sfa7[playerSource] = nil Wchat = false end setElementData(localPlayer, "Chatting", nil) end end end end) addEventHandler('onClientGUIClick', resourceRoot, function() if (source == X.Button.pWindow) then guiSetVisible(Chat.pWindow, false) guiSetInputEnabled(false) showCursor(false) if Wchat and sfa7[Wchat] and isElement(sfa7[Wchat].ChattingWindow) then destroyElement(sfa7[Wchat].ChattingWindow) sfa7[Wchat] = nil Wchat = false end elseif (source == X.Button.MoreInfoWindow) then guiSetVisible(MoteInfo.MoreInfoWindow, false) elseif (source == MoreInfo.Button.pWindow) then guiSetVisible(MoteInfo.MoreInfoWindow, true) elseif (source == PlayerStatus.Button.pWindow) then if (guiGetText(PlayerStatus.Button.pWindow) == "# Offline ~") then triggerServerEvent( 'setPlayerStatusOffline', localPlayer ) guiSetText(PlayerStatus.Button.pWindow, "# Online ~") guiSetProperty(PlayerStatus.Button.pWindow, "NormalTextColour", "FF13FE1E") guiSetEnabled(GUIEditor.gridlist[1], false) else triggerServerEvent( 'setPlayerStatusOnline', localPlayer ) guiSetText(PlayerStatus.Button.pWindow, "# Offline ~") guiSetProperty(PlayerStatus.Button.pWindow, "NormalTextColour", "FFFC0000") guiSetEnabled(GUIEditor.gridlist[1], true) end end end) addEvent( 'SentMessageTo', true ) addEventHandler( 'SentMessageTo', root, function(player, MemoMessages) if not sfa7[player] then createChat(player) end local Messages = guiGetText(sfa7[player].Memo) if not Messages then Messages = "" end Messages = Messages .. getPlayerName(player) .. " : " .. MemoMessages .. "\n" guiSetText(sfa7[player].Memo, Messages) end) addEventHandler( 'onClientGUIDoubleClick', root, function() if (source == GUIEditor.gridlist[1]) then local Selected = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if (Selected == -1) then return end local playerSelected = guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1], 1)) local playerStatus = getPlayerFromName(playerSelected) if (playerSelected) then if (getElementData(playerStatus, "Status") == "Offline") then outputChatBox('* ERROR : #FFFFFF This player is offline !', 255, 0, 0, true) return end --if (playerStatus == localPlayer) then outputChatBox('* ERROR : #FFFFFF You can't chatting with yourself !', 255, 0, 0, true) return end if not sfa7[playerSelected] then createChat(playerStatus) end setElementData(localPlayer, "Chatting", playerSelected) end end end) function openChatpWindow() if (guiGetVisible(Chat.pWindow) == false) then if (getElementData(localPlayer, "Chatting") ~= nil) then guiSetInputEnabled(true) guiSetVisible(Chat.pWindow, true) showCursor(true) else guiSetVisible(Chat.pWindow, true) showCursor(true) guiSetInputEnabled(true) end else guiSetInputEnabled(false) guiSetVisible(Chat.pWindow, false) if Wchat and sfa7[Wchat] and isElement(sfa7[Wchat].ChattingWindow) then destroyElement(sfa7[Wchat].ChattingWindow) sfa7[Wchat] = nil Wchat = false end
  15. MoteInfo = {} SentMessage = { Button = {} } MoreInfo = { Button = {} } Chat = {} Message = { Edit = {} } X = { Button = {} } Search = { Edit = {} } PlayerStatus = { Button = {} } GUIEditor = { gridlist = {}, label = {} } sfa7 = {} setElementData(localPlayer, "Chatting", nil) setElementData(localPlayer, "Status", "Online") local screenW, screenH = guiGetScreenSize() Chat.pWindow = guiCreateWindow(screenW - 297 - 10, (screenH - 420) / 2, 297, 420, "# - | Chat system | - #", false) guiWindowSetSizable(Chat.pWindow, false) guiSetAlpha(Chat.pWindow, 1.00) guiSetProperty(Chat.pWindow, "CaptionColour", "FF00F5FE") guiSetVisible(Chat.pWindow, false) GUIEditor.gridlist[1] = guiCreateGridList(10, 57, 229, 319, false, Chat.pWindow) guiGridListSetSelectionMode(GUIEditor.gridlist[1], 0) guiSetFont(GUIEditor.gridlist[1], "default-bold-small") guiGridListAddColumn(GUIEditor.gridlist[1], "# Player", 0.6) guiGridListAddColumn(GUIEditor.gridlist[1], "# Status", 0.3) Search.Edit.pWindow = guiCreateEdit(10, 27, 229, 24, "Search", false, Chat.pWindow) GUIEditor.label[1] = guiCreateLabel(10, 383, 68, 27, "My status : ", false, Chat.pWindow) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 0, 239, 253) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") PlayerStatus.Button.pWindow = guiCreateButton(88, 383, 151, 27, "# Offline ~", false, Chat.pWindow) guiSetFont(PlayerStatus.Button.pWindow, "default-bold-small") guiSetProperty(PlayerStatus.Button.pWindow, "NormalTextColour", "FFFC0000") X.Button.pWindow = guiCreateButton(257, 383, 30, 27, "X", false, Chat.pWindow) guiSetFont(X.Button.pWindow, "default-bold-small") guiSetProperty(X.Button.pWindow, "NormalTextColour", "FFFC0000") MoreInfo.Button.pWindow = guiCreateButton(257, 27, 30, 27, "؟", false, Chat.pWindow) guiSetFont(MoreInfo.Button.pWindow, "default-bold-small") guiSetProperty(MoreInfo.Button.pWindow, "NormalTextColour", "FF2FFB00") GUIEditor.label[2] = guiCreateLabel(277, 57, 15, 319, "|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|", false, Chat.pWindow) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 245, 0, 0) guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") MoteInfo.MoreInfoWindow = guiCreateWindow(0.54, 0.07, 0.23, 0.17, "# - | More Info about | - #", true) guiWindowSetSizable(MoteInfo.MoreInfoWindow, false) guiSetAlpha(MoteInfo.MoreInfoWindow, 1.00) guiSetProperty(MoteInfo.MoreInfoWindow, "CaptionColour", "FF13FE1E") guiSetVisible(MoteInfo.MoreInfoWindow, false) GUIEditor.label[3] = guiCreateLabel(10, 21, 98, 23, "- Player status : ", false, MoteInfo.MoreInfoWindow) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 39, 120, 255) guiLabelSetVerticalAlign(GUIEditor.label[3], "center") GUIEditor.label[4] = guiCreateLabel(10, 44, 243, 46, "* If you set your status to \"Offline\", \n you can't send any message,\n and everyone can't send you a messages", false, MoteInfo.MoreInfoWindow) guiSetFont(GUIEditor.label[4], "default-bold-small") X.Button.MoreInfoWindow = guiCreateButton(269, 100, 33, 21, "X", false, MoteInfo.MoreInfoWindow) guiSetFont(X.Button.MoreInfoWindow, "default-bold-small") guiSetProperty(X.Button.MoreInfoWindow, "NormalTextColour", "FFF50000") function createChat(player) local screenW, screenH = guiGetScreenSize() sfa7[player] = {} sfa7[player].ChattingWindow = guiCreateWindow((screenW - 566) / 2, (screenH - 370) / 2, 566, 370, getPlayerName(player), false) guiWindowSetSizable(sfa7[player].ChattingWindow, false) guiSetAlpha(sfa7[player].ChattingWindow, 1.00) guiSetProperty(sfa7[player].ChattingWindow, "CaptionColour", "FF00E6F5") guiSetVisible(sfa7[player].ChattingWindow, false) sfa7[player].Memo = guiCreateMemo(9, 24, 547, 304, "", false, sfa7[player].ChattingWindow) guiMemoSetReadOnly(sfa7[player].Memo, true) sfa7[player].Edit = guiCreateEdit(10, 332, 399, 28, "", false, sfa7[player].ChattingWindow) sfa7[player].SentMessage = guiCreateButton(413, 332, 93, 28, "# Send ~", false, sfa7[player].ChattingWindow) guiSetFont(sfa7[player].SentMessage, "default-bold-small") guiSetProperty(sfa7[player].SentMessage, "NormalTextColour", "FF0BF500") sfa7[player].X = guiCreateButton(522, 332, 34, 28, "X", false, sfa7[player].ChattingWindow) guiSetFont(sfa7[player].X, "default-bold-small") guiSetProperty(sfa7[player].X, "NormalTextColour", "FFF50000") if guiGetVisible(Chat.pWindow) == true then guiSetVisible(sfa7[player].ChattingWindow,true) else guiSetVisible(sfa7[player].ChattingWindow,false) end end function refreshList_() guiGridListClear(GUIEditor.gridlist[1]) for _, player_ in ipairs(getElementsByType('player')) do local itemPlayer = guiGridListAddRow(GUIEditor.gridlist[1]) local itemText = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 1, getPlayerName(player_), false, false) local itemStatus = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 2, getElementData(player_, "Status"), false, false) if (getElementData(player_, "Status") == "Online") then guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 0, 255, 0) else guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 255, 0, 0) end end end addEvent( 'RefreshList', true ) addEventHandler( 'RefreshList', root, function() setTimer(function() refreshList_() end, 50, 1) guiGridListClear(GUIEditor.gridlist[1]) for _, player_ in ipairs(getElementsByType('player')) do local itemPlayer = guiGridListAddRow(GUIEditor.gridlist[1]) local itemText = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 1, getPlayerName(player_), false, false) local itemStatus = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 2, getElementData(player_, "Status"), false, false) if (getElementData(player_, "Status") == "Online") then guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 0, 255, 0) else guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 255, 0, 0) end end end ) guiGridListClear(GUIEditor.gridlist[1]) for _, player_ in ipairs(getElementsByType('player')) do local itemPlayer = guiGridListAddRow(GUIEditor.gridlist[1]) local itemText = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 1, getPlayerName(player_), false, false) local itemStatus = guiGridListSetItemText(GUIEditor.gridlist[1], itemPlayer, 2, getElementData(player_, "Status"), false, false) if (getElementData(player_, "Status") == "Online") then guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 0, 255, 0) else guiGridListSetItemColor(GUIEditor.gridlist[1], itemPlayer, 2, 255, 0, 0) end end addEventHandler( 'onClientGUIClick', resourceRoot, function() local parent = getElementParent(source) if getElementType(source) ~= 'gui-button' then return end; if parent and guiGetText(parent) ~= '# - | Chat system | - #' then local playerSource = getPlayerFromName(guiGetText(parent)) if playerSource then if (source == sfa7[playerSource].SentMessage) then local getMessage = guiGetText(sfa7[playerSource].Edit) if (getMessage == "") then outputChatBox('* ERROR : #FFFFFF Please write a message !', 255, 0, 0, true) return end --guiSetText (sfa7[playerSource].Memo, "" ..guiGetText(sfa7[playerSource].Memo).. ""..getPlayerName(localPlayer).." : "..guiGetText (sfa7[playerSource].Edit).."") local playerName = getPlayerName(localPlayer) local MemoMessages = guiGetText(sfa7[playerSource].Memo) local getMessage_ = guiGetText(sfa7[playerSource].Edit) triggerServerEvent ( "SentMessageToPlayer", localPlayer, playerSource, MemoMessages, playerName, getMessage_) guiSetText(sfa7[playerSource].Edit, "") elseif (source == sfa7[playerSource].X) then if sfa7[playerSource] and isElement(sfa7[playerSource].ChattingWindow) then destroyElement(sfa7[playerSource].ChattingWindow) sfa7[playerSource] = nil end setElementData(localPlayer, "Chatting", nil) end end end end) addEventHandler('onClientGUIClick', resourceRoot, function() if (source == X.Button.pWindow) then guiSetVisible(Chat.pWindow, false) guiSetInputEnabled(false) showCursor(false) elseif (source == X.Button.MoreInfoWindow) then guiSetVisible(MoteInfo.MoreInfoWindow, false) elseif (source == MoreInfo.Button.pWindow) then guiSetVisible(MoteInfo.MoreInfoWindow, true) elseif (source == PlayerStatus.Button.pWindow) then if (guiGetText(PlayerStatus.Button.pWindow) == "# Offline ~") then triggerServerEvent( 'setPlayerStatusOffline', localPlayer ) guiSetText(PlayerStatus.Button.pWindow, "# Online ~") guiSetProperty(PlayerStatus.Button.pWindow, "NormalTextColour", "FF13FE1E") guiSetEnabled(GUIEditor.gridlist[1], false) else triggerServerEvent( 'setPlayerStatusOnline', localPlayer ) guiSetText(PlayerStatus.Button.pWindow, "# Offline ~") guiSetProperty(PlayerStatus.Button.pWindow, "NormalTextColour", "FFFC0000") guiSetEnabled(GUIEditor.gridlist[1], true) end end end) addEvent( 'SentMessageTo', true ) addEventHandler( 'SentMessageTo', root, function(player, MemoMessages, playerName, getMessage_ ) guiSetText (sfa7[player].Memo,"" ..MemoMessages.. "" ..playerName.. " : " ..getMessage_.. "") end) addEventHandler( 'onClientGUIDoubleClick', root, function() if (source == GUIEditor.gridlist[1]) then local Selected = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if (Selected == -1) then return end local playerSelected = guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1], 1)) local playerStatus = getPlayerFromName(playerSelected) if (playerSelected) then if (getElementData(playerStatus, "Status") == "Offline") then outputChatBox('* ERROR : #FFFFFF This player is offline !', 255, 0, 0, true) return end --if (playerStatus == localPlayer) then outputChatBox('* ERROR : #FFFFFF You can't chatting with yourself !', 255, 0, 0, true) return end if not sfa7[playerStatus] then createChat(playerStatus) end setElementData(localPlayer, "Chatting", playerSelected) end end end) function openChatpWindow() if (guiGetVisible(Chat.pWindow) == false) then if (getElementData(localPlayer, "Chatting") ~= nil) then guiSetInputEnabled(true) for i,l in ipairs(sfa7) do guiSetVisible(sfa7[i].ChattingWindow,true) end guiSetVisible(Chat.pWindow, true) showCursor(true) else guiSetVisible(Chat.pWindow, true) showCursor(true) guiSetInputEnabled(true) end else guiSetInputEnabled(false) guiSetVisible(Chat.pWindow, false) for i,l in ipairs(sfa7) do guiSetVisible(sfa7[i].ChattingWindow,false) end showCursor(false) end end bindKey( "F2", "down", openChatpWindow) addEvent( 'SentMessageToPlayer', true ) addEventHandler( 'SentMessageToPlayer', root, function(player, MemoMessages, playerName, getMessage_) triggerClientEvent( player, "SentMessageTo", source, source, MemoMessages, playerName, getMessage_ ) end) addEventHandler( 'onPlayerChangeNick', root, function() triggerClientEvent( 'RefreshList', source ) end ) addEventHandler( 'onPlayerQuit', root, function() triggerClientEvent( 'RefreshList', source ) end ) addEventHandler( 'onPlayerJoin', root, function() setElementData(source, "Status", "Online") triggerClientEvent( 'RefreshList', source ) end ) addEvent( 'setPlayerStatusOffline', true ) addEventHandler( 'setPlayerStatusOffline', root, function() setElementData(source, "Status", "Offline") triggerClientEvent( 'RefreshList', source ) end ) addEvent( 'setPlayerStatusOnline', true ) addEventHandler( 'setPlayerStatusOnline', root, function() setElementData(source, "Status", "Online") triggerClientEvent( 'RefreshList', source ) end )
  16. اذا كان يبيه محد يركب السيارة حتى ولو راكب يحددها أنا ما عرفت الي يبيه بالضبط بس هذا محد يقدر يركب الا السائق
  17. -- كلنـت -- ---------------------- -- Setting ---------------------- local Admin = { {"VIP","1500"}, {"LVL1","4000"}, {"LVL2","6000"}, {"LVL3","8000"}, {"LVL4","11000"}, {"LVL5","16000"}, {"TheGamer","20000"}, {"TheStronger","25000"}, {"TheKiller","32000"}, {"Professional","43000"}, {"Admin","110000"}, } ---------------------- -- Setting ---------------------- GUIEditor = { gridlist = {}, staticimage = {}, button = {}, label = {} } GUIEditor.staticimage[1] = guiCreateStaticImage(236, 113, 308, 379, "Back.png", false) guiSetVisible(GUIEditor.staticimage[1], false) guiWindowSetSizable(GUIEditor.staticimage[1], false) guiWindowSetMovable(GUIEditor.staticimage[1], true) GUIEditor.label[1] = guiCreateLabel(11, 59, 159, 18, "rank system :", false, GUIEditor.staticimage[1]) guiSetFont(GUIEditor.label[1], "clear-normal") guiLabelSetColor(GUIEditor.label[1], math.random(0,255),math.random(0,255),math.random(0,255)) GUIEditor.label[2] = guiCreateLabel(28, 10, 252, 17, "Welcome To Z.P server", false, GUIEditor.staticimage[1]) guiSetFont(GUIEditor.label[2], "clear-normal") guiLabelSetColor(GUIEditor.label[2], 255, 153, 0) GUIEditor.label[3] = guiCreateLabel(11, 345, 186, 16, "Buy Rank By : Michael", false, GUIEditor.staticimage[1]) guiSetFont(GUIEditor.label[3], "clear-normal") guiLabelSetColor(GUIEditor.label[3], math.random(0,255),math.random(0,255),math.random(0,255)) GUIEditor.button[1] = guiCreateButton(202, 335, 96, 39, "Buy Rank", false, GUIEditor.staticimage[1]) guiSetFont(GUIEditor.button[1], "clear-normal") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF9900") GUIEditor.gridlist[1] = guiCreateGridList(11, 83, 287, 242, false, GUIEditor.staticimage[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Group", 0.7) guiGridListAddColumn(GUIEditor.gridlist[1], "Zombie kills", 0.3) for k,v in ipairs ( Admin ) do row = guiGridListAddRow(GUIEditor.gridlist[1]); guiGridListSetItemText(GUIEditor.gridlist[1],row,1,v[1],false,false); guiGridListSetItemText(GUIEditor.gridlist[1],row,2,v[2],false,false); guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,math.random(0,255),math.random(0,255),math.random(0,255)) guiGridListSetItemColor(GUIEditor.gridlist[1],row,2,math.random(0,255),math.random(0,255),math.random(0,255)) end xMainFunctions_ = function ( ) local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) local Group = tostring ( guiGridListGetItemText(GUIEditor.gridlist[1],row,1 )); local Price = tostring ( guiGridListGetItemText(GUIEditor.gridlist[1],row,2 )); if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent("Accept:the:request",localPlayer,Group,Price) else outputChatBox("Please Click On The Rank",math.random(0,255),math.random(0,255),math.random(0,255),true); end end addEventHandler("onClientGUIClick",GUIEditor.button[1],xMainFunctions_,false); addEventHandler ( "onClientResourceStart", root, function ( ) if ( isTimer ( timerColor ) ) then killTimer ( timerColor ) end timerColor = setTimer ( function ( ) guiLabelSetColor ( GUIEditor.label[1], math.random ( 255 ), math.random ( 255 ), math.random ( 255 ) ) guiLabelSetColor ( GUIEditor.label[3], math.random ( 255 ), math.random ( 255 ), math.random ( 255 ) ) end, 100, 0 ) end ) addEventHandler("onClientResourceStart", resourceRoot, function() setTimer(function() for _, random in ipairs(getElementsByType('gui-button',getResourceRootElement(getThisResource())) ) do guiSetProperty(random, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255))) end end, 100, 0) end) bindKey("F7", "down", function() if guiGetVisible(GUIEditor.staticimage[1]) == true then guiSetVisible(GUIEditor.staticimage[1], false) showCursor(false) guiSetInputEnabled(false) else if guiGetVisible(GUIEditor.staticimage[1]) == false then guiSetVisible(GUIEditor.staticimage[1], true) showCursor(false) guiSetInputEnabled(true) end end end ) -- سيرفر -- xAddToGroupFunction_ = function ( Group,Price ) if isGuestAccount(getPlayerAccount(source)) then return outputChatBox("#You must register first",source,255,0,0,true); end local account = getAccountName(getPlayerAccount(source)); if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("#You have this rank, please choose another one",source,0,255,255,true); end local sValue = getElementData( source,'Zombie kills' ) if not sValue then sValue = '0' end local kills = tonumber( sValue ) if kills == nil or not kills then kills = 0 end if (kills >= tonumber(Price)) then aclGroupAddObject (aclGetGroup(tostring(Group)),"user."..account); outputChatBox("#Rank has been added successfully "..Name,source,255,0,0,true); else outputChatBox("#You do not have enough Kills",source,0,255,255,true); end end addEvent("Accept:the:request",true) addEventHandler("Accept:the:request",root,xAddToGroupFunction_)
  18. انت لما اللاعب ينزل السيـارة حط ع السيـارة داتـا بالسيريال حق اللاعب addEvent('createUSERcar', true) addEventHandler( 'createUSERcar', root, function(getCarID, Serial) local x, y, z = getElementPosition(source) if (not isElement(vehicle[source])) then vehicle[source] = createVehicle( getCarID, x + 2, y + 2, z + 1) setElementData(vehicle[source],'VehicleSerial',getPlayerSerial(source)) else destroyElement(vehicle[source]) vehicle[source] = createVehicle( getCarID, x + 2, y + 2, z + 1) setElementData(vehicle[source],'VehicleSerial',getPlayerSerial(source)) end end ) :وتقـدر تختـصر كودكـ يكون كذا addEvent('createUSERcar', true) addEventHandler( 'createUSERcar', root, function(getCarID, Serial) local x, y, z = getElementPosition(source) if isElement(vehicle[source]) then destroyElement(vehicle[source]) end vehicle[source] = createVehicle( getCarID, x + 2, y + 2, z + 1) setElementData(vehicle[source],'VehicleSerial',getPlayerSerial(source)) end) وتتحقق من الداتا حقت السيارة يـوم يركـب: addEventHandler( 'onVehicleStartEnter', resourceRoot, function(thePlayer, seat) if getElementData(source,'VehicleSerial') then if (getPlayerSerial(thePlayer) == getElementData(source,'VehicleSerial')) then outputChatBox("Welcome to your vehicle!",thePlayer,0,255,0) else cancelEvent() end end end)
  19. وينه؟ Admin الجدول الي اسمه
  20. -- Client Side bindKey("x","down", function() local x,y,z = getElementPosition(localPlayer) nn = createVehicle (411,x,y,z) warpPedIntoVehicle(localPlayer,nn) end ) وملاحظـة: بالكلنت السيارة وهمية والركوب بالسيارة وهمي
  21. سـطر 3 أنت مسوي تحقق أن السورس هو الي بالجدول حق السيارة السورس المفروض بالجدول حق اللاعب if (source == vehicle[thePlayer]) then
  22. هذا لأنك مسوي تـحقق بالسطـر 4 اذا كان الباب هو باب السـائق !! أعتـقد أنك تبي محد يدخل السيـارة كـ سائق غير صاحب السيريال بهـالحالة كودكـ يصير كذا : addEventHandler( 'onVehicleStartEnter', root, function(thePlayer, seat) if getElementType(thePlayer) == 'player' and seat == 0 then if(getPlayerSerial(thePlayer) ~= USERserial) then triggerClientEvent( thePlayer, "CanNotEnter", thePlayer ) cancelEvent() end end end)
×
×
  • Create New...