• Calling a server fucntion from client
    2 replies, posted
Hi i need to call a server function, which in this case is Darkrp.AddMoney(-..DermaText:Getvalue()..) <-- if that wouldnt take money from the player please correct me, but what this addon is, is a hobo donation box. [CODE]include('shared.lua') function ENT:Draw() self:DrawModel() end local function DrawTheMenu() local DermaPanel = vgui.Create('DFrame') DermaPanel:SetSize(400, 150) DermaPanel:Center() DermaPanel:SetTitle('Donate') DermaPanel:ShowCloseButton(true) DermaPanel:SetSizable(false) DermaPanel:SetDeleteOnClose(true) DermaPanel:MakePopup() local hobotext = vgui.Create( "DLabel", ParntingFrame ) hobotext:SetParent( DermaPanel ) hobotext:SetText( "Enter the ammount of money you would like to donate!" ) hobotext:SetFont( "Trebuchet19" ) hobotext:SetTextColor( Color( 255, 255, 255, 255 ) ) -- Color of text hobotext:SizeToContents() -- You NEED this! local DermaText = vgui.Create( "DTextEntry", DermaPanel ) DermaText:SetParent( DermaPanel ) DermaText:SetPos( 30,77 ) DermaText:SetTall( 20 ) DermaText:SetWide( 335 ) DermaText:SetEnterAllowed( true ) DermaText.OnEnter = function() DermaPanel:SetVisible( false ) end end usermessage.Hook( "DrawTheMenu", DrawTheMenu ) [/CODE]
Look into using the Net Library
[QUOTE=clarkman28;49050092]Hi i need to call a server function, which in this case is Darkrp.AddMoney(-..DermaText:Getvalue()..) <-- if that wouldnt take money from the player please correct me, but what this addon is, is a hobo donation box. [CODE]include('shared.lua') function ENT:Draw() self:DrawModel() end local function DrawTheMenu() local DermaPanel = vgui.Create('DFrame') DermaPanel:SetSize(400, 150) DermaPanel:Center() DermaPanel:SetTitle('Donate') DermaPanel:ShowCloseButton(true) DermaPanel:SetSizable(false) DermaPanel:SetDeleteOnClose(true) DermaPanel:MakePopup() local hobotext = vgui.Create( "DLabel", ParntingFrame ) hobotext:SetParent( DermaPanel ) hobotext:SetText( "Enter the ammount of money you would like to donate!" ) hobotext:SetFont( "Trebuchet19" ) hobotext:SetTextColor( Color( 255, 255, 255, 255 ) ) -- Color of text hobotext:SizeToContents() -- You NEED this! local DermaText = vgui.Create( "DTextEntry", DermaPanel ) DermaText:SetParent( DermaPanel ) DermaText:SetPos( 30,77 ) DermaText:SetTall( 20 ) DermaText:SetWide( 335 ) DermaText:SetEnterAllowed( true ) DermaText.OnEnter = function() DermaPanel:SetVisible( false ) end end usermessage.Hook( "DrawTheMenu", DrawTheMenu ) [/CODE][/QUOTE] You mis-spelled amount and use net library like niandra said.
Sorry, you need to Log In to post a reply to this thread.