Jump to content

[help] outputchatbox


HUNGRY:3

Recommended Posts

hello i want the output to output for the player who click the button [CLIENT SIDE]

but it output for everybody

it works in server side if we put thePlayer or... in client side it won't work.

  
  
lp = getLocalPlayer() 
  
function buy15() 
player_money  = getPlayerMoney(lp) 
if source == GUNPANEL1.button[15] then 
if ( player_money >= 100000) then 
setElementData(lp,"lvl1",false) 
setElementData(lp,"lvl2",false) 
setElementData(lp,"lvl3",false) 
setElementData(lp,"lvl4",false) 
setElementData(lp,"lvl5",false) 
setElementData(lp,"lvl6",false) 
setElementData(lp,"lvl7",false) 
setElementData(lp,"lvl8",false) 
setElementData(lp,"lvl9",false) 
setElementData(lp,"lvl10",false) 
setElementData(lp,"lvl11",false) 
setElementData(lp,"lvl12",false) 
setElementData(lp,"lvl13",false) 
setElementData(lp,"lvl14",false) 
setElementData(lp,"lvl15",true) 
outputChatBox("WEAPON USED",255,0,0) 
guiSetText(GUNPANEL1.edit[1], "ROCKET LAUCHER") 
end 
end 
end 
addEventHandler("onClientGUIClick", root, buy15) 

Link to comment

Does this work for you?

  
local lp = getLocalPlayer() 
  
function buy15() 
    if lp ~= localPlayer then return end 
    local player_money  = getPlayerMoney(lp) 
    if source == GUNPANEL1.button[15] then 
        if ( player_money >= 100000) then 
            setElementData(lp,"lvl1",false) 
            setElementData(lp,"lvl2",false) 
            setElementData(lp,"lvl3",false) 
            setElementData(lp,"lvl4",false) 
            setElementData(lp,"lvl5",false) 
            setElementData(lp,"lvl6",false) 
            setElementData(lp,"lvl7",false) 
            setElementData(lp,"lvl8",false) 
            setElementData(lp,"lvl9",false) 
            setElementData(lp,"lvl10",false) 
            setElementData(lp,"lvl11",false) 
            setElementData(lp,"lvl12",false) 
            setElementData(lp,"lvl13",false) 
            setElementData(lp,"lvl14",false) 
            setElementData(lp,"lvl15",true) 
            outputChatBox("WEAPON USED",255,0,0) 
            guiSetText(GUNPANEL1.edit[1], "ROCKET LAUCHER") 
        end 
    end 
end 
addEventHandler("onClientGUIClick", root, buy15) 

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