3NAD Posted March 15, 2013 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 )
فاّرس Posted March 15, 2013 Author 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) ضبط يطلع الكلام بالشات اني اكلت ميوت بس الكلام يطلع لك انا ما انصك ميوت
فاّرس Posted March 15, 2013 Author Posted March 15, 2013 ضيف المود للادمنية resource.name ضبط بس عدل الكود خليه يجي معه اكواد الالوان...
iPrestege Posted March 15, 2013 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 )
فاّرس Posted March 15, 2013 Author 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 مثلها.
3NAD Posted March 15, 2013 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 )
فاّرس Posted March 15, 2013 Author Posted March 15, 2013 (edited) لآ بس كآن في خطأ عندي انا + المهم تمت الافاده + Thanks : All Edited March 15, 2013 by Guest
فاّرس Posted March 15, 2013 Author 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 اي واحد يكتب اسم اللاعب ياكل ميوت. المهم تمت الافاده
iPrestege Posted March 15, 2013 Posted March 15, 2013 العفو ذذ @ عناد يبيلها لاي لاعب بس غير name > getPlayerName # ذذ
فاّرس Posted March 15, 2013 Author Posted March 15, 2013 ما يحتاج موضوع جديد vehiclesComboBox = guiCreateComboBox ( left, top, windowWidth,windowHeight, "Vehicle Names", false ) طيب سويتها كذا : vehiclesComboBox = guiCreateComboBox (170,70,300,70, "Car", false ) طيب ابي داخلها سيارات !؟ داخل ال comboBox
فاّرس Posted March 15, 2013 Author Posted March 15, 2013 واو سيارات؟ وش سيارات ذذ ههه موب لازم سيارات يعني اي خيار اي شيء ابي داخله اي شيء مثل هذا : https://wiki.multitheftauto.com/wiki/Fi ... mbobox.jpg
فاّرس Posted March 15, 2013 Author Posted March 15, 2013 guiComboBoxAddItem وانا ليش حطيت المشكله!؟ عشان ما عرفت لها : guiComboBoxAddItem(comboBox, value) value وش هو ؟ وش احط مكانه ؟!
فاّرس Posted March 15, 2013 Author Posted March 15, 2013 guiComboBoxAddItem(comboBox,"الكلام") طيب حق الميوت !؟ كيف اضبطها على comboBox بدل الازرار ؟
3NAD Posted March 15, 2013 Posted March 15, 2013 https://wiki.multitheftauto.com/wiki/OnC ... oxAccepted
فاّرس Posted March 15, 2013 Author Posted March 15, 2013 https://wiki.multitheftauto.com/wiki/OnClientGUIComboBoxAccepted Thanks
فاّرس Posted March 15, 2013 Author Posted March 15, 2013 مم آسف طلباتي كثرت... حاولت اسوي الكود ذا : shutdown ولكن ما عرفت المثال صعب
فاّرس Posted March 15, 2013 Author Posted March 15, 2013 ورني اللي حاولت لة function( ) if not then if hasObjectPermissionTo( resource, "function.shutdown" ) then end ادري جايب العييد
iPrestege Posted March 15, 2013 Posted March 15, 2013 تبي اي احد يسويها عادي ولا لازم قروب ولا كيف وضعها ذذ ؟
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