3NAD Posted March 15, 2013 Share Posted March 15, 2013 -- Client Side Wnd = guiCreateWindow ( 241,515,317,120, "No Subject", false ) On = guiCreateButton ( 70,30,50,50, "On", false, Wnd ) Off = guiCreateButton ( 10,30,50,50, "Off", false, Wnd ) addEventHandler ( "onClientGUIClick", root, function ( ) if source == On then triggerServerEvent ( "onChangeNameValue", localPlayer, localPlayer, "on" ) elseif source == Off then triggerServerEvent ( "onChangeNameValue", localPlayer, localPlayer, "off" ) end end ) -- Server Side local name = "name" local time = 30 local timer = {} addEvent ( "onChangeNameValue", true ) addEventHandler ( "onChangeNameValue", root, function ( player, value ) if value == "on" then addEventHandler ( "onPlayerChat", root, mute ) outputChatBox ( getPlayerName ( player ).." is busy", root, 255, 0, 0, true ) else removeEventHandler ( "onPlayerChat", root, mute ) outputChatBox ( getPlayerName ( player ).." is is Available", root, 255, 255, 0, true ) end end ) function mute ( msg, type ) if type == 0 then if string.find ( msg, name ) then setPlayerMuted ( source, true ) outputChatBox ( "* You Are Muted For " .. time .. " sec.", source, 255, 0, 0, true ) timer [source] = setTimer ( endMute, time * 1000, 1, source ) end end end function endMute ( player ) if player and getElementType ( player ) == "player" then setPlayerMuted ( player, false ) outputChatBox ( "* You Can Talk Now", player, 0, 255, 0, true ) end end addEventHandler ( "onPlayerQuit", root, function () if isTimer ( timer [source] ) then killTimer ( timer [source] ) end end ) Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 -- Server -- addEvent("on",true) addEventHandler("on",root, function () addEventHandler("onPlayerChat", root, mute) end) addEvent("off",true) addEventHandler("off",root, function () removeEventHandler("onPlayerChat", root, mute) end ) time = 30 timer = {} function mute(msg,type) local find = string.find(msg,getPlayerName(source)) if ( type == 0 and find ) then setPlayerMuted(source,true) outputChatBox("* You Are Muted For " .. time .. " " ,source,255,0,0) timer[source] = setTimer(endMute,time * 1000,1,source) end end function endMute(player) setPlayerMuted(player,false) outputChatBox("* You Can Talk Now",player,0,255,0) end addEventHandler("onPlayerQuit",root, function () if ( isTimer(timer[source]) ) then killTimer(timer[source]) end end ) -- Client -- Wnd = guiCreateWindow(241,515,317,120,"No Subject",false) On = guiCreateButton(70,30,50,50,"On",false,Wnd) Off = guiCreateButton(10,30,50,50,"Off",false,Wnd) -- client side addEventHandler("onClientGUIClick",root, function() PlayerName = getPlayerName(localPlayer) if source == On then outputChatBox(" "..PlayerName.." is busy",root,255,255,0,true) triggerServerEvent("on",getLocalPlayer()) elseif source == Off then outputChatBox(" "..PlayerName.." is is Available ",root,255,255,0,true) triggerServerEvent("off",getLocalPlayer()) end end) ضبط يطلع الكلام بالشات اني اكلت ميوت بس الكلام يطلع لك انا ما انصك ميوت Link to comment
iPrestege Posted March 15, 2013 Share Posted March 15, 2013 ضيف المود للادمنية resource.name Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 ضيف المود للادمنية resource.name ضبط بس عدل الكود خليه يجي معه اكواد الالوان... Link to comment
iPrestege Posted March 15, 2013 Share Posted March 15, 2013 addEvent("on",true) addEventHandler("on",root, function () addEventHandler("onPlayerChat", root, mute) end) addEvent("off",true) addEventHandler("off",root, function () removeEventHandler("onPlayerChat", root, mute) end ) time = 30 timer = {} function mute(msg,type) local find = string.find(msg,getPlayerName(source)) if ( type == 0 and find ) then setPlayerMuted(source,true) outputChatBox("* You Are Muted For " .. time .. " " ,source,255,0,0,true) timer[source] = setTimer(endMute,time * 1000,1,source) end end function endMute(player) setPlayerMuted(player,false) outputChatBox("* You Can Talk Now",player,0,255,0,true) end addEventHandler("onPlayerQuit",root, function () if ( isTimer(timer[source]) ) then killTimer(timer[source]) end end ) Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 addEvent("on",true) addEventHandler("on",root, function () addEventHandler("onPlayerChat", root, mute) end) addEvent("off",true) addEventHandler("off",root, function () removeEventHandler("onPlayerChat", root, mute) end ) time = 30 timer = {} function mute(msg,type) local find = string.find(msg,getPlayerName(source)) if ( type == 0 and find ) then setPlayerMuted(source,true) outputChatBox("* You Are Muted For " .. time .. " " ,source,255,0,0,true) timer[source] = setTimer(endMute,time * 1000,1,source) end end function endMute(player) setPlayerMuted(player,false) outputChatBox("* You Can Talk Now",player,0,255,0,true) end addEventHandler("onPlayerQuit",root, function () if ( isTimer(timer[source]) ) then killTimer(timer[source]) end end ) Are You Muted for 30 تتكرر 8 مرات You can talk now مثلها. Link to comment
iPrestege Posted March 15, 2013 Share Posted March 15, 2013 لول؟ يمكن ضغطت الزر مليون مرة؟ Link to comment
3NAD Posted March 15, 2013 Share Posted March 15, 2013 -- Client Side Wnd = guiCreateWindow ( 241,515,317,120, "No Subject", false ) On = guiCreateButton ( 70,30,50,50, "On", false, Wnd ) Off = guiCreateButton ( 10,30,50,50, "Off", false, Wnd ) addEventHandler ( "onClientGUIClick", root, function ( ) if source == On then triggerServerEvent ( "onChangeNameValue", localPlayer, localPlayer, "on" ) elseif source == Off then triggerServerEvent ( "onChangeNameValue", localPlayer, localPlayer, "off" ) end end ) -- Server Side local name = "name" local time = 30 local timer = {} local disable = {} addEvent ( "onChangeNameValue", true ) addEventHandler ( "onChangeNameValue", root, function ( player, value ) if value == "on" then if disable [ player ] then return end addEventHandler ( "onPlayerChat", root, mute ) outputChatBox ( getPlayerName ( player ).." is busy", root, 255, 0, 0, true ) disable [ player ] = true else if not disable [ player ] then return end removeEventHandler ( "onPlayerChat", root, mute ) outputChatBox ( getPlayerName ( player ).." is is Available", root, 255, 255, 0, true ) disable [ player ] = false end end ) function mute ( msg, type ) if type == 0 then if string.find ( msg, name ) then setPlayerMuted ( source, true ) outputChatBox ( "* You Are Muted For " .. time .. " sec.", source, 255, 0, 0, true ) timer [source] = setTimer ( endMute, time * 1000, 1, source ) end end end function endMute ( player ) if player and getElementType ( player ) == "player" then setPlayerMuted ( player, false ) outputChatBox ( "* You Can Talk Now", player, 0, 255, 0, true ) end end addEventHandler ( "onPlayerQuit", root, function ( ) if isTimer ( timer [source] ) then killTimer ( timer [source] ) end end ) Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 (edited) لآ بس كآن في خطأ عندي انا + المهم تمت الافاده + Thanks : All Edited March 15, 2013 by Guest Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 -- Client Side Wnd = guiCreateWindow ( 241,515,317,120, "No Subject", false ) On = guiCreateButton ( 70,30,50,50, "On", false, Wnd ) Off = guiCreateButton ( 10,30,50,50, "Off", false, Wnd ) addEventHandler ( "onClientGUIClick", root, function ( ) if source == On then triggerServerEvent ( "onChangeNameValue", localPlayer, localPlayer, "on" ) elseif source == Off then triggerServerEvent ( "onChangeNameValue", localPlayer, localPlayer, "off" ) end end ) -- Server Side local name = "name" local time = 30 local timer = {} local disable = {} addEvent ( "onChangeNameValue", true ) addEventHandler ( "onChangeNameValue", root, function ( player, value ) if value == "on" then if disable [ player ] then return end addEventHandler ( "onPlayerChat", root, mute ) outputChatBox ( getPlayerName ( player ).." is busy", root, 255, 0, 0, true ) disable [ player ] = true else if not disable [ player ] then return end removeEventHandler ( "onPlayerChat", root, mute ) outputChatBox ( getPlayerName ( player ).." is is Available", root, 255, 255, 0, true ) disable [ player ] = false end end ) function mute ( msg, type ) if type == 0 then if string.find ( msg, name ) then setPlayerMuted ( source, true ) outputChatBox ( "* You Are Muted For " .. time .. " sec.", source, 255, 0, 0, true ) timer [source] = setTimer ( endMute, time * 1000, 1, source ) end end end function endMute ( player ) if player and getElementType ( player ) == "player" then setPlayerMuted ( player, false ) outputChatBox ( "* You Can Talk Now", player, 0, 255, 0, true ) end end addEventHandler ( "onPlayerQuit", root, function ( ) if isTimer ( timer [source] ) then killTimer ( timer [source] ) end end ) انا ما كنت اقصد كذا يعني لو ضغط الزر on اي واحد يكتب اسم اللاعب ياكل ميوت. المهم تمت الافاده Link to comment
iPrestege Posted March 15, 2013 Share Posted March 15, 2013 العفو ذذ @ عناد يبيلها لاي لاعب بس غير name > getPlayerName # ذذ Link to comment
3NAD Posted March 15, 2013 Share Posted March 15, 2013 لووول الأكواد جته جاهزة مو صعب عليه يبدل سطر واحد Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 ما يحتاج موضوع جديد vehiclesComboBox = guiCreateComboBox ( left, top, windowWidth,windowHeight, "Vehicle Names", false ) طيب سويتها كذا : vehiclesComboBox = guiCreateComboBox (170,70,300,70, "Car", false ) طيب ابي داخلها سيارات !؟ داخل ال comboBox Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 واو سيارات؟ وش سيارات ذذ ههه موب لازم سيارات يعني اي خيار اي شيء ابي داخله اي شيء مثل هذا : https://wiki.multitheftauto.com/wiki/Fi ... mbobox.jpg Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 guiComboBoxAddItem وانا ليش حطيت المشكله!؟ عشان ما عرفت لها : guiComboBoxAddItem(comboBox, value) value وش هو ؟ وش احط مكانه ؟! Link to comment
iPrestege Posted March 15, 2013 Share Posted March 15, 2013 guiComboBoxAddItem(comboBox,"الكلام") Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 guiComboBoxAddItem(comboBox,"الكلام") طيب حق الميوت !؟ كيف اضبطها على comboBox بدل الازرار ؟ Link to comment
3NAD Posted March 15, 2013 Share Posted March 15, 2013 https://wiki.multitheftauto.com/wiki/OnC ... oxAccepted Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 https://wiki.multitheftauto.com/wiki/OnClientGUIComboBoxAccepted Thanks Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 مم آسف طلباتي كثرت... حاولت اسوي الكود ذا : shutdown ولكن ما عرفت المثال صعب Link to comment
فاّرس Posted March 15, 2013 Author Share Posted March 15, 2013 ورني اللي حاولت لة function( ) if not then if hasObjectPermissionTo( resource, "function.shutdown" ) then end ادري جايب العييد Link to comment
iPrestege Posted March 15, 2013 Share Posted March 15, 2013 تبي اي احد يسويها عادي ولا لازم قروب ولا كيف وضعها ذذ ؟ Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now