Jump to content

مشآكلي My problems


Recommended Posts

-- 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
  • Replies 110
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

-- 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

  
  
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
  
  
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
-- 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
-- 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

ما يحتاج موضوع جديد

vehiclesComboBox = guiCreateComboBox ( left, top, windowWidth,windowHeight, "Vehicle Names", false ) 

طيب سويتها كذا :

vehiclesComboBox = guiCreateComboBox (170,70,300,70, "Car", false ) 

طيب ابي داخلها سيارات !؟

داخل ال comboBox

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...