-
Posts
1,862 -
Joined
-
Days Won
8
Everything posted by Rockyz
-
اي رسالة بالضبط ؟ انا خليت الي داخل يشوفون هذي الرسائل exports["dxmessages"]:outputDx ( plr, "the mission was stated", "info" ) exports["dxmessages"]:outputDx ( plr, "Players in the mission :", "info" ) plrsz = getPlayersInMission ( ) for i = 1, #plrsz do exports["dxmessages"]:outputDx ( plr, getPlayerName ( plrsz [ i ] ), "info" ) ------------- exports["dxmessages"]:outputDx ( plr, " The mission end and the winner is : " .. getElementData ( root, "Winner" ), "info" ) بقاية الرسائل الكل يشوفهم
-
كيف تصبح حمـ?ـار في أسبوع ⁉ .. . . . . . . . . . . . . . . بما إنك كملت القراءة معناه النية موجودة هذة أول خطوة بالتوفيق COPY PASTE
-
جرب عدلت الوظيفة وضفت لها كم شي : local marker = createMarker ( 2488.88281, -1675.15833, 13.33595, "cylinder", 1.5, 255, 255, 255, 255 ) plrs = { } function setPlayerInMission ( plr ) if ( isElement ( plr ) and ( getElementType ( plr ) == "player" ) and ( getElementData ( plr, "MissionR" ) == true ) ) then table.insert ( plrs, plr ) end end function getPlayersInMission ( ) return plrs end function isPlayerInMission ( num, plr ) if ( isElement ( plr ) and ( getElementType ( plr ) == "player" ) ) then if ( num == 2 ) then if ( getElementData ( plr, "MissionR" ) == true ) then return true else return false end else if ( num == 1 ) then if ( getElementData ( plr, "MissionP" ) == true ) then return true else return false end end end end end function endRace ( plr ) if ( getElementData ( plr, "datap" ) == true ) then setElementDimension ( plr, 0 ) setElementPosition ( plr, 2486.92505, -1665.90735, 13.34375 ) exports["dxmessages"]:outputDx ( plr, " The mission end and the winner is : " .. getElementData ( root, "Winner" ), "info" ) setElementData ( plr, "datap", false ) destroyElement ( marker1 ) plrs = { } end end addEventHandler ( "onMarkerHit", resourceRoot, function ( player ) if ( source == marker ) and ( getElementType ( player ) == "player" ) then if ( isPlayerInMission ( 1, player ) == true ) then exports["dxmessages"]:outputDx ( player,"Hi "..getPlayerName(player).." #FFFFFFthe mission not started yet", "error" ) else if not ( isPedInVehicle ( player ) ) then exports["dxmessages"]:outputDx ( player, "this join was mission , Good Luck", "success" ) setElementData ( player, 'MissionR', true ) setElementData ( player, 'MissionP', true ) setPlayerInMission ( player ) end end elseif ( source == marker1 ) and ( getElementType ( player ) == "player" ) then setElementData ( root, "Winner", getPlayerName ( player ) ) for i, v in ipairs ( getElementsByType ( "player" ) ) do endRace ( v ) plrs = { } end end end ) function openMission ( ) for _ ,plr in ipairs ( getElementsByType ( "player" ) ) do exports["dxmessages"]:outputDx ( plr, "the mission will start after 5 seconds", "info" ) setElementData ( plr, 'MissionP', false ) if ( isPlayerInMission ( 2, plr ) == true ) then marker1 = createMarker ( -2662.63989, 1175.23840, 55.42969, "cylinder", 1.5, 255, 255, 255, 255 ) setElementDimension ( plr, 100 ) setElementDimension ( marker1, 100 ) setElementPosition ( plr, -2690.51367, 1289.90479, 55.42969 ) setElementFrozen( plr, true ) setTimer ( function ( ) setElementData ( plr, 'MissionR', false ) setElementFrozen ( plr , false ) setElementData ( plr, "datap", true ) exports["dxmessages"]:outputDx ( plr, "the mission was stated", "info" ) exports["dxmessages"]:outputDx ( plr, "Players in the mission :", "info" ) plrsz = getPlayersInMission ( ) for i = 1, #plrsz do exports["dxmessages"]:outputDx ( plr, getPlayerName ( plrsz [ i ] ), "info" ) end end , 5000, 1 ) end end end addEventHandler ( "onResourceStop", resourceRoot, function ( ) for _ ,plr in ipairs ( getElementsByType ( "player" ) ) do setElementData ( plr, 'MissionP', false ) setElementData ( plr, 'MissionR', false ) end end ) addCommandHandler ( "Start", function ( ) openMission ( ) end )
-
طيب وش هو getPlayerTable هل هو فنشكن مفيد ولا انت جايبنه كذا وليش حاط جدول في البداية دامك ماستخدمته + في حدث الماركر الثاني للحين ماستخدمت if source يعني بتصير الفنكشنات ع كل الماركرات #Edit: مثال جرب كذا : local marker = createMarker(2027.60059, 1007.15759, 10.82031,'cylinder',2,0,255,0,150) function getPlayersInMission ( plr ) local plrs = { } if ( isElement ( plr ) and ( getElementType ( plr ) == "player" ) and ( getElementData ( plr, "MissionR" ) == true ) ) then table.insert ( plrs, plr ) end return plrs end function isPlayerInMission ( num, plr ) if ( isElement ( plr ) and ( getElementType ( plr ) == "player" ) ) then if ( num == 2 ) then if ( getElementData ( plr, "MissionR" ) == true ) then return true else return false end else if ( getElementData ( plr, "MissionP" ) == true ) then return true else return false end end end end addEventHandler ( "onMarkerHit", resourceRoot, function ( player ) if ( source == marker ) and ( getElementType ( player ) == "player" ) then if ( isPlayerInMission ( 1, player ) == true ) then exports["dxmessages"]:outputDx ( player,"Hi "..getPlayerName(player).." #FFFFFFthe mission not started yet", "error" ) else if not ( isPedInVehicle ( player ) ) then exports["dxmessages"]:outputDx ( player, "this join was mission , Good Luck", "success" ) setElementData ( player, 'MissionR', true ) setElementData ( player, 'MissionP', true ) end end end end ) function openMission ( ) for _ ,plr in ipairs ( getElementsByType ( "player" ) ) do exports["dxmessages"]:outputDx ( plr, "the mission will start after 5 seconds", "info" ) setElementData ( plr, 'MissionP', false ) if ( isPlayerInMission ( 2, plr ) == true ) then setElementDimension ( plr, 100 ) setElementPosition ( plr, -2690.51367, 1289.90479, 55.42969 ) setElementFrozen( plr, true ) setTimer ( function ( ) setElementData ( plr, 'MissionR', false ) setElementFrozen ( plr , false ) exports["dxmessages"]:outputDx ( plr, "the mission was stated", "info" ) exports["dxmessages"]:outputDx ( plr, "Players in the mission :", "info" ) exports["dxmessages"]:outputDx ( plr, #getPlayersInMission ( plr ), "info" ) end , 5000, 1 ) end end end طبعا لازم اذا تبي تشغل الوضيفة تسوي كذا مثلا addCommandHandler ( "Start", function ( ) openMission ( ) end )
-
بعيدا عن الاكواد في شوية خبصات في الاكواد و بعض الفنكشنات getPlayerTable -- ? onMarkerHIT = onMarkerHit if source == marker then exports["dxmessages"]:outputDx(player,"Hi "..getPlayerName(player).." #FFFFFFthe mission not started yet","error") if ( Mission == 'false' ) then return -- هنا اتوقع انك تبي اذا راح للماركر والمهم ما بدأت يطلعله كذا وانت حاط الكلام قبل التحقق ^ -- + ماليه داعي تكرر حدث onMarkerHit تقدر تختصر addEventHandler('onMarkerHIT',root,function (aPlayer) -- ولاحظت في هذا الحدث انك حاط روت يعني لكل الماركرات بسبب انك ماحطيت if source ^ -- يعني الفنكشنات بتصير ع اي ماركر تروح له function openMission (player) thetimer = setTimer(function() exports["dxmessages"]:outputDx(player,"the mission started","success") Mission = "true" end , 5000 , 1 ) end) -- وعندك في هالحدث قوس زايد ^ addEventHandler('onMarkerHIT',root,function (aPlayer) if getElementType (aPlayer) == 'player' and not isPedInVehicle (aPlayer) then if Mission == false then return end exports["dxmessages"]:outputDx(aPlayer,"the mission was closed","info") if ( Mission == 'true' ) then setElementDimension ( aPlayer, 100 ) setElementPosition(aPlayer,-2690.51367, 1289.90479, 55.42969) exports["dxmessages"]:outputDx(player,"this join this mission , Good Luck","success") setElementFrozen(aPlayer,true) setElementData(player,'missionR',true) setTimer ( function () Mission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( plr , "MissionR" == true) then setElementFrozen ( plr , false ) exports["dxmessages"]:outputDx(player,"the mission was stated","info") end end end , 5000, 1 ) end end end ) -- وهنا player مو معرفة ^ -- والخ
-
وعليكم السلام وش تبي تسوي بالضبط ؟
-
جرب : function rmv ( plr ) for k, v in ipairs ( getEventHandlers ( "onPlayerChat", root ) ) do removeEventHandler ( "onPlayerChat", plr, v ) end end addCommandHandler( "عام", function ( plr, cmd, ... ) local text = table.concat ( { ... }, " " ) if not ( text or text == "" ) then return end rmv ( plr ) local acc = getPlayerAccount(plr) if ChatDisabled then if not isGuestAccount ( acc ) then if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true ) cancelEvent () rmv ( plr ) return end else outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true ) cancelEvent () rmv ( plr ) return end end if isGuestAccount ( acc ) then return end local customTag = getAccountData ( acc, "customTag" ) if customTag then local r, g, b = getPlayerNametagColor(plr) outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then local r, g, b = getPlayerNametagColor(plr) outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text) end end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for k, v in ipairs ( getElementsByType ( "player" ) ) do unbindKey ( v, "t", "down", "chatbox", "say" ) bindKey ( v, "t", "down", "chatbox", "عام" ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) unbindKey ( source, "t", "down", "chatbox", "say" ) bindKey ( source, "t", "down", "chatbox", "عام" ) end )
-
عفوا عفوا <>"
-
في طريقتين الطريقة الاولى : -- #Client : 'onClientClick' isMouseInPosition -- useful function triggerServerEvent removeEventHandler setTimer addEventHandler ---- -- #Server : table = {} isElement destroyElement createVehicle warpPedIntoVehicle الطريقة الثانية : تسوي متغير تحطه فولس Clickk = false وتستخدم هذي الفنكشنات -- #Client : 'onClientClick' isMouseInPosition -- useful function -- تسوي تحقق اذا كان المتغير فولس triggerServerEvent -- تحط المتغير ترو setTimer -- تسوي تايمر وتخلي المتغير فولس ---- -- #Server : table = {} isElement destroyElement createVehicle warpPedIntoVehicle
-
اوه اعذرني نسيت احذف الاقواس حقت الروت لاني كنت مستبدل getRootElement ب root جرب : addCommandHandler( "عام", function ( plr, cmd, ... ) local text = table.concat ( { ... }, " " ) if not ( text or text == "" ) then return end local acc = getPlayerAccount(plr) if ChatDisabled then if not isGuestAccount ( acc ) then if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true ) cancelEvent ( ) return end else outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true ) cancelEvent() return end end if isGuestAccount ( acc ) then return end local customTag = getAccountData ( acc, "customTag" ) if customTag then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root, r, g, b, true ) outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text) end end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for k, v in ipairs ( getElementsByType ( "player" ) ) do unbindKey ( v, "t", "down", "chatbox", "say" ) bindKey ( v, "t", "down", "chatbox", "عام" ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) unbindKey ( source, "t", "down", "chatbox", "say" ) bindKey ( source, "t", "down", "chatbox", "عام" ) end )
-
addCommandHandler( "عام", function ( plr, cmd, ... ) local text = table.concat ( { ... }, " " ) if not ( text or text == "" ) then return end local acc = getPlayerAccount(plr) if ChatDisabled then if not isGuestAccount ( acc ) then if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true ) cancelEvent ( ) return end else outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true ) cancelEvent() return end end if isGuestAccount ( acc ) then return end local customTag = getAccountData ( acc, "customTag" ) if customTag then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text) end end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for k, v in ipairs ( getElementsByType ( "player" ) ) do unbindKey ( v, "t", "down", "chatbox", "say" ) bindKey ( v, "t", "down", "chatbox", "عام" ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) unbindKey ( plr, "t", "down", "chatbox", "say" ) bindKey ( plr, "t", "down", "chatbox", "عام" ) end ) #Edit: اعتذر انسخ هالكود : addCommandHandler( "عام", function ( plr, cmd, ... ) local text = table.concat ( { ... }, " " ) if not ( text or text == "" ) then return end local acc = getPlayerAccount(plr) if ChatDisabled then if not isGuestAccount ( acc ) then if not isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true ) cancelEvent ( ) return end else outputChatBox ( "# [ عام ][ نظام الشات ]x الشات مغلق .", plr, 255, 0, 0, true ) cancelEvent() return end end if isGuestAccount ( acc ) then return end local customTag = getAccountData ( acc, "customTag" ) if customTag then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox(customTag.." " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: "..customTag.." " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#ff0000* [ #000000Owner#ff0000 ] " .. getPlayerName ( plr ) .. ":#a00000 " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Console ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - Ex")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#777777* [ Admin - x ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Admin - Ex ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Admin - At")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#777777* [ Admin - At ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Admin - At ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("V.I.P")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFcc00* [ V.I.P ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ V.I.P ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#6600cc* [ Solider ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Police ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 1")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFFF00* [ Level 1 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.1 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 2")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FF6600* [ Level 2 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.2 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 3")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#0FC615* [ Level 3 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.3 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 4")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#007000* [ Co.Manager Lv.4 ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.4 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 5")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FF0000* [ Manager ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.5 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Level 6")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#CC0000* [ Head.Manager ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Lv.6 ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Head.Admin")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( plr ) .. ":#0099cc " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Head.Admin ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Police.Active")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#6600cc* [ #ff0000Solider.Active#6600cc ] " .. getPlayerName ( plr ) .. ":#ffffff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Police.Active ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Trainee")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("#FFFF00* [ Trainee ] " .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT: [ Trainee ] " .. getPlayerName ( plr ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(acc), aclGetGroup("Everyone")) then cancelEvent() local r, g, b = getPlayerNametagColor(plr) outputChatBox("" .. getPlayerName ( plr ) .. ":#ffFFff " .. text, root(), r, g, b, true ) outputServerLog("CHAT:" .. getPlayerName ( plr ) .. ": " .. text) end end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for k, v in ipairs ( getElementsByType ( "player" ) ) do unbindKey ( v, "t", "down", "chatbox", "say" ) bindKey ( v, "t", "down", "chatbox", "عام" ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) unbindKey ( source, "t", "down", "chatbox", "say" ) bindKey ( source, "t", "down", "chatbox", "عام" ) end )
-
لا انت شرير
-
getTeamFromName
-
يب كنت بحطها لكن نسيت #edit : حط الكود كذا addCommandHandler( "عام", function ( plr, cmd, ... ) local msg = table.concat ( { ... }, " " ) if not ( msg or msg == "" ) then return end outputChatBox ( getPlayerName ( plr ) .. " : " .. msg, root, 0, 255, 0, true ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for k, v in ipairs ( getElementsByType ( "player" ) ) do unbindKey ( v, "t", "down", "chatbox", "say" ) bindKey ( v, "t", "down", "chatbox", "عام" ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) unbindKey ( source, "t", "down", "chatbox", "say" ) bindKey ( source, "t", "down", "chatbox", "عام" ) end )
-
الحل سهل استخدم outputChatBox مثال : addCommandHandler( "عام", function ( plr, cmd, ... ) local msg = table.concat ( { ... }, " " ) if not ( msg or msg == "" ) then return end outputChatBox ( getPlayerName ( plr ) .. " : " .. msg, root, 0, 255, 0, true ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for k, v in ipairs ( getElementsByType ( "player" ) ) do unbindKey ( v, "t", "down", "chatbox", "say" ) bindKey ( v, "t", "down", "chatbox", "عام" ) end end )
-
وانا وش اقول؟ هذا طلبك ان الي يروح للكول شيب يتحول الماء له بس لو تلاحظ انه كلنت
-
مافهمت المشكلة بالضبط وش مشكلتك ؟